ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/scrollbar-rxvt.C
(Generate patch)

Comparing rxvt-unicode/src/scrollbar-rxvt.C (file contents):
Revision 1.17 by root, Fri Feb 4 11:41:23 2005 UTC vs.
Revision 1.21 by root, Mon Jan 16 15:12:48 2006 UTC

25#include "rxvt.h" /* NECESSARY */ 25#include "rxvt.h" /* NECESSARY */
26 26
27/*----------------------------------------------------------------------*/ 27/*----------------------------------------------------------------------*/
28#if defined(RXVT_SCROLLBAR) 28#if defined(RXVT_SCROLLBAR)
29 29
30#define DOUBLED 1
31
30/* draw triangular button with a shadow of SHADOW (1 or 2) pixels */ 32/* draw triangular button with a shadow of 2 pixels */
31void 33void
32rxvt_term::Draw_button (int x, int y, int state, int dirn) 34rxvt_term::Draw_button (int x, int y, int state, int dirn)
33{ 35{
34 unsigned int sz, sz2; 36 unsigned int sz, sz2;
35 XPoint pt[3]; 37 XPoint pt[3];
78 pt[1].x = x + sz2 - 1; 80 pt[1].x = x + sz2 - 1;
79 pt[1].y = y + (dirn == UP ? 0 : sz - 1); 81 pt[1].y = y + (dirn == UP ? 0 : sz - 1);
80 XDrawLine (display->display, scrollBar.win, top, 82 XDrawLine (display->display, scrollBar.win, top,
81 pt[0].x, pt[0].y, pt[1].x, pt[1].y); 83 pt[0].x, pt[0].y, pt[1].x, pt[1].y);
82 84
83#if (SHADOW > 1) 85#if DOUBLED
84 /* doubled */ 86 /* doubled */
85 pt[0].x++; 87 pt[0].x++;
86 88
87 if (dirn == UP) 89 if (dirn == UP)
88 { 90 {
96 } 98 }
97 99
98 XDrawLine (display->display, scrollBar.win, top, 100 XDrawLine (display->display, scrollBar.win, top,
99 pt[0].x, pt[0].y, pt[1].x, pt[1].y); 101 pt[0].x, pt[0].y, pt[1].x, pt[1].y);
100#endif 102#endif
103
101 /* draw shadow on right */ 104 /* draw shadow on right */
102 pt[1].x = x + sz - 1; 105 pt[1].x = x + sz - 1;
103 /* pt[2].x = x + sz2; */ 106 /* pt[2].x = x + sz2; */
104 pt[1].y = y + (dirn == UP ? sz - 1 : 0); 107 pt[1].y = y + (dirn == UP ? sz - 1 : 0);
105 pt[2].y = y + (dirn == UP ? 0 : sz - 1); 108 pt[2].y = y + (dirn == UP ? 0 : sz - 1);
106 XDrawLine (display->display, scrollBar.win, bot, 109 XDrawLine (display->display, scrollBar.win, bot,
107 pt[2].x, pt[2].y, pt[1].x, pt[1].y); 110 pt[2].x, pt[2].y, pt[1].x, pt[1].y);
108 111
109#if (SHADOW > 1) 112#if DOUBLED
110 /* doubled */ 113 /* doubled */
111 pt[1].x--; 114 pt[1].x--;
112 if (dirn == UP) 115 if (dirn == UP)
113 { 116 {
114 pt[2].y++; 117 pt[2].y++;
132 int sbwidth = (int)scrollBar.width; 135 int sbwidth = (int)scrollBar.width;
133 136
134 if ((scrollBar.init & R_SB_RXVT) == 0) 137 if ((scrollBar.init & R_SB_RXVT) == 0)
135 { 138 {
136 scrollBar.init |= R_SB_RXVT; 139 scrollBar.init |= R_SB_RXVT;
140
137 if (sbshadow) 141 if (sbshadow)
138 { 142 {
139 XSetWindowBackground (display->display, scrollBar.win, pix_colors_focused[Color_trough]); 143 XSetWindowBackground (display->display, scrollBar.win, pix_colors_focused[Color_trough]);
140 XClearWindow (display->display, scrollBar.win); 144 XClearWindow (display->display, scrollBar.win);
141 } 145 }
163 /* scrollbar slider */ 167 /* scrollbar slider */
164#ifdef SB_BORDER 168#ifdef SB_BORDER
165 { 169 {
166 int xofs; 170 int xofs;
167 171
168 if (options & Opt_scrollBar_right) 172 if (OPTION (Opt_scrollBar_right))
169 xofs = 0; 173 xofs = 0;
170 else 174 else
171 xofs = sbshadow ? sbwidth : sbwidth - 1; 175 xofs = sbshadow ? sbwidth : sbwidth - 1;
172 176
173 XDrawLine (display->display, scrollBar.win, botShadowGC, 177 XDrawLine (display->display, scrollBar.win, botShadowGC,
199 203
200 return 1; 204 return 1;
201} 205}
202#endif /* RXVT_SCROLLBAR */ 206#endif /* RXVT_SCROLLBAR */
203/*----------------------- end-of-file (C source) -----------------------*/ 207/*----------------------- end-of-file (C source) -----------------------*/
208

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines