… | |
… | |
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 (); |
45 | |
43 | |
46 | if (win) |
44 | if (win) |
47 | { |
45 | { |
48 | XMapWindow (term->dpy, win); |
46 | XMapWindow (term->dpy, win); |
49 | change = 1; |
|
|
50 | } |
47 | } |
51 | } |
48 | } |
52 | else |
49 | else |
53 | { |
50 | { |
54 | state = STATE_OFF; |
51 | state = STATE_OFF; |
55 | XUnmapWindow (term->dpy, win); |
52 | XUnmapWindow (term->dpy, win); |
56 | change = 1; |
|
|
57 | } |
53 | } |
58 | |
|
|
59 | return change; |
|
|
60 | } |
54 | } |
61 | |
55 | |
62 | void |
56 | void |
63 | scrollBar_t::resize () |
57 | scrollBar_t::resize () |
64 | { |
58 | { |
… | |
… | |
140 | |
134 | |
141 | void |
135 | void |
142 | scrollBar_t::setup (rxvt_term *term) |
136 | scrollBar_t::setup (rxvt_term *term) |
143 | { |
137 | { |
144 | int i; |
138 | int i; |
145 | short width; |
|
|
146 | const char *scrollalign, *scrollstyle, *thickness; |
139 | const char *scrollalign, *scrollstyle, *thickness; |
147 | enum sb_style style; |
|
|
148 | |
140 | |
149 | this->term = term; |
141 | this->term = term; |
150 | scrollalign = term->rs[Rs_scrollBar_align]; |
142 | scrollalign = term->rs[Rs_scrollBar_align]; |
151 | scrollstyle = term->rs[Rs_scrollstyle]; |
143 | scrollstyle = term->rs[Rs_scrollstyle]; |
152 | thickness = term->rs[Rs_scrollBar_thickness]; |
144 | thickness = term->rs[Rs_scrollBar_thickness]; |
… | |
… | |
197 | # ifdef RXVT_SCROLLBAR |
189 | # ifdef RXVT_SCROLLBAR |
198 | if (! term->option (Opt_scrollBar_floating) && style == R_SB_RXVT) |
190 | if (! term->option (Opt_scrollBar_floating) && style == R_SB_RXVT) |
199 | shadow = SHADOW_WIDTH; |
191 | shadow = SHADOW_WIDTH; |
200 | # endif |
192 | # endif |
201 | |
193 | |
202 | this->style = style; |
|
|
203 | this->width = width; |
|
|
204 | |
|
|
205 | /* align = R_SB_ALIGN_CENTRE; */ |
194 | /* align = R_SB_ALIGN_CENTRE; */ |
206 | if (scrollalign) |
195 | if (scrollalign) |
207 | { |
196 | { |
208 | if (strncasecmp (scrollalign, "top", 3) == 0) |
197 | if (strncasecmp (scrollalign, "top", 3) == 0) |
209 | align = R_SB_ALIGN_TOP; |
198 | align = R_SB_ALIGN_TOP; |