--- rxvt-unicode/src/scrollbar-next.C 2011/02/21 07:41:03 1.31 +++ rxvt-unicode/src/scrollbar-next.C 2014/05/30 19:40:23 1.34 @@ -10,7 +10,7 @@ * * 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 - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, @@ -148,7 +148,7 @@ scrollBar_t::init_next () { XGCValues gcvalue; - XColor xcol; + rxvt_color color; Pixmap stipple; unsigned long light, dark; @@ -162,20 +162,23 @@ whiteGC = XCreateGC (term->dpy, win, GCForeground | GCGraphicsExposures, &gcvalue); - xcol.red = 0xaeba; - xcol.green = 0xaaaa; - xcol.blue = 0xaeba; - xcol.pixel = term->pix_colors_focused[Color_scroll]; - light = gcvalue.foreground = xcol.pixel; + light = term->pix_colors_focused[Color_scroll]; +#if 0 + //color used by rxvt + if (color.set (term, rgba (0xaeba, 0xaaaa, 0xaeba))) + light = color; +#endif + gcvalue.foreground = light; grayGC = XCreateGC (term->dpy, win, GCForeground | GCGraphicsExposures, &gcvalue); - xcol.red = 0x51aa; - xcol.green = 0x5555; - xcol.blue = 0x5144; - //if (!rXAllocColor (&xcol, "dark gray"))//TODO//D// - xcol.pixel = term->pix_colors_focused[Color_Grey25]; - dark = gcvalue.foreground = xcol.pixel; + dark = term->pix_colors_focused[Color_Grey25]; +#if 0 + //color used by rxvt + if (color.set (term, rgba (0x51aa, 0x5555, 0x5144))) + dark = color; +#endif + gcvalue.foreground = dark; darkGC = XCreateGC (term->dpy, win, GCForeground | GCGraphicsExposures, &gcvalue); @@ -188,8 +191,6 @@ gcvalue.fill_style = FillOpaqueStippled; gcvalue.stipple = stipple; - /* XSetWindowBackground (dpy, scrollBar.win, pix_colors_focused[Color_Red]); */ - stippleGC = XCreateGC (term->dpy, win, GCForeground | GCBackground | GCStipple | GCFillStyle | GCGraphicsExposures, &gcvalue); @@ -235,9 +236,9 @@ int height = end + SB_BUTTON_TOTAL_HEIGHT + SB_PADDING; Drawable src; - if ((init & R_SB_NEXT) == 0) + if ((init & SB_STYLE_NEXT) == 0) { - init |= R_SB_NEXT; + init |= SB_STYLE_NEXT; init_next (); } @@ -284,12 +285,12 @@ height - SB_BUTTON_SINGLE_HEIGHT, SB_BUTTON_WIDTH, SB_BUTTON_HEIGHT); - src = state == STATE_UP ? upArrowHi : upArrow; + src = state == SB_STATE_UP ? upArrowHi : upArrow; XCopyArea (term->dpy, src, win, whiteGC, 0, 0, ARROW_WIDTH, ARROW_HEIGHT, SB_BUTTON_FACE_X, height - SB_BUTTON_BOTH_HEIGHT + SB_BEVEL_WIDTH_UPPER_LEFT); - src = state == STATE_DOWN ? downArrowHi : downArrow; + src = state == SB_STATE_DOWN ? downArrowHi : downArrow; XCopyArea (term->dpy, src, win, whiteGC, 0, 0, ARROW_WIDTH, ARROW_HEIGHT, SB_BUTTON_FACE_X, height - SB_BUTTON_SINGLE_HEIGHT + SB_BEVEL_WIDTH_UPPER_LEFT);