… | |
… | |
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 | |
|
|
32 | static void |
30 | static void |
33 | draw_shadow (rxvt_term *term, int x, int y, int w, int h) |
31 | draw_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 */ |
51 | static void |
49 | static 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 | } |