… | |
… | |
81 | pt[0].x, pt[0].y, pt[1].x, pt[1].y); |
81 | pt[0].x, pt[0].y, pt[1].x, pt[1].y); |
82 | |
82 | |
83 | #if (SHADOW > 1) |
83 | #if (SHADOW > 1) |
84 | /* doubled */ |
84 | /* doubled */ |
85 | pt[0].x++; |
85 | pt[0].x++; |
|
|
86 | |
86 | if (dirn == UP) |
87 | if (dirn == UP) |
87 | { |
88 | { |
88 | pt[0].y--; |
89 | pt[0].y--; |
89 | pt[1].y++; |
90 | pt[1].y++; |
90 | } |
91 | } |
91 | else |
92 | else |
92 | { |
93 | { |
93 | pt[0].y++; |
94 | pt[0].y++; |
94 | pt[1].y--; |
95 | pt[1].y--; |
95 | } |
96 | } |
|
|
97 | |
96 | XDrawLine (display->display, scrollBar.win, top, |
98 | XDrawLine (display->display, scrollBar.win, top, |
97 | pt[0].x, pt[0].y, pt[1].x, pt[1].y); |
99 | pt[0].x, pt[0].y, pt[1].x, pt[1].y); |
98 | #endif |
100 | #endif |
99 | /* draw shadow on right */ |
101 | /* draw shadow on right */ |
100 | pt[1].x = x + sz - 1; |
102 | pt[1].x = x + sz - 1; |
101 | /* pt[2].x = x + sz2; */ |
103 | /* pt[2].x = x + sz2; */ |
102 | pt[1].y = y + (dirn == UP ? sz - 1 : 0); |
104 | pt[1].y = y + (dirn == UP ? sz - 1 : 0); |
103 | pt[2].y = y + (dirn == UP ? 0 : sz - 1); |
105 | pt[2].y = y + (dirn == UP ? 0 : sz - 1); |
104 | XDrawLine (display->display, scrollBar.win, bot, |
106 | XDrawLine (display->display, scrollBar.win, bot, |
105 | pt[2].x, pt[2].y, pt[1].x, pt[1].y); |
107 | pt[2].x, pt[2].y, pt[1].x, pt[1].y); |
|
|
108 | |
106 | #if (SHADOW > 1) |
109 | #if (SHADOW > 1) |
107 | /* doubled */ |
110 | /* doubled */ |
108 | pt[1].x--; |
111 | pt[1].x--; |
109 | if (dirn == UP) |
112 | if (dirn == UP) |
110 | { |
113 | { |
… | |
… | |
121 | pt[2].x, pt[2].y, pt[1].x, pt[1].y); |
124 | pt[2].x, pt[2].y, pt[1].x, pt[1].y); |
122 | #endif |
125 | #endif |
123 | } |
126 | } |
124 | |
127 | |
125 | int |
128 | int |
126 | rxvt_term::scrollbar_show_rxvt (int update __attribute__ ((unused)), int last_top, int last_bot, int scrollbar_len) |
129 | rxvt_term::scrollbar_show_rxvt (int update, int last_top, int last_bot, int scrollbar_len) |
127 | { |
130 | { |
128 | int sbshadow = sb_shadow; |
131 | int sbshadow = sb_shadow; |
129 | int sbwidth = (int)scrollBar.width; |
132 | int sbwidth = (int)scrollBar.width; |
130 | |
133 | |
131 | if ((scrollBar.init & R_SB_RXVT) == 0) |
134 | if ((scrollBar.init & R_SB_RXVT) == 0) |
132 | { |
135 | { |
133 | scrollBar.init |= R_SB_RXVT; |
136 | scrollBar.init |= R_SB_RXVT; |
134 | if (sbshadow) |
137 | if (sbshadow) |
135 | { |
138 | { |
136 | XSetWindowBackground (display->display, scrollBar.win, pix_colors[Color_trough]); |
139 | XSetWindowBackground (display->display, scrollBar.win, pix_colors_focused[Color_trough]); |
137 | XClearWindow (display->display, scrollBar.win); |
140 | XClearWindow (display->display, scrollBar.win); |
138 | } |
141 | } |
139 | } |
142 | } |
140 | else |
143 | else |
141 | { |
144 | { |
142 | /* instead of XClearWindow (display->display, scrollBar.win); */ |
145 | if (update) |
|
|
146 | { |
143 | if (last_top < scrollBar.top) |
147 | if (last_top < scrollBar.top) |
144 | XClearArea (display->display, scrollBar.win, |
148 | XClearArea (display->display, scrollBar.win, |
145 | sbshadow, last_top, |
149 | sbshadow, last_top, |
146 | sbwidth, (scrollBar.top - last_top), |
150 | sbwidth, (scrollBar.top - last_top), |
147 | False); |
151 | False); |
148 | |
152 | |
149 | if (scrollBar.bot < last_bot) |
153 | if (scrollBar.bot < last_bot) |
150 | XClearArea (display->display, scrollBar.win, |
154 | XClearArea (display->display, scrollBar.win, |
151 | sbshadow, scrollBar.bot, |
155 | sbshadow, scrollBar.bot, |
152 | sbwidth, (last_bot - scrollBar.bot), |
156 | sbwidth, (last_bot - scrollBar.bot), |
153 | False); |
157 | False); |
|
|
158 | } |
|
|
159 | else |
|
|
160 | XClearWindow (display->display, scrollBar.win); |
154 | } |
161 | } |
155 | |
162 | |
156 | /* scrollbar slider */ |
163 | /* scrollbar slider */ |
157 | #ifdef SB_BORDER |
164 | #ifdef SB_BORDER |
158 | { |
165 | { |