… | |
… | |
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 */ |
49 | static void |
49 | static void |
50 | draw_button (rxvt_term *term, int x, int y, int state, int dirn) |
50 | draw_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; |
… | |
… | |
149 | int |
146 | int |
150 | rxvt_term::scrollbar_show_rxvt (int update, int last_top, int last_bot, int scrollbar_len) |
147 | rxvt_term::scrollbar_show_rxvt (int update, int last_top, int last_bot, int scrollbar_len) |
151 | { |
148 | { |
152 | int sbshadow = scrollBar.shadow; |
149 | int sbshadow = scrollBar.shadow; |
153 | int sbwidth = (int)scrollBar.width; |
150 | int sbwidth = (int)scrollBar.width; |
154 | int state; |
|
|
155 | |
151 | |
156 | if ((scrollBar.init & R_SB_RXVT) == 0) |
152 | if ((scrollBar.init & R_SB_RXVT) == 0) |
157 | { |
153 | { |
158 | XGCValues gcvalue; |
154 | XGCValues gcvalue; |
159 | |
155 | |
… | |
… | |
216 | |
212 | |
217 | /* shadow for scrollbar slider */ |
213 | /* shadow for scrollbar slider */ |
218 | draw_shadow (this, sbshadow, scrollBar.top, sbwidth, scrollbar_len); |
214 | draw_shadow (this, sbshadow, scrollBar.top, sbwidth, scrollbar_len); |
219 | |
215 | |
220 | /* Redraw scrollbar arrows */ |
216 | /* Redraw scrollbar arrows */ |
221 | state = scrollBar.state == STATE_UP ? -1 : +1; |
|
|
222 | draw_button (this, sbshadow, sbshadow, state, UP); |
217 | draw_button (this, sbshadow, sbshadow, UP); |
223 | state = scrollBar.state == STATE_DOWN ? -1 : +1; |
|
|
224 | draw_button (this, sbshadow, scrollBar.end + 1, state, DN); |
218 | draw_button (this, sbshadow, scrollBar.end + 1, DN); |
225 | |
219 | |
226 | return 1; |
220 | return 1; |
227 | } |
221 | } |
228 | #endif /* RXVT_SCROLLBAR */ |
222 | #endif /* RXVT_SCROLLBAR */ |
229 | /*----------------------- end-of-file (C source) -----------------------*/ |
223 | /*----------------------- end-of-file (C source) -----------------------*/ |