… | |
… | |
29 | /*----------------------------------------------------------------------*/ |
29 | /*----------------------------------------------------------------------*/ |
30 | |
30 | |
31 | /* |
31 | /* |
32 | * Map or unmap a scrollbar. Returns non-zero upon change of state |
32 | * Map or unmap a scrollbar. Returns non-zero upon change of state |
33 | */ |
33 | */ |
34 | int |
34 | void |
35 | scrollBar_t::map (int map) |
35 | scrollBar_t::map (int map) |
36 | { |
36 | { |
37 | int change = 0; |
|
|
38 | |
|
|
39 | if (map) |
37 | if (map) |
40 | { |
38 | { |
41 | state = STATE_IDLE; |
39 | state = STATE_IDLE; |
42 | |
40 | |
43 | if (!win) |
41 | if (!win) |
44 | resize (); |
42 | resize (); |
|
|
43 | else |
|
|
44 | XMapWindow (term->dpy, win); |
|
|
45 | } |
|
|
46 | else |
|
|
47 | { |
|
|
48 | state = STATE_OFF; |
45 | |
49 | |
46 | if (win) |
50 | if (win) |
47 | { |
|
|
48 | XMapWindow (term->dpy, win); |
|
|
49 | change = 1; |
|
|
50 | } |
|
|
51 | } |
|
|
52 | else |
|
|
53 | { |
|
|
54 | state = STATE_OFF; |
|
|
55 | XUnmapWindow (term->dpy, win); |
51 | XUnmapWindow (term->dpy, win); |
56 | change = 1; |
|
|
57 | } |
52 | } |
58 | |
|
|
59 | return change; |
|
|
60 | } |
53 | } |
61 | |
54 | |
62 | void |
55 | void |
63 | scrollBar_t::resize () |
56 | scrollBar_t::resize () |
64 | { |
57 | { |
… | |
… | |
139 | } |
132 | } |
140 | |
133 | |
141 | void |
134 | void |
142 | scrollBar_t::setup (rxvt_term *term) |
135 | scrollBar_t::setup (rxvt_term *term) |
143 | { |
136 | { |
144 | int i; |
137 | int i; |
145 | short width; |
|
|
146 | const char *scrollalign, *scrollstyle, *thickness; |
138 | const char *scrollalign, *scrollstyle, *thickness; |
147 | enum sb_style style; |
|
|
148 | |
139 | |
149 | this->term = term; |
140 | this->term = term; |
150 | scrollalign = term->rs[Rs_scrollBar_align]; |
141 | scrollalign = term->rs[Rs_scrollBar_align]; |
151 | scrollstyle = term->rs[Rs_scrollstyle]; |
142 | scrollstyle = term->rs[Rs_scrollstyle]; |
152 | thickness = term->rs[Rs_scrollBar_thickness]; |
143 | thickness = term->rs[Rs_scrollBar_thickness]; |
… | |
… | |
197 | # ifdef RXVT_SCROLLBAR |
188 | # ifdef RXVT_SCROLLBAR |
198 | if (! term->option (Opt_scrollBar_floating) && style == R_SB_RXVT) |
189 | if (! term->option (Opt_scrollBar_floating) && style == R_SB_RXVT) |
199 | shadow = SHADOW_WIDTH; |
190 | shadow = SHADOW_WIDTH; |
200 | # endif |
191 | # endif |
201 | |
192 | |
202 | this->style = style; |
|
|
203 | this->width = width; |
|
|
204 | |
|
|
205 | /* align = R_SB_ALIGN_CENTRE; */ |
193 | /* align = R_SB_ALIGN_CENTRE; */ |
206 | if (scrollalign) |
194 | if (scrollalign) |
207 | { |
195 | { |
208 | if (strncasecmp (scrollalign, "top", 3) == 0) |
196 | if (strncasecmp (scrollalign, "top", 3) == 0) |
209 | align = R_SB_ALIGN_TOP; |
197 | align = R_SB_ALIGN_TOP; |