ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/command.C
(Generate patch)

Comparing rxvt-unicode/src/command.C (file contents):
Revision 1.402 by ayin, Fri Feb 1 14:13:52 2008 UTC vs.
Revision 1.403 by ayin, Fri Feb 1 14:15:10 2008 UTC

1947 /* 1947 /*
1948 * Scrollbar window processing of button press 1948 * Scrollbar window processing of button press
1949 */ 1949 */
1950 if (scrollBar.state && ev.window == scrollBar.win) 1950 if (scrollBar.state && ev.window == scrollBar.win)
1951 { 1951 {
1952 int upordown = 0; 1952 page_dirn direction = NO_DIR;
1953 1953
1954 if (scrollBar.upButton (ev.y)) 1954 if (scrollBar.upButton (ev.y))
1955 upordown = -1; /* up */ 1955 direction = UP; /* up */
1956 else if (scrollBar.dnButton (ev.y)) 1956 else if (scrollBar.dnButton (ev.y))
1957 upordown = 1; /* down */ 1957 direction = DN; /* down */
1958 1958
1959 scrollBar.state = STATE_IDLE; 1959 scrollBar.state = STATE_IDLE;
1960 /* 1960 /*
1961 * Rxvt-style scrollbar: 1961 * Rxvt-style scrollbar:
1962 * move up if mouse is above slider 1962 * move up if mouse is above slider
1973 /* 1973 /*
1974 * Mouse report disabled scrollbar: 1974 * Mouse report disabled scrollbar:
1975 * arrow buttons - send up/down 1975 * arrow buttons - send up/down
1976 * click on scrollbar - send pageup/down 1976 * click on scrollbar - send pageup/down
1977 */ 1977 */
1978 if (upordown < 0) 1978 if (direction == UP)
1979 tt_printf ("\033[A"); 1979 tt_printf ("\033[A");
1980 else if (upordown > 0) 1980 else if (direction == DN)
1981 tt_printf ("\033[B"); 1981 tt_printf ("\033[B");
1982 else 1982 else
1983 switch (ev.button) 1983 switch (ev.button)
1984 { 1984 {
1985 case Button2: 1985 case Button2:
1995 } 1995 }
1996 else 1996 else
1997#endif /* NO_SCROLLBAR_REPORT */ 1997#endif /* NO_SCROLLBAR_REPORT */
1998 1998
1999 { 1999 {
2000 if (upordown) 2000 if (direction != NO_DIR)
2001 { 2001 {
2002#ifndef NO_SCROLLBAR_BUTTON_CONTINUAL_SCROLLING 2002#ifndef NO_SCROLLBAR_BUTTON_CONTINUAL_SCROLLING
2003 if (!cont_scroll_ev.is_active ()) 2003 if (!cont_scroll_ev.is_active ())
2004 cont_scroll_ev.start (SCROLLBAR_INITIAL_DELAY, SCROLLBAR_CONTINUOUS_DELAY); 2004 cont_scroll_ev.start (SCROLLBAR_INITIAL_DELAY, SCROLLBAR_CONTINUOUS_DELAY);
2005#endif 2005#endif
2006 if (scr_page (upordown < 0 ? UP : DN, 1)) 2006 if (scr_page (direction, 1))
2007 { 2007 {
2008 if (upordown < 0) 2008 if (direction == UP)
2009 scrollBar.state = STATE_UP; 2009 scrollBar.state = STATE_UP;
2010 else 2010 else
2011 scrollBar.state = STATE_DOWN; 2011 scrollBar.state = STATE_DOWN;
2012 } 2012 }
2013 } 2013 }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines