… | |
… | |
8 | * Copyright (c) 1999-2001 Geoff Wing <gcw@pobox.com> |
8 | * Copyright (c) 1999-2001 Geoff Wing <gcw@pobox.com> |
9 | * Copyright (c) 2004-2006 Marc Lehmann <schmorp@schmorp.de> |
9 | * Copyright (c) 2004-2006 Marc Lehmann <schmorp@schmorp.de> |
10 | * |
10 | * |
11 | * This program is free software; you can redistribute it and/or modify |
11 | * This program is free software; you can redistribute it and/or modify |
12 | * it under the terms of the GNU General Public License as published by |
12 | * it under the terms of the GNU General Public License as published by |
13 | * the Free Software Foundation; either version 2 of the License, or |
13 | * the Free Software Foundation; either version 3 of the License, or |
14 | * (at your option) any later version. |
14 | * (at your option) any later version. |
15 | * |
15 | * |
16 | * This program is distributed in the hope that it will be useful, |
16 | * This program is distributed in the hope that it will be useful, |
17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
… | |
… | |
71 | window_sb_x, 0, |
71 | window_sb_x, 0, |
72 | total_width (), |
72 | total_width (), |
73 | term->szHint.height, |
73 | term->szHint.height, |
74 | 0, |
74 | 0, |
75 | term->pix_colors[Color_fg], |
75 | term->pix_colors[Color_fg], |
76 | term->pix_colors[Color_border]); |
76 | term->pix_colors[color ()]); |
77 | XDefineCursor (term->dpy, win, leftptr_cursor); |
77 | XDefineCursor (term->dpy, win, leftptr_cursor); |
78 | |
78 | |
79 | XSelectInput (term->dpy, win, |
79 | XSelectInput (term->dpy, win, |
80 | ExposureMask | ButtonPressMask | ButtonReleaseMask |
80 | ExposureMask | ButtonPressMask | ButtonReleaseMask |
81 | | Button1MotionMask | Button2MotionMask |
81 | | Button1MotionMask | Button2MotionMask |
… | |
… | |
231 | if (botShadowGC) XFreeGC (term->dpy, botShadowGC); |
231 | if (botShadowGC) XFreeGC (term->dpy, botShadowGC); |
232 | if (scrollbarGC) XFreeGC (term->dpy, scrollbarGC); |
232 | if (scrollbarGC) XFreeGC (term->dpy, scrollbarGC); |
233 | #endif |
233 | #endif |
234 | } |
234 | } |
235 | |
235 | |
|
|
236 | int |
|
|
237 | scrollBar_t::color () |
|
|
238 | { |
|
|
239 | #ifdef RXVT_SCROLLBAR |
|
|
240 | if (style == SB_STYLE_RXVT && shadow) |
|
|
241 | return Color_trough; |
|
|
242 | else |
|
|
243 | #endif |
|
|
244 | return Color_border; |
|
|
245 | } |
|
|
246 | |
236 | void |
247 | void |
237 | scrollBar_t::update_data () |
248 | scrollBar_t::update_data () |
238 | { |
249 | { |
239 | #if defined(PLAIN_SCROLLBAR) |
250 | #if defined(PLAIN_SCROLLBAR) |
240 | if (style == SB_STYLE_PLAIN) |
251 | if (style == SB_STYLE_PLAIN) |
… | |
… | |
262 | #endif |
273 | #endif |
263 | #if defined(RXVT_SCROLLBAR) |
274 | #if defined(RXVT_SCROLLBAR) |
264 | if (style == SB_STYLE_RXVT) |
275 | if (style == SB_STYLE_RXVT) |
265 | { |
276 | { |
266 | beg = (width + 1) + shadow; |
277 | beg = (width + 1) + shadow; |
267 | end = term->szHint.height - beg - (2 * shadow); |
278 | end = term->szHint.height - beg; |
268 | update = &scrollBar_t::show_rxvt; |
279 | update = &scrollBar_t::show_rxvt; |
269 | } |
280 | } |
270 | #endif |
281 | #endif |
271 | } |
282 | } |
272 | |
283 | |