--- rxvt-unicode/src/scrollbar-rxvt.C 2005/12/31 17:16:17 1.19 +++ rxvt-unicode/src/scrollbar-rxvt.C 2006/01/16 17:11:12 1.22 @@ -27,7 +27,26 @@ /*----------------------------------------------------------------------*/ #if defined(RXVT_SCROLLBAR) -/* draw triangular button with a shadow of SHADOW (1 or 2) pixels */ +#define SHADOW_WIDTH 1 + +static void +rxvt_Draw_Shadow (Display *display, Window win, GC topShadow, GC botShadow, int x, int y, int w, int h) +{ + int shadow; + + shadow = (w == 0 || h == 0) ? 1 : SHADOW_WIDTH; + w += x - 1; + h += y - 1; + for (; shadow-- > 0; x++, y++, w--, h--) + { + XDrawLine (display, win, topShadow, x, y, w, y); + XDrawLine (display, win, topShadow, x, y, x, h); + XDrawLine (display, win, botShadow, w, h, w, y + 1); + XDrawLine (display, win, botShadow, w, h, x + 1, h); + } +} + +/* draw triangular button with a shadow of 2 pixels */ void rxvt_term::Draw_button (int x, int y, int state, int dirn) { @@ -80,7 +99,7 @@ XDrawLine (display->display, scrollBar.win, top, pt[0].x, pt[0].y, pt[1].x, pt[1].y); -#if (SHADOW > 1) +#if SHADOW_WIDTH > 1 /* doubled */ pt[0].x++; @@ -98,6 +117,7 @@ XDrawLine (display->display, scrollBar.win, top, pt[0].x, pt[0].y, pt[1].x, pt[1].y); #endif + /* draw shadow on right */ pt[1].x = x + sz - 1; /* pt[2].x = x + sz2; */ @@ -106,7 +126,7 @@ XDrawLine (display->display, scrollBar.win, bot, pt[2].x, pt[2].y, pt[1].x, pt[1].y); -#if (SHADOW > 1) +#if SHADOW_WIDTH > 1 /* doubled */ pt[1].x--; if (dirn == UP)