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

Comparing rxvt-unicode/src/scrollbar-rxvt.C (file contents):
Revision 1.28 by root, Mon Feb 20 22:40:35 2006 UTC vs.
Revision 1.34 by ayin, Mon Dec 31 15:45:29 2007 UTC

1/*--------------------------------*-C-*---------------------------------* 1/*----------------------------------------------------------------------*
2 * File: scrollbar-rxvt.C 2 * File: scrollbar-rxvt.C
3 *----------------------------------------------------------------------* 3 *----------------------------------------------------------------------*
4 * 4 *
5 * Copyright (c) 1997,1998 mj olesen <olesen@me.QueensU.CA> 5 * Copyright (c) 1997,1998 mj olesen <olesen@me.QueensU.CA>
6 * Copyright (c) 1999-2001 Geoff Wing <gcw@pobox.com> 6 * Copyright (c) 1999-2001 Geoff Wing <gcw@pobox.com>
147} 147}
148 148
149int 149int
150rxvt_term::scrollbar_show_rxvt (int update, int last_top, int last_bot, int scrollbar_len) 150rxvt_term::scrollbar_show_rxvt (int update, int last_top, int last_bot, int scrollbar_len)
151{ 151{
152 int sbshadow = sb_shadow; 152 int sbshadow = scrollBar.shadow;
153 int sbwidth = (int)scrollBar.width; 153 int sbwidth = (int)scrollBar.width;
154 154
155 if ((scrollBar.init & R_SB_RXVT) == 0) 155 if ((scrollBar.init & R_SB_RXVT) == 0)
156 { 156 {
157 XGCValues gcvalue;
158
157 scrollBar.init |= R_SB_RXVT; 159 scrollBar.init |= R_SB_RXVT;
158 160
161 gcvalue.foreground = pix_colors[Color_topShadow];
162 topShadowGC = XCreateGC (dpy, vt, GCForeground, &gcvalue);
163 gcvalue.foreground = pix_colors[Color_bottomShadow];
164 botShadowGC = XCreateGC (dpy, vt, GCForeground, &gcvalue);
165 gcvalue.foreground = pix_colors[ (depth <= 2 ? Color_fg : Color_scroll)];
166 scrollbarGC = XCreateGC (dpy, vt, GCForeground, &gcvalue);
159 if (sbshadow) 167 if (sbshadow)
160 { 168 {
161 XSetWindowBackground (dpy, scrollBar.win, pix_colors_focused[Color_trough]); 169 XSetWindowBackground (dpy, scrollBar.win, pix_colors_focused[Color_trough]);
162 XClearWindow (dpy, scrollBar.win); 170 XClearWindow (dpy, scrollBar.win);
163 } 171 }
185 /* scrollbar slider */ 193 /* scrollbar slider */
186#ifdef SB_BORDER 194#ifdef SB_BORDER
187 { 195 {
188 int xofs; 196 int xofs;
189 197
190 if (OPTION (Opt_scrollBar_right)) 198 if (option (Opt_scrollBar_right))
191 xofs = 0; 199 xofs = 0;
192 else 200 else
193 xofs = sbshadow ? sbwidth : sbwidth - 1; 201 xofs = sbshadow ? sbwidth : sbwidth - 1;
194 202
195 XDrawLine (dpy, scrollBar.win, botShadowGC, 203 XDrawLine (dpy, scrollBar.win, botShadowGC,
212 draw_button (this, sbshadow, sbshadow, (scrollbar_isUp () ? -1 : +1), UP); 220 draw_button (this, sbshadow, sbshadow, (scrollbar_isUp () ? -1 : +1), UP);
213 draw_button (this, sbshadow, scrollBar.end + 1, (scrollbar_isDn () ? -1 : +1), DN); 221 draw_button (this, sbshadow, scrollBar.end + 1, (scrollbar_isDn () ? -1 : +1), DN);
214 222
215 return 1; 223 return 1;
216} 224}
217#endif /* RXVT_SCROLLBAR */ 225#endif /* RXVT_SCROLLBAR */
218/*----------------------- end-of-file (C source) -----------------------*/ 226/*----------------------- end-of-file (C source) -----------------------*/
219 227

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines