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.34 by ayin, Mon Dec 31 15:45:29 2007 UTC vs.
Revision 1.36 by ayin, Tue Feb 19 10:46:03 2008 UTC

45 } 45 }
46} 46}
47 47
48/* draw triangular button with a shadow of 2 pixels */ 48/* draw triangular button with a shadow of 2 pixels */
49static void 49static void
50draw_button (rxvt_term *term, int x, int y, int state, int dirn) 50draw_button (rxvt_term *term, int x, int y, int dirn)
51{ 51{
52 unsigned int sz, sz2; 52 unsigned int sz, sz2;
53 XPoint pt[3]; 53 XPoint pt[3];
54 GC top, bot; 54 GC top, bot;
55 55
56 sz = term->scrollBar.width; 56 sz = term->scrollBar.width;
57 sz2 = sz / 2; 57 sz2 = sz / 2;
58 58
59 switch (state) 59 if ((dirn == UP && term->scrollBar.state == STATE_UP)
60 || (dirn == DN && term->scrollBar.state == STATE_DOWN))
60 { 61 {
61 case +1:
62 top = term->topShadowGC;
63 bot = term->botShadowGC;
64 break;
65 case -1:
66 top = term->botShadowGC; 62 top = term->botShadowGC;
67 bot = term->topShadowGC; 63 bot = term->topShadowGC;
68 break; 64 }
69 default: 65 else
70 top = bot = term->scrollbarGC; 66 {
71 break; 67 top = term->topShadowGC;
68 bot = term->botShadowGC;
72 } 69 }
73 70
74 /* fill triangle */ 71 /* fill triangle */
75 pt[0].x = x; 72 pt[0].x = x;
76 pt[1].x = x + sz - 1; 73 pt[1].x = x + sz - 1;
215 212
216 /* shadow for scrollbar slider */ 213 /* shadow for scrollbar slider */
217 draw_shadow (this, sbshadow, scrollBar.top, sbwidth, scrollbar_len); 214 draw_shadow (this, sbshadow, scrollBar.top, sbwidth, scrollbar_len);
218 215
219 /* Redraw scrollbar arrows */ 216 /* Redraw scrollbar arrows */
220 draw_button (this, sbshadow, sbshadow, (scrollbar_isUp () ? -1 : +1), UP); 217 draw_button (this, sbshadow, sbshadow, UP);
221 draw_button (this, sbshadow, scrollBar.end + 1, (scrollbar_isDn () ? -1 : +1), DN); 218 draw_button (this, sbshadow, scrollBar.end + 1, DN);
222 219
223 return 1; 220 return 1;
224} 221}
225#endif /* RXVT_SCROLLBAR */ 222#endif /* RXVT_SCROLLBAR */
226/*----------------------- end-of-file (C source) -----------------------*/ 223/*----------------------- end-of-file (C source) -----------------------*/

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines