ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/scrollbar.C
(Generate patch)

Comparing rxvt-unicode/src/scrollbar.C (file contents):
Revision 1.66 by sf-exg, Thu Apr 7 12:19:41 2011 UTC vs.
Revision 1.69 by sf-exg, Thu Aug 25 18:01:28 2011 UTC

49 change = 1; 49 change = 1;
50 } 50 }
51 } 51 }
52 else 52 else
53 { 53 {
54 state = 0; 54 state = STATE_OFF;
55 XUnmapWindow (term->dpy, win); 55 XUnmapWindow (term->dpy, win);
56 change = 1; 56 change = 1;
57 } 57 }
58 58
59 return change; 59 return change;
116 if (refresh) 116 if (refresh)
117 { 117 {
118 int sb_top = term->view_start - term->top_row; 118 int sb_top = term->view_start - term->top_row;
119 int sb_bot = sb_top + (term->nrow - 1); 119 int sb_bot = sb_top + (term->nrow - 1);
120 int sb_len = max (term->nrow - 1 - term->top_row, 1); 120 int sb_len = max (term->nrow - 1 - term->top_row, 1);
121 int sb_size = (sb_bot - sb_top) * size ();
122 121
123 top = beg + (sb_top * size ()) / sb_len; 122 top = beg + (sb_top * size ()) / sb_len;
124 bot = top + sb_size / sb_len + min_height () + (sb_size % sb_len > 0); 123 bot = top + ecb_div_ru ((sb_bot - sb_top) * size (), sb_len) + min_height ();
125 /* no change */ 124 /* no change */
126 if (top == last_top 125 if (top == last_top
127 && bot == last_bot 126 && bot == last_bot
128 && (state == last_state 127 && (state == last_state
129 || !(state == STATE_UP || state == STATE_DOWN))) 128 || !(state == STATE_UP || state == STATE_DOWN)))
141 140
142void 141void
143scrollBar_t::setup (rxvt_term *term) 142scrollBar_t::setup (rxvt_term *term)
144{ 143{
145 int i; 144 int i;
146 short style, width; 145 short width;
147 const char *scrollalign, *scrollstyle, *thickness; 146 const char *scrollalign, *scrollstyle, *thickness;
147 enum sb_style style;
148 148
149 this->term = term; 149 this->term = term;
150 scrollalign = term->rs[Rs_scrollBar_align]; 150 scrollalign = term->rs[Rs_scrollBar_align];
151 scrollstyle = term->rs[Rs_scrollstyle]; 151 scrollstyle = term->rs[Rs_scrollstyle];
152 thickness = term->rs[Rs_scrollBar_thickness]; 152 thickness = term->rs[Rs_scrollBar_thickness];
208 if (strncasecmp (scrollalign, "top", 3) == 0) 208 if (strncasecmp (scrollalign, "top", 3) == 0)
209 align = R_SB_ALIGN_TOP; 209 align = R_SB_ALIGN_TOP;
210 else if (strncasecmp (scrollalign, "bottom", 6) == 0) 210 else if (strncasecmp (scrollalign, "bottom", 6) == 0)
211 align = R_SB_ALIGN_BOTTOM; 211 align = R_SB_ALIGN_BOTTOM;
212 } 212 }
213 last_bot = last_state = -1; 213 last_state = STATE_OFF;
214 /* cursor scrollBar: Black-on-White */ 214 /* cursor scrollBar: Black-on-White */
215 leftptr_cursor = XCreateFontCursor (term->dpy, XC_left_ptr); 215 leftptr_cursor = XCreateFontCursor (term->dpy, XC_left_ptr);
216} 216}
217 217
218void 218void

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines