… | |
… | |
173 | |
173 | |
174 | return ret; |
174 | return ret; |
175 | } |
175 | } |
176 | |
176 | |
177 | void |
177 | void |
178 | rxvt_term::setup_scrollbar (const char *scrollalign, const char *scrollstyle, const char *thickness) |
178 | scrollBar_t::setup (rxvt_term *term) |
179 | { |
179 | { |
180 | int i; |
180 | int i; |
181 | short style, width; |
181 | short style, width; |
|
|
182 | const char *scrollalign, *scrollstyle, *thickness; |
|
|
183 | |
|
|
184 | this->term = term; |
|
|
185 | scrollalign = term->rs[Rs_scrollBar_align]; |
|
|
186 | scrollstyle = term->rs[Rs_scrollstyle]; |
|
|
187 | thickness = term->rs[Rs_scrollBar_thickness]; |
182 | |
188 | |
183 | # if defined(RXVT_SCROLLBAR) |
189 | # if defined(RXVT_SCROLLBAR) |
184 | style = R_SB_RXVT; |
190 | style = R_SB_RXVT; |
185 | # elif defined(XTERM_SCROLLBAR) |
191 | # elif defined(XTERM_SCROLLBAR) |
186 | style = R_SB_XTERM; |
192 | style = R_SB_XTERM; |
… | |
… | |
222 | if (style != R_SB_NEXT) /* dishonour request - for now */ |
228 | if (style != R_SB_NEXT) /* dishonour request - for now */ |
223 | if (thickness && (i = atoi (thickness)) >= SB_WIDTH_MINIMUM) |
229 | if (thickness && (i = atoi (thickness)) >= SB_WIDTH_MINIMUM) |
224 | width = min (i, SB_WIDTH_MAXIMUM); |
230 | width = min (i, SB_WIDTH_MAXIMUM); |
225 | |
231 | |
226 | # ifdef RXVT_SCROLLBAR |
232 | # ifdef RXVT_SCROLLBAR |
227 | if (! option (Opt_scrollBar_floating) && style == R_SB_RXVT) |
233 | if (! term->option (Opt_scrollBar_floating) && style == R_SB_RXVT) |
228 | scrollBar.shadow = SHADOW_WIDTH; |
234 | scrollBar.shadow = SHADOW_WIDTH; |
229 | # endif |
235 | # endif |
230 | |
236 | |
231 | scrollBar.style = style; |
237 | this->style = style; |
232 | scrollBar.width = width; |
238 | this->width = width; |
233 | |
239 | |
234 | /* scrollBar.align = R_SB_ALIGN_CENTRE; */ |
240 | /* scrollBar.align = R_SB_ALIGN_CENTRE; */ |
235 | if (scrollalign) |
241 | if (scrollalign) |
236 | { |
242 | { |
237 | if (strncasecmp (scrollalign, "top", 3) == 0) |
243 | if (strncasecmp (scrollalign, "top", 3) == 0) |
238 | scrollBar.align = R_SB_ALIGN_TOP; |
244 | align = R_SB_ALIGN_TOP; |
239 | else if (strncasecmp (scrollalign, "bottom", 6) == 0) |
245 | else if (strncasecmp (scrollalign, "bottom", 6) == 0) |
240 | scrollBar.align = R_SB_ALIGN_BOTTOM; |
246 | align = R_SB_ALIGN_BOTTOM; |
241 | } |
247 | } |
242 | scrollBar.last_bot = scrollBar.last_state = -1; |
248 | last_bot = last_state = -1; |
243 | /* cursor scrollBar: Black-on-White */ |
249 | /* cursor scrollBar: Black-on-White */ |
244 | scrollBar.leftptr_cursor = XCreateFontCursor (dpy, XC_left_ptr); |
250 | leftptr_cursor = XCreateFontCursor (term->dpy, XC_left_ptr); |
245 | } |
251 | } |
246 | |
252 | |
247 | /*----------------------- end-of-file (C source) -----------------------*/ |
253 | /*----------------------- end-of-file (C source) -----------------------*/ |
248 | |
254 | |