… | |
… | |
16 | STATE_UP, |
16 | STATE_UP, |
17 | STATE_DOWN, |
17 | STATE_DOWN, |
18 | }; |
18 | }; |
19 | |
19 | |
20 | struct scrollBar_t { |
20 | struct scrollBar_t { |
|
|
21 | rxvt_term *term; |
21 | char state; /* scrollbar state */ |
22 | char state; /* scrollbar state */ |
22 | char init; /* scrollbar has been initialised */ |
23 | char init; /* scrollbar has been initialised */ |
23 | unsigned int beg; /* slider sub-window begin height */ |
24 | unsigned int beg; /* slider sub-window begin height */ |
24 | unsigned int end; /* slider sub-window end height */ |
25 | unsigned int end; /* slider sub-window end height */ |
25 | unsigned int top; /* slider top position */ |
26 | unsigned int top; /* slider top position */ |
… | |
… | |
33 | int len; |
34 | int len; |
34 | unsigned char align; |
35 | unsigned char align; |
35 | Window win; |
36 | Window win; |
36 | Cursor leftptr_cursor; |
37 | Cursor leftptr_cursor; |
37 | int (rxvt_term::*update)(int, int, int, int); |
38 | int (rxvt_term::*update)(int, int, int, int); |
|
|
39 | void setup (rxvt_term *); |
38 | |
40 | |
39 | bool upButton (int y) |
41 | bool upButton (int y) |
40 | { |
42 | { |
41 | if (style == R_SB_NEXT) |
43 | if (style == R_SB_NEXT) |
42 | return y > end && y <= end + width + 1; |
44 | return y > end && y <= end + width + 1; |
… | |
… | |
50 | return y > end + width + 1; |
52 | return y > end + width + 1; |
51 | if (style == R_SB_RXVT) |
53 | if (style == R_SB_RXVT) |
52 | return y > end; |
54 | return y > end; |
53 | return false; |
55 | return false; |
54 | } |
56 | } |
|
|
57 | unsigned total_width () |
|
|
58 | { |
|
|
59 | return width + shadow * 2; |
|
|
60 | } |
55 | }; |
61 | }; |
56 | |
|
|
57 | #define scrollbar_TotalWidth() (scrollBar.width + scrollBar.shadow * 2) |
|
|
58 | |
62 | |
59 | #define SCROLLNEXT_MINHEIGHT SB_THUMB_MIN_HEIGHT |
63 | #define SCROLLNEXT_MINHEIGHT SB_THUMB_MIN_HEIGHT |
60 | #define SCROLLRXVT_MINHEIGHT 10 |
64 | #define SCROLLRXVT_MINHEIGHT 10 |
61 | |
65 | |
62 | #define scrollbar_minheight() (scrollBar.style == R_SB_NEXT \ |
66 | #define scrollbar_minheight() (scrollBar.style == R_SB_NEXT \ |