--- rxvt-unicode/src/scrollbar.C 2011/09/01 08:11:27 1.74 +++ rxvt-unicode/src/scrollbar.C 2012/10/14 12:31:59 1.78 @@ -73,7 +73,7 @@ term->szHint.height, 0, term->pix_colors[Color_fg], - term->pix_colors[Color_border]); + term->pix_colors[color ()]); XDefineCursor (term->dpy, win, leftptr_cursor); XSelectInput (term->dpy, win, @@ -111,9 +111,10 @@ int sb_top = term->view_start - term->top_row; int sb_bot = sb_top + (term->nrow - 1); int sb_len = max (term->nrow - 1 - term->top_row, 1); + int n = min (min_height (), size ()); - top = beg + (sb_top * size ()) / sb_len; - bot = top + ecb_div_ru ((sb_bot - sb_top) * size (), sb_len) + min_height (); + top = beg + (sb_top * (size () - n)) / sb_len; + bot = top + ecb_div_ru ((sb_bot - sb_top) * (size () - n), sb_len) + n; /* no change */ if (top == last_top && bot == last_bot @@ -232,6 +233,17 @@ #endif } +int +scrollBar_t::color () +{ +#ifdef RXVT_SCROLLBAR + if (style == SB_STYLE_RXVT && shadow) + return Color_trough; + else +#endif + return Color_border; +} + void scrollBar_t::update_data () { @@ -263,7 +275,7 @@ if (style == SB_STYLE_RXVT) { beg = (width + 1) + shadow; - end = term->szHint.height - beg - (2 * shadow); + end = term->szHint.height - beg; update = &scrollBar_t::show_rxvt; } #endif