--- rxvt-unicode/src/scrollbar-rxvt.C 2008/02/06 01:29:19 1.35 +++ rxvt-unicode/src/scrollbar-rxvt.C 2008/02/19 10:46:03 1.36 @@ -47,7 +47,7 @@ /* draw triangular button with a shadow of 2 pixels */ static void -draw_button (rxvt_term *term, int x, int y, int state, int dirn) +draw_button (rxvt_term *term, int x, int y, int dirn) { unsigned int sz, sz2; XPoint pt[3]; @@ -56,19 +56,16 @@ sz = term->scrollBar.width; sz2 = sz / 2; - switch (state) + if ((dirn == UP && term->scrollBar.state == STATE_UP) + || (dirn == DN && term->scrollBar.state == STATE_DOWN)) { - case +1: - top = term->topShadowGC; - bot = term->botShadowGC; - break; - case -1: - top = term->botShadowGC; - bot = term->topShadowGC; - break; - default: - top = bot = term->scrollbarGC; - break; + top = term->botShadowGC; + bot = term->topShadowGC; + } + else + { + top = term->topShadowGC; + bot = term->botShadowGC; } /* fill triangle */ @@ -151,7 +148,6 @@ { int sbshadow = scrollBar.shadow; int sbwidth = (int)scrollBar.width; - int state; if ((scrollBar.init & R_SB_RXVT) == 0) { @@ -218,10 +214,8 @@ draw_shadow (this, sbshadow, scrollBar.top, sbwidth, scrollbar_len); /* Redraw scrollbar arrows */ - state = scrollBar.state == STATE_UP ? -1 : +1; - draw_button (this, sbshadow, sbshadow, state, UP); - state = scrollBar.state == STATE_DOWN ? -1 : +1; - draw_button (this, sbshadow, scrollBar.end + 1, state, DN); + draw_button (this, sbshadow, sbshadow, UP); + draw_button (this, sbshadow, scrollBar.end + 1, DN); return 1; }