--- rxvt-unicode/src/scrollbar.C 2004/08/23 19:47:03 1.24 +++ rxvt-unicode/src/scrollbar.C 2006/01/15 06:02:41 1.30 @@ -70,10 +70,10 @@ #define R_SCROLLEND_XTERM szHint.height #define R_SCROLLBEG_NEXT 0 #define R_SCROLLEND_NEXT szHint.height - (SB_BUTTON_TOTAL_HEIGHT + \ - SB_PADDING) + SB_PADDING) #define R_SCROLLBEG_RXVT (scrollBar.width + 1) + sb_shadow #define R_SCROLLEND_RXVT szHint.height - R_SCROLLBEG_RXVT - \ - (2 * sb_shadow) + (2 * sb_shadow) #if defined(PLAIN_SCROLLBAR) if (scrollBar.style == R_SB_PLAIN) @@ -112,13 +112,13 @@ { /* create the scrollbar window */ scrollBar.win = XCreateSimpleWindow (display->display, - TermWin.parent[0], - window_sb_x, 0, - scrollbar_TotalWidth (), - szHint.height, - 0, - pix_colors[Color_fg], - pix_colors[Color_border]); + parent[0], + window_sb_x, 0, + scrollbar_TotalWidth (), + szHint.height, + 0, + pix_colors[Color_fg], + pix_colors[Color_border]); #ifdef DEBUG_X XStoreName (display->display, scrollBar.win, "scrollbar"); #endif @@ -155,9 +155,9 @@ if (update) { - top = (TermWin.nscrolled - TermWin.view_start); - bot = top + (TermWin.nrow - 1); - len = max ((TermWin.nscrolled + (TermWin.nrow - 1)), 1); + top = view_start - top_row; + bot = top + (nrow - 1); + len = max (nrow - 1 - top_row, 1); adj = (((bot - top) * scrollbar_size ()) % len) > 0 ? 1 : 0; scrollBar.top = (scrollBar.beg + (top * scrollbar_size ()) / len); @@ -232,8 +232,8 @@ width = min (i, SB_WIDTH_MAXIMUM); # if defined(RXVT_SCROLLBAR) - if (! (options & Opt_scrollBar_floating) && style == R_SB_RXVT) - sb_shadow = SHADOW; + if (! OPTION (Opt_scrollBar_floating) && style == R_SB_RXVT) + sb_shadow = MENU_SHADOW; # endif scrollBar.style = style;