… | |
… | |
148 | } |
148 | } |
149 | |
149 | |
150 | int |
150 | int |
151 | scrollBar_t::show_rxvt (int update) |
151 | scrollBar_t::show_rxvt (int update) |
152 | { |
152 | { |
153 | int sbshadow = shadow; |
|
|
154 | int sbwidth = (int)width; |
153 | int sbwidth = (int)width; |
155 | |
154 | |
156 | if ((init & R_SB_RXVT) == 0) |
155 | if ((init & R_SB_RXVT) == 0) |
157 | { |
156 | { |
158 | XGCValues gcvalue; |
157 | XGCValues gcvalue; |
… | |
… | |
163 | topShadowGC = XCreateGC (term->dpy, term->vt, GCForeground, &gcvalue); |
162 | topShadowGC = XCreateGC (term->dpy, term->vt, GCForeground, &gcvalue); |
164 | gcvalue.foreground = term->pix_colors[Color_bottomShadow]; |
163 | gcvalue.foreground = term->pix_colors[Color_bottomShadow]; |
165 | botShadowGC = XCreateGC (term->dpy, term->vt, GCForeground, &gcvalue); |
164 | botShadowGC = XCreateGC (term->dpy, term->vt, GCForeground, &gcvalue); |
166 | gcvalue.foreground = term->pix_colors[ (term->depth <= 2 ? Color_fg : Color_scroll)]; |
165 | gcvalue.foreground = term->pix_colors[ (term->depth <= 2 ? Color_fg : Color_scroll)]; |
167 | scrollbarGC = XCreateGC (term->dpy, term->vt, GCForeground, &gcvalue); |
166 | scrollbarGC = XCreateGC (term->dpy, term->vt, GCForeground, &gcvalue); |
168 | if (sbshadow) |
167 | if (shadow) |
169 | { |
168 | { |
170 | XSetWindowBackground (term->dpy, win, term->pix_colors_focused[Color_trough]); |
169 | XSetWindowBackground (term->dpy, win, term->pix_colors_focused[Color_trough]); |
171 | XClearWindow (term->dpy, win); |
170 | XClearWindow (term->dpy, win); |
172 | } |
171 | } |
173 | } |
172 | } |
… | |
… | |
175 | { |
174 | { |
176 | if (update) |
175 | if (update) |
177 | { |
176 | { |
178 | if (last_top < top) |
177 | if (last_top < top) |
179 | XClearArea (term->dpy, win, |
178 | XClearArea (term->dpy, win, |
180 | sbshadow, last_top, |
179 | shadow, last_top, |
181 | sbwidth, (top - last_top), |
180 | sbwidth, (top - last_top), |
182 | False); |
181 | False); |
183 | |
182 | |
184 | if (bot < last_bot) |
183 | if (bot < last_bot) |
185 | XClearArea (term->dpy, win, |
184 | XClearArea (term->dpy, win, |
186 | sbshadow, bot, |
185 | shadow, bot, |
187 | sbwidth, (last_bot - bot), |
186 | sbwidth, (last_bot - bot), |
188 | False); |
187 | False); |
189 | } |
188 | } |
190 | else |
189 | else |
191 | XClearWindow (term->dpy, win); |
190 | XClearWindow (term->dpy, win); |
… | |
… | |
197 | int xofs; |
196 | int xofs; |
198 | |
197 | |
199 | if (term->option (Opt_scrollBar_right)) |
198 | if (term->option (Opt_scrollBar_right)) |
200 | xofs = 0; |
199 | xofs = 0; |
201 | else |
200 | else |
202 | xofs = sbshadow ? sbwidth : sbwidth - 1; |
201 | xofs = shadow ? sbwidth : sbwidth - 1; |
203 | |
202 | |
204 | XDrawLine (term->dpy, win, botShadowGC, |
203 | XDrawLine (term->dpy, win, botShadowGC, |
205 | xofs, 0, xofs, end + sbwidth); |
204 | xofs, 0, xofs, end + sbwidth); |
206 | } |
205 | } |
207 | #endif |
206 | #endif |
208 | |
207 | |
209 | XFillRectangle (term->dpy, win, scrollbarGC, |
208 | XFillRectangle (term->dpy, win, scrollbarGC, |
210 | sbshadow, top, sbwidth, |
209 | shadow, top, sbwidth, |
211 | len); |
210 | bot - top); |
212 | |
211 | |
213 | if (sbshadow) |
212 | if (shadow) |
214 | /* trough shadow */ |
213 | /* trough shadow */ |
215 | draw_shadow (this, 0, 0, sbwidth + 2 * sbshadow, end + (sbwidth + 1) + sbshadow); |
214 | draw_shadow (this, 0, 0, sbwidth + 2 * shadow, end + (sbwidth + 1) + shadow); |
216 | |
215 | |
217 | /* shadow for scrollbar slider */ |
216 | /* shadow for scrollbar slider */ |
218 | draw_shadow (this, sbshadow, top, sbwidth, len); |
217 | draw_shadow (this, shadow, top, sbwidth, bot - top); |
219 | |
218 | |
220 | /* Redraw scrollbar arrows */ |
219 | /* Redraw scrollbar arrows */ |
221 | draw_button (this, sbshadow, sbshadow, UP); |
220 | draw_button (this, shadow, shadow, UP); |
222 | draw_button (this, sbshadow, end + 1, DN); |
221 | draw_button (this, shadow, end + 1, DN); |
223 | |
222 | |
224 | return 1; |
223 | return 1; |
225 | } |
224 | } |
226 | #endif /* RXVT_SCROLLBAR */ |
225 | #endif /* RXVT_SCROLLBAR */ |
227 | /*----------------------- end-of-file (C source) -----------------------*/ |
226 | /*----------------------- end-of-file (C source) -----------------------*/ |