… | |
… | |
49 | change = 1; |
49 | change = 1; |
50 | } |
50 | } |
51 | } |
51 | } |
52 | else |
52 | else |
53 | { |
53 | { |
54 | state = 0; |
54 | state = STATE_OFF; |
55 | XUnmapWindow (term->dpy, win); |
55 | XUnmapWindow (term->dpy, win); |
56 | change = 1; |
56 | change = 1; |
57 | } |
57 | } |
58 | |
58 | |
59 | return change; |
59 | return change; |
… | |
… | |
72 | |
72 | |
73 | if (!win) |
73 | if (!win) |
74 | { |
74 | { |
75 | /* create the scrollbar window */ |
75 | /* create the scrollbar window */ |
76 | win = XCreateSimpleWindow (term->dpy, |
76 | win = XCreateSimpleWindow (term->dpy, |
77 | term->parent[0], |
77 | term->parent, |
78 | window_sb_x, 0, |
78 | window_sb_x, 0, |
79 | total_width (), |
79 | total_width (), |
80 | term->szHint.height, |
80 | term->szHint.height, |
81 | 0, |
81 | 0, |
82 | term->pix_colors[Color_fg], |
82 | term->pix_colors[Color_fg], |
… | |
… | |
141 | |
141 | |
142 | void |
142 | void |
143 | scrollBar_t::setup (rxvt_term *term) |
143 | scrollBar_t::setup (rxvt_term *term) |
144 | { |
144 | { |
145 | int i; |
145 | int i; |
146 | short style, width; |
146 | short width; |
147 | const char *scrollalign, *scrollstyle, *thickness; |
147 | const char *scrollalign, *scrollstyle, *thickness; |
|
|
148 | enum sb_style style; |
148 | |
149 | |
149 | this->term = term; |
150 | this->term = term; |
150 | scrollalign = term->rs[Rs_scrollBar_align]; |
151 | scrollalign = term->rs[Rs_scrollBar_align]; |
151 | scrollstyle = term->rs[Rs_scrollstyle]; |
152 | scrollstyle = term->rs[Rs_scrollstyle]; |
152 | thickness = term->rs[Rs_scrollBar_thickness]; |
153 | thickness = term->rs[Rs_scrollBar_thickness]; |
… | |
… | |
192 | |
193 | |
193 | if (style != R_SB_NEXT) /* dishonour request - for now */ |
194 | if (style != R_SB_NEXT) /* dishonour request - for now */ |
194 | if (thickness && (i = atoi (thickness)) >= SB_WIDTH_MINIMUM) |
195 | if (thickness && (i = atoi (thickness)) >= SB_WIDTH_MINIMUM) |
195 | width = min (i, SB_WIDTH_MAXIMUM); |
196 | width = min (i, SB_WIDTH_MAXIMUM); |
196 | |
197 | |
|
|
198 | # ifdef RXVT_SCROLLBAR |
|
|
199 | if (! term->option (Opt_scrollBar_floating) && style == R_SB_RXVT) |
|
|
200 | shadow = SHADOW_WIDTH; |
|
|
201 | # endif |
|
|
202 | |
197 | this->style = style; |
203 | this->style = style; |
198 | this->width = width; |
204 | this->width = width; |
199 | |
205 | |
200 | /* align = R_SB_ALIGN_CENTRE; */ |
206 | /* align = R_SB_ALIGN_CENTRE; */ |
201 | if (scrollalign) |
207 | if (scrollalign) |
… | |
… | |
203 | if (strncasecmp (scrollalign, "top", 3) == 0) |
209 | if (strncasecmp (scrollalign, "top", 3) == 0) |
204 | align = R_SB_ALIGN_TOP; |
210 | align = R_SB_ALIGN_TOP; |
205 | else if (strncasecmp (scrollalign, "bottom", 6) == 0) |
211 | else if (strncasecmp (scrollalign, "bottom", 6) == 0) |
206 | align = R_SB_ALIGN_BOTTOM; |
212 | align = R_SB_ALIGN_BOTTOM; |
207 | } |
213 | } |
208 | last_bot = last_state = -1; |
214 | last_state = STATE_OFF; |
209 | /* cursor scrollBar: Black-on-White */ |
215 | /* cursor scrollBar: Black-on-White */ |
210 | leftptr_cursor = XCreateFontCursor (term->dpy, XC_left_ptr); |
216 | leftptr_cursor = XCreateFontCursor (term->dpy, XC_left_ptr); |
211 | } |
217 | } |
212 | |
218 | |
213 | void |
219 | void |