--- rxvt-unicode/src/scrollbar-plain.C 2004/01/31 04:12:10 1.1 +++ rxvt-unicode/src/scrollbar-plain.C 2014/05/22 18:54:33 1.29 @@ -1,13 +1,14 @@ -/*--------------------------------*-C-*---------------------------------* - * File: scrollbar-plain.c +/*----------------------------------------------------------------------* + * File: scrollbar-plain.C *----------------------------------------------------------------------* * * Copyright (c) 1997,1998 mj olesen * Copyright (c) 1999-2001 Geoff Wing + * 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 - * 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, @@ -22,47 +23,49 @@ #include "../config.h" /* NECESSARY */ #include "rxvt.h" /* NECESSARY */ -#include "scrollbar-plain.intpro" /* PROTOS for internal routines */ /*----------------------------------------------------------------------*/ #if defined(PLAIN_SCROLLBAR) int -rxvt_term::scrollbar_show_plain (int update __attribute__((unused)), int last_top, int last_bot, int scrollbar_len) +scrollBar_t::show_plain (int update) { - int xsb = 0; - int sbwidth = scrollBar.width - 1; + int xsb = 0; + int sbwidth = width - 1; - if ((scrollBar.init & R_SB_PLAIN) == 0) { - XGCValues gcvalue; + if ((init & SB_STYLE_PLAIN) == 0) + { + XGCValues gcvalue; - scrollBar.init |= R_SB_PLAIN; - gcvalue.foreground = PixColors[Color_fg]; - gcvalue.background = PixColors[Color_bg]; - - pscrollbarGC = XCreateGC(Xdisplay, scrollBar.win, - GCForeground | GCBackground - | GCFillStyle, &gcvalue); - gcvalue.foreground = PixColors[Color_border]; - pShadowGC = XCreateGC(Xdisplay, scrollBar.win, GCForeground, &gcvalue); + init |= SB_STYLE_PLAIN; + gcvalue.foreground = term->pix_colors_focused[Color_scroll]; + + pscrollbarGC = XCreateGC (term->dpy, win, GCForeground, &gcvalue); + } + + xsb = term->option (Opt_scrollBar_right) ? 1 : 0; + + if (update) + { + if (last_top < top) + XClearArea (term->dpy, win, + 0, last_top, + sbwidth + 1, top - last_top, False); + + if (bot < last_bot) + XClearArea (term->dpy, win, + 0, bot, + sbwidth + 1, last_bot - bot, False); } -/* instead of XClearWindow (Xdisplay, scrollBar.win); */ - xsb = (Options & Opt_scrollBar_right) ? 1 : 0; - if (last_top < scrollBar.top) - XClearArea(Xdisplay, scrollBar.win, - sb_shadow + xsb, last_top, - sbwidth + 1, (scrollBar.top - last_top), False); - - if (scrollBar.bot < last_bot) - XClearArea(Xdisplay, scrollBar.win, - sb_shadow + xsb, scrollBar.bot, - sbwidth + 1, (last_bot - scrollBar.bot), False); - -/* scrollbar slider */ - XFillRectangle(Xdisplay, scrollBar.win, xscrollbarGC, - xsb + 1, scrollBar.top, sbwidth, scrollbar_len); + else + XClearWindow (term->dpy, win); - return 1; + /* scrollbar slider */ + XFillRectangle (term->dpy, win, pscrollbarGC, + 1 - xsb, top, sbwidth, bot - top); + + return 1; } -#endif /* XTERM_SCROLLBAR */ -/*----------------------- end-of-file (C source) -----------------------*/ + +#endif +