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.25 by root, Wed Jan 25 21:09:21 2006 UTC vs.
Revision 1.26 by root, Tue Jan 31 20:07:18 2006 UTC

25#include "rxvt.h" /* NECESSARY */ 25#include "rxvt.h" /* NECESSARY */
26 26
27/*----------------------------------------------------------------------*/ 27/*----------------------------------------------------------------------*/
28#if defined(RXVT_SCROLLBAR) 28#if defined(RXVT_SCROLLBAR)
29 29
30#define SHADOW_WIDTH 1
31
32static void 30static void
33draw_shadow (rxvt_term *term, int x, int y, int w, int h) 31draw_shadow (rxvt_term *term, int x, int y, int w, int h)
34{ 32{
35 int shadow; 33 int shadow;
36 34
38 w += x - 1; 36 w += x - 1;
39 h += y - 1; 37 h += y - 1;
40 38
41 for (; shadow-- > 0; x++, y++, w--, h--) 39 for (; shadow-- > 0; x++, y++, w--, h--)
42 { 40 {
43 XDrawLine (term->xdisp, term->scrollBar.win, term->topShadowGC, x, y, w, y); 41 XDrawLine (term->xdisp, term->scrollBar.win, term->topShadowGC, x, y, w , y );
44 XDrawLine (term->xdisp, term->scrollBar.win, term->topShadowGC, x, y, x, h); 42 XDrawLine (term->xdisp, term->scrollBar.win, term->topShadowGC, x, y, x , h );
45 XDrawLine (term->xdisp, term->scrollBar.win, term->botShadowGC, w, h, w, y + 1); 43 XDrawLine (term->xdisp, term->scrollBar.win, term->botShadowGC, w, h, w , y + 1);
46 XDrawLine (term->xdisp, term->scrollBar.win, term->botShadowGC, w, h, x + 1, h); 44 XDrawLine (term->xdisp, term->scrollBar.win, term->botShadowGC, w, h, x + 1, h );
47 } 45 }
48} 46}
49 47
50/* draw triangular button with a shadow of 2 pixels */ 48/* draw triangular button with a shadow of 2 pixels */
51static void 49static void
55 XPoint pt[3]; 53 XPoint pt[3];
56 GC top, bot; 54 GC top, bot;
57 55
58 sz = term->scrollBar.width; 56 sz = term->scrollBar.width;
59 sz2 = sz / 2; 57 sz2 = sz / 2;
58
60 switch (state) 59 switch (state)
61 { 60 {
62 case +1: 61 case +1:
63 top = term->topShadowGC; 62 top = term->topShadowGC;
64 bot = term->botShadowGC; 63 bot = term->botShadowGC;
74 73
75 /* fill triangle */ 74 /* fill triangle */
76 pt[0].x = x; 75 pt[0].x = x;
77 pt[1].x = x + sz - 1; 76 pt[1].x = x + sz - 1;
78 pt[2].x = x + sz2; 77 pt[2].x = x + sz2;
78
79 if (dirn == UP) 79 if (dirn == UP)
80 { 80 {
81 pt[0].y = pt[1].y = y + sz - 1; 81 pt[0].y = pt[1].y = y + sz - 1;
82 pt[2].y = y; 82 pt[2].y = y;
83 } 83 }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines