… | |
… | |
151 | Pixmap stipple; |
151 | Pixmap stipple; |
152 | unsigned long light, dark; |
152 | unsigned long light, dark; |
153 | |
153 | |
154 | gcvalue.graphics_exposures = False; |
154 | gcvalue.graphics_exposures = False; |
155 | |
155 | |
156 | gcvalue.foreground = pix_colors[Color_Black]; |
156 | gcvalue.foreground = pix_colors_focused[Color_Black]; |
157 | blackGC = XCreateGC (display->display, scrollBar.win, |
157 | blackGC = XCreateGC (display->display, scrollBar.win, |
158 | GCForeground | GCGraphicsExposures, &gcvalue); |
158 | GCForeground | GCGraphicsExposures, &gcvalue); |
159 | |
159 | |
160 | gcvalue.foreground = pix_colors[Color_White]; |
160 | gcvalue.foreground = pix_colors_focused[Color_White]; |
161 | whiteGC = XCreateGC (display->display, scrollBar.win, |
161 | whiteGC = XCreateGC (display->display, scrollBar.win, |
162 | GCForeground | GCGraphicsExposures, &gcvalue); |
162 | GCForeground | GCGraphicsExposures, &gcvalue); |
163 | |
163 | |
164 | xcol.red = 0xaeba; |
164 | xcol.red = 0xaeba; |
165 | xcol.green = 0xaaaa; |
165 | xcol.green = 0xaaaa; |
166 | xcol.blue = 0xaeba; |
166 | xcol.blue = 0xaeba; |
167 | //if (!rXAllocColor (&xcol, "light gray"))//TODO//D// |
167 | //if (!rXAllocColor (&xcol, "light gray"))//TODO//D// |
168 | xcol.pixel = pix_colors[Color_AntiqueWhite]; |
168 | xcol.pixel = pix_colors_focused[Color_AntiqueWhite]; |
169 | light = gcvalue.foreground = xcol.pixel; |
169 | light = gcvalue.foreground = xcol.pixel; |
170 | grayGC = XCreateGC (display->display, scrollBar.win, |
170 | grayGC = XCreateGC (display->display, scrollBar.win, |
171 | GCForeground | GCGraphicsExposures, &gcvalue); |
171 | GCForeground | GCGraphicsExposures, &gcvalue); |
172 | |
172 | |
173 | xcol.red = 0x51aa; |
173 | xcol.red = 0x51aa; |
174 | xcol.green = 0x5555; |
174 | xcol.green = 0x5555; |
175 | xcol.blue = 0x5144; |
175 | xcol.blue = 0x5144; |
176 | //if (!rXAllocColor (&xcol, "dark gray"))//TODO//D// |
176 | //if (!rXAllocColor (&xcol, "dark gray"))//TODO//D// |
177 | xcol.pixel = pix_colors[Color_Grey25]; |
177 | xcol.pixel = pix_colors_focused[Color_Grey25]; |
178 | dark = gcvalue.foreground = xcol.pixel; |
178 | dark = gcvalue.foreground = xcol.pixel; |
179 | darkGC = XCreateGC (display->display, scrollBar.win, |
179 | darkGC = XCreateGC (display->display, scrollBar.win, |
180 | GCForeground | GCGraphicsExposures, &gcvalue); |
180 | GCForeground | GCGraphicsExposures, &gcvalue); |
181 | |
181 | |
182 | stipple = XCreateBitmapFromData (display->display, scrollBar.win, |
182 | stipple = XCreateBitmapFromData (display->display, scrollBar.win, |
… | |
… | |
186 | gcvalue.foreground = dark; |
186 | gcvalue.foreground = dark; |
187 | gcvalue.background = light; |
187 | gcvalue.background = light; |
188 | gcvalue.fill_style = FillOpaqueStippled; |
188 | gcvalue.fill_style = FillOpaqueStippled; |
189 | gcvalue.stipple = stipple; |
189 | gcvalue.stipple = stipple; |
190 | |
190 | |
191 | /* XSetWindowBackground (display->display, scrollBar.win, pix_colors[Color_Red]); */ |
191 | /* XSetWindowBackground (display->display, scrollBar.win, pix_colors_focused[Color_Red]); */ |
192 | |
192 | |
193 | stippleGC = XCreateGC (display->display, scrollBar.win, |
193 | stippleGC = XCreateGC (display->display, scrollBar.win, |
194 | GCForeground | GCBackground | GCStipple |
194 | GCForeground | GCBackground | GCStipple |
195 | | GCFillStyle | GCGraphicsExposures, &gcvalue); |
195 | | GCFillStyle | GCGraphicsExposures, &gcvalue); |
196 | |
196 | |
… | |
… | |
228 | } |
228 | } |
229 | |
229 | |
230 | int |
230 | int |
231 | rxvt_term::scrollbar_show_next (int update, int last_top, int last_bot, int scrollbar_len) |
231 | rxvt_term::scrollbar_show_next (int update, int last_top, int last_bot, int scrollbar_len) |
232 | { |
232 | { |
233 | int height = scrollBar.end + SB_BUTTON_TOTAL_HEIGHT + SB_PADDING; |
233 | int height = scrollBar.end + SB_BUTTON_TOTAL_HEIGHT + SB_PADDING; |
234 | Drawable s; |
234 | Drawable s; |
235 | |
235 | |
236 | if ((scrollBar.init & R_SB_NEXT) == 0) |
236 | if ((scrollBar.init & R_SB_NEXT) == 0) |
237 | { |
237 | { |
238 | scrollBar.init |= R_SB_NEXT; |
238 | scrollBar.init |= R_SB_NEXT; |
239 | init_scrollbar_stuff (); |
239 | init_scrollbar_stuff (); |
… | |
… | |
247 | -SB_BORDER_WIDTH, SB_WIDTH_NEXT, |
247 | -SB_BORDER_WIDTH, SB_WIDTH_NEXT, |
248 | height + SB_BORDER_WIDTH); |
248 | height + SB_BORDER_WIDTH); |
249 | XFillRectangle (display->display, scrollBar.win, stippleGC, |
249 | XFillRectangle (display->display, scrollBar.win, stippleGC, |
250 | SB_LEFT_PADDING, 0, SB_BUTTON_WIDTH, height); |
250 | SB_LEFT_PADDING, 0, SB_BUTTON_WIDTH, height); |
251 | } |
251 | } |
|
|
252 | |
252 | if (TermWin.nscrolled) |
253 | if (TermWin.nscrolled) |
253 | { |
254 | { |
254 | if (last_top < scrollBar.top || !update) |
255 | if (last_top < scrollBar.top || !update) |
255 | XFillRectangle (display->display, scrollBar.win, stippleGC, |
256 | XFillRectangle (display->display, scrollBar.win, stippleGC, |
256 | SB_LEFT_PADDING, SB_PADDING + last_top, |
257 | SB_LEFT_PADDING, SB_PADDING + last_top, |
257 | SB_BUTTON_WIDTH, scrollBar.top - last_top); |
258 | SB_BUTTON_WIDTH, scrollBar.top - last_top); |
|
|
259 | |
258 | if (scrollBar.bot < last_bot || !update) |
260 | if (scrollBar.bot < last_bot || !update) |
259 | XFillRectangle (display->display, scrollBar.win, stippleGC, |
261 | XFillRectangle (display->display, scrollBar.win, stippleGC, |
260 | SB_LEFT_PADDING, scrollBar.bot + SB_PADDING, |
262 | SB_LEFT_PADDING, scrollBar.bot + SB_PADDING, |
261 | SB_BUTTON_WIDTH, (last_bot - scrollBar.bot)); |
263 | SB_BUTTON_WIDTH, (last_bot - scrollBar.bot)); |
|
|
264 | |
262 | XFillRectangle (display->display, scrollBar.win, grayGC, |
265 | XFillRectangle (display->display, scrollBar.win, grayGC, |
263 | SB_LEFT_PADDING, scrollBar.top + SB_PADDING, |
266 | SB_LEFT_PADDING, scrollBar.top + SB_PADDING, |
264 | SB_BUTTON_WIDTH, scrollbar_len); |
267 | SB_BUTTON_WIDTH, scrollbar_len); |
|
|
268 | |
265 | XCopyArea (display->display, dimple, scrollBar.win, whiteGC, 0, 0, |
269 | XCopyArea (display->display, dimple, scrollBar.win, whiteGC, 0, 0, |
266 | SCROLLER_DIMPLE_WIDTH, SCROLLER_DIMPLE_HEIGHT, |
270 | SCROLLER_DIMPLE_WIDTH, SCROLLER_DIMPLE_HEIGHT, |
267 | (SB_WIDTH_NEXT - SCROLLER_DIMPLE_WIDTH) / 2, |
271 | (SB_WIDTH_NEXT - SCROLLER_DIMPLE_WIDTH) / 2, |
268 | scrollBar.top + SB_BEVEL_WIDTH_UPPER_LEFT + |
272 | scrollBar.top + SB_BEVEL_WIDTH_UPPER_LEFT + |
269 | (scrollbar_len - SCROLLER_DIMPLE_HEIGHT) / 2); |
273 | (scrollbar_len - SCROLLER_DIMPLE_HEIGHT) / 2); |
… | |
… | |
286 | s = (scrollbar_isDn ()) ? downArrowHi : downArrow; |
290 | s = (scrollbar_isDn ()) ? downArrowHi : downArrow; |
287 | XCopyArea (display->display, s, scrollBar.win, whiteGC, 0, 0, |
291 | XCopyArea (display->display, s, scrollBar.win, whiteGC, 0, 0, |
288 | ARROW_WIDTH, ARROW_HEIGHT, SB_BUTTON_FACE_X, |
292 | ARROW_WIDTH, ARROW_HEIGHT, SB_BUTTON_FACE_X, |
289 | height - SB_BUTTON_SINGLE_HEIGHT + SB_BEVEL_WIDTH_UPPER_LEFT); |
293 | height - SB_BUTTON_SINGLE_HEIGHT + SB_BEVEL_WIDTH_UPPER_LEFT); |
290 | } |
294 | } |
|
|
295 | |
291 | return 1; |
296 | return 1; |
292 | } |
297 | } |
293 | #endif /* NEXT_SCROLLBAR */ |
298 | #endif /* NEXT_SCROLLBAR */ |
294 | /*----------------------- end-of-file (C source) -----------------------*/ |
299 | /*----------------------- end-of-file (C source) -----------------------*/ |