… | |
… | |
2 | * File: scrollbar-xterm.C |
2 | * File: scrollbar-xterm.C |
3 | *----------------------------------------------------------------------* |
3 | *----------------------------------------------------------------------* |
4 | * |
4 | * |
5 | * Copyright (c) 1997,1998 mj olesen <olesen@me.QueensU.CA> |
5 | * Copyright (c) 1997,1998 mj olesen <olesen@me.QueensU.CA> |
6 | * Copyright (c) 1999-2001 Geoff Wing <gcw@pobox.com> |
6 | * Copyright (c) 1999-2001 Geoff Wing <gcw@pobox.com> |
7 | * Copyright (c) 2004-2006 Marc Lehmann <pcg@goof.com> |
7 | * Copyright (c) 2004-2006 Marc Lehmann <schmorp@schmorp.de> |
8 | * |
8 | * |
9 | * This program is free software; you can redistribute it and/or modify |
9 | * This program is free software; you can redistribute it and/or modify |
10 | * it under the terms of the GNU General Public License as published by |
10 | * it under the terms of the GNU General Public License as published by |
11 | * the Free Software Foundation; either version 2 of the License, or |
11 | * the Free Software Foundation; either version 2 of the License, or |
12 | * (at your option) any later version. |
12 | * (at your option) any later version. |
… | |
… | |
35 | scrollBar_t::show_xterm (int update) |
35 | scrollBar_t::show_xterm (int update) |
36 | { |
36 | { |
37 | int xsb = 0; |
37 | int xsb = 0; |
38 | int sbwidth = width - 1; |
38 | int sbwidth = width - 1; |
39 | |
39 | |
40 | if ((init & R_SB_XTERM) == 0) |
40 | if ((init & SB_STYLE_XTERM) == 0) |
41 | { |
41 | { |
42 | XGCValues gcvalue; |
42 | XGCValues gcvalue; |
43 | |
43 | |
44 | init |= R_SB_XTERM; |
44 | init |= SB_STYLE_XTERM; |
45 | gcvalue.stipple = XCreateBitmapFromData (term->dpy, win, |
45 | gcvalue.stipple = XCreateBitmapFromData (term->dpy, win, |
46 | (char *)x_stp_bits, x_stp_width, |
46 | (char *)x_stp_bits, x_stp_width, |
47 | x_stp_height); |
47 | x_stp_height); |
48 | if (!gcvalue.stipple) |
48 | if (!gcvalue.stipple) |
49 | rxvt_fatal ("can't create bitmap\n"); |
49 | rxvt_fatal ("can't create bitmap\n"); |
… | |
… | |
76 | else |
76 | else |
77 | XClearWindow (term->dpy, win); |
77 | XClearWindow (term->dpy, win); |
78 | |
78 | |
79 | /* scrollbar slider */ |
79 | /* scrollbar slider */ |
80 | XFillRectangle (term->dpy, win, xscrollbarGC, |
80 | XFillRectangle (term->dpy, win, xscrollbarGC, |
81 | xsb + 1, top, sbwidth - 2, len); |
81 | xsb + 1, top, sbwidth - 2, bot - top); |
82 | |
82 | |
83 | XDrawLine (term->dpy, win, ShadowGC, |
83 | XDrawLine (term->dpy, win, ShadowGC, |
84 | xsb ? 0 : sbwidth, beg, |
84 | xsb ? 0 : sbwidth, beg, |
85 | xsb ? 0 : sbwidth, end); |
85 | xsb ? 0 : sbwidth, end); |
86 | return 1; |
86 | return 1; |