--- rxvt-unicode/src/scrollbar-rxvt.C 2008/02/19 17:49:16 1.38 +++ rxvt-unicode/src/scrollbar-rxvt.C 2012/10/02 10:29:12 1.44 @@ -4,7 +4,7 @@ * * Copyright (c) 1997,1998 mj olesen * Copyright (c) 1999-2001 Geoff Wing - * Copyright (c) 2004-2006 Marc Lehmann + * Copyright (c) 2004-2006 Marc Lehmann * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -60,8 +60,8 @@ sz = sb->width; sz2 = sz / 2; - if ((dirn == UP && sb->state == STATE_UP) - || (dirn == DN && sb->state == STATE_DOWN)) + if ((dirn == UP && sb->state == SB_STATE_UP) + || (dirn == DN && sb->state == SB_STATE_DOWN)) { top = sb->botShadowGC; bot = sb->topShadowGC; @@ -150,14 +150,13 @@ int scrollBar_t::show_rxvt (int update) { - int sbshadow = shadow; int sbwidth = (int)width; - if ((init & R_SB_RXVT) == 0) + if ((init & SB_STYLE_RXVT) == 0) { XGCValues gcvalue; - init |= R_SB_RXVT; + init |= SB_STYLE_RXVT; gcvalue.foreground = term->pix_colors[Color_topShadow]; topShadowGC = XCreateGC (term->dpy, term->vt, GCForeground, &gcvalue); @@ -165,11 +164,6 @@ botShadowGC = XCreateGC (term->dpy, term->vt, GCForeground, &gcvalue); gcvalue.foreground = term->pix_colors[ (term->depth <= 2 ? Color_fg : Color_scroll)]; scrollbarGC = XCreateGC (term->dpy, term->vt, GCForeground, &gcvalue); - if (sbshadow) - { - XSetWindowBackground (term->dpy, win, term->pix_colors_focused[Color_trough]); - XClearWindow (term->dpy, win); - } } else { @@ -177,13 +171,13 @@ { if (last_top < top) XClearArea (term->dpy, win, - sbshadow, last_top, + shadow, last_top, sbwidth, (top - last_top), False); if (bot < last_bot) XClearArea (term->dpy, win, - sbshadow, bot, + shadow, bot, sbwidth, (last_bot - bot), False); } @@ -199,7 +193,7 @@ if (term->option (Opt_scrollBar_right)) xofs = 0; else - xofs = sbshadow ? sbwidth : sbwidth - 1; + xofs = shadow ? sbwidth : sbwidth - 1; XDrawLine (term->dpy, win, botShadowGC, xofs, 0, xofs, end + sbwidth); @@ -207,19 +201,19 @@ #endif XFillRectangle (term->dpy, win, scrollbarGC, - sbshadow, top, sbwidth, + shadow, top, sbwidth, bot - top); - if (sbshadow) + if (shadow) /* trough shadow */ - draw_shadow (this, 0, 0, sbwidth + 2 * sbshadow, end + (sbwidth + 1) + sbshadow); + draw_shadow (this, 0, 0, sbwidth + 2 * shadow, end + (sbwidth + 1) + shadow); /* shadow for scrollbar slider */ - draw_shadow (this, sbshadow, top, sbwidth, bot - top); + draw_shadow (this, shadow, top, sbwidth, bot - top); /* Redraw scrollbar arrows */ - draw_button (this, sbshadow, sbshadow, UP); - draw_button (this, sbshadow, end + 1, DN); + draw_button (this, shadow, shadow, UP); + draw_button (this, shadow, end + 1, DN); return 1; }