… | |
… | |
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 DOUBLED 1 |
30 | #define SHADOW_WIDTH 1 |
|
|
31 | |
|
|
32 | static void |
|
|
33 | rxvt_Draw_Shadow (Display *display, Window win, GC topShadow, GC botShadow, int x, int y, int w, int h) |
|
|
34 | { |
|
|
35 | int shadow; |
|
|
36 | |
|
|
37 | shadow = (w == 0 || h == 0) ? 1 : SHADOW_WIDTH; |
|
|
38 | w += x - 1; |
|
|
39 | h += y - 1; |
|
|
40 | for (; shadow-- > 0; x++, y++, w--, h--) |
|
|
41 | { |
|
|
42 | XDrawLine (display, win, topShadow, x, y, w, y); |
|
|
43 | XDrawLine (display, win, topShadow, x, y, x, h); |
|
|
44 | XDrawLine (display, win, botShadow, w, h, w, y + 1); |
|
|
45 | XDrawLine (display, win, botShadow, w, h, x + 1, h); |
|
|
46 | } |
|
|
47 | } |
31 | |
48 | |
32 | /* draw triangular button with a shadow of 2 pixels */ |
49 | /* draw triangular button with a shadow of 2 pixels */ |
33 | void |
50 | void |
34 | rxvt_term::Draw_button (int x, int y, int state, int dirn) |
51 | rxvt_term::Draw_button (int x, int y, int state, int dirn) |
35 | { |
52 | { |
… | |
… | |
80 | pt[1].x = x + sz2 - 1; |
97 | pt[1].x = x + sz2 - 1; |
81 | pt[1].y = y + (dirn == UP ? 0 : sz - 1); |
98 | pt[1].y = y + (dirn == UP ? 0 : sz - 1); |
82 | XDrawLine (display->display, scrollBar.win, top, |
99 | XDrawLine (display->display, scrollBar.win, top, |
83 | pt[0].x, pt[0].y, pt[1].x, pt[1].y); |
100 | pt[0].x, pt[0].y, pt[1].x, pt[1].y); |
84 | |
101 | |
85 | #if DOUBLED |
102 | #if SHADOW_WIDTH > 1 |
86 | /* doubled */ |
103 | /* doubled */ |
87 | pt[0].x++; |
104 | pt[0].x++; |
88 | |
105 | |
89 | if (dirn == UP) |
106 | if (dirn == UP) |
90 | { |
107 | { |
… | |
… | |
107 | pt[1].y = y + (dirn == UP ? sz - 1 : 0); |
124 | pt[1].y = y + (dirn == UP ? sz - 1 : 0); |
108 | pt[2].y = y + (dirn == UP ? 0 : sz - 1); |
125 | pt[2].y = y + (dirn == UP ? 0 : sz - 1); |
109 | XDrawLine (display->display, scrollBar.win, bot, |
126 | XDrawLine (display->display, scrollBar.win, bot, |
110 | pt[2].x, pt[2].y, pt[1].x, pt[1].y); |
127 | pt[2].x, pt[2].y, pt[1].x, pt[1].y); |
111 | |
128 | |
112 | #if DOUBLED |
129 | #if SHADOW_WIDTH > 1 |
113 | /* doubled */ |
130 | /* doubled */ |
114 | pt[1].x--; |
131 | pt[1].x--; |
115 | if (dirn == UP) |
132 | if (dirn == UP) |
116 | { |
133 | { |
117 | pt[2].y++; |
134 | pt[2].y++; |