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.25 by root, Sun Jan 2 10:55:43 2005 UTC vs.
Revision 1.26 by root, Sun Dec 18 00:59:42 2005 UTC

110 110
111 if (!scrollBar.win) 111 if (!scrollBar.win)
112 { 112 {
113 /* create the scrollbar window */ 113 /* create the scrollbar window */
114 scrollBar.win = XCreateSimpleWindow (display->display, 114 scrollBar.win = XCreateSimpleWindow (display->display,
115 TermWin.parent[0], 115 parent[0],
116 window_sb_x, 0, 116 window_sb_x, 0,
117 scrollbar_TotalWidth (), 117 scrollbar_TotalWidth (),
118 szHint.height, 118 szHint.height,
119 0, 119 0,
120 pix_colors[Color_fg], 120 pix_colors[Color_fg],
121 pix_colors[Color_border]); 121 pix_colors[Color_border]);
122#ifdef DEBUG_X 122#ifdef DEBUG_X
123 XStoreName (display->display, scrollBar.win, "scrollbar"); 123 XStoreName (display->display, scrollBar.win, "scrollbar");
124#endif 124#endif
125 XDefineCursor (display->display, scrollBar.win, leftptr_cursor); 125 XDefineCursor (display->display, scrollBar.win, leftptr_cursor);
126 126
153 if (!scrollbar_visible ()) 153 if (!scrollbar_visible ())
154 return 0; 154 return 0;
155 155
156 if (update) 156 if (update)
157 { 157 {
158 top = (TermWin.nscrolled - TermWin.view_start); 158 top = nscrolled - view_start;
159 bot = top + (TermWin.nrow - 1); 159 bot = top + (nrow - 1);
160 len = max ((TermWin.nscrolled + (TermWin.nrow - 1)), 1); 160 len = max (nscrolled + (nrow - 1), 1);
161 adj = (((bot - top) * scrollbar_size ()) % len) > 0 ? 1 : 0; 161 adj = (((bot - top) * scrollbar_size ()) % len) > 0 ? 1 : 0;
162 162
163 scrollBar.top = (scrollBar.beg + (top * scrollbar_size ()) / len); 163 scrollBar.top = (scrollBar.beg + (top * scrollbar_size ()) / len);
164 scrollbar_len = ((bot - top) * scrollbar_size ()) / len + 164 scrollbar_len = ((bot - top) * scrollbar_size ()) / len +
165 scrollbar_minheight () + adj; 165 scrollbar_minheight () + adj;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines