From b73794edd536c181ecfc9ad9c540c05a8723b9f7 Mon Sep 17 00:00:00 2001 From: ayin Date: Fri, 1 Feb 2008 14:15:10 +0000 Subject: [PATCH] Simplify. --- src/command.C | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/command.C b/src/command.C index 4863bb7f..733d80bf 100644 --- a/src/command.C +++ b/src/command.C @@ -1949,12 +1949,12 @@ rxvt_term::button_press (XButtonEvent &ev) */ if (scrollBar.state && ev.window == scrollBar.win) { - int upordown = 0; + page_dirn direction = NO_DIR; if (scrollBar.upButton (ev.y)) - upordown = -1; /* up */ + direction = UP; /* up */ else if (scrollBar.dnButton (ev.y)) - upordown = 1; /* down */ + direction = DN; /* down */ scrollBar.state = STATE_IDLE; /* @@ -1975,9 +1975,9 @@ rxvt_term::button_press (XButtonEvent &ev) * arrow buttons - send up/down * click on scrollbar - send pageup/down */ - if (upordown < 0) + if (direction == UP) tt_printf ("\033[A"); - else if (upordown > 0) + else if (direction == DN) tt_printf ("\033[B"); else switch (ev.button) @@ -1997,15 +1997,15 @@ rxvt_term::button_press (XButtonEvent &ev) #endif /* NO_SCROLLBAR_REPORT */ { - if (upordown) + if (direction != NO_DIR) { #ifndef NO_SCROLLBAR_BUTTON_CONTINUAL_SCROLLING if (!cont_scroll_ev.is_active ()) cont_scroll_ev.start (SCROLLBAR_INITIAL_DELAY, SCROLLBAR_CONTINUOUS_DELAY); #endif - if (scr_page (upordown < 0 ? UP : DN, 1)) + if (scr_page (direction, 1)) { - if (upordown < 0) + if (direction == UP) scrollBar.state = STATE_UP; else scrollBar.state = STATE_DOWN; -- 2.34.1