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.16 by root, Mon Aug 23 19:57:33 2004 UTC vs.
Revision 1.20 by root, Tue Jan 3 02:43:33 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/* draw triangular button with a shadow of SHADOW (1 or 2) pixels */ 30/* draw triangular button with a shadow of MENU_SHADOW (1 or 2) pixels */
31void 31void
32rxvt_term::Draw_button (int x, int y, int state, int dirn) 32rxvt_term::Draw_button (int x, int y, int state, int dirn)
33{ 33{
34 unsigned int sz, sz2; 34 unsigned int sz, sz2;
35 XPoint pt[3]; 35 XPoint pt[3];
78 pt[1].x = x + sz2 - 1; 78 pt[1].x = x + sz2 - 1;
79 pt[1].y = y + (dirn == UP ? 0 : sz - 1); 79 pt[1].y = y + (dirn == UP ? 0 : sz - 1);
80 XDrawLine (display->display, scrollBar.win, top, 80 XDrawLine (display->display, scrollBar.win, top,
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 (MENU_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 (MENU_SHADOW > 1)
107 /* doubled */ 110 /* doubled */
108 pt[1].x--; 111 pt[1].x--;
109 if (dirn == UP) 112 if (dirn == UP)
110 { 113 {
111 pt[2].y++; 114 pt[2].y++;
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;
137
134 if (sbshadow) 138 if (sbshadow)
135 { 139 {
136 XSetWindowBackground (display->display, scrollBar.win, pix_colors_focused[Color_trough]); 140 XSetWindowBackground (display->display, scrollBar.win, pix_colors_focused[Color_trough]);
137 XClearWindow (display->display, scrollBar.win); 141 XClearWindow (display->display, scrollBar.win);
138 } 142 }
160 /* scrollbar slider */ 164 /* scrollbar slider */
161#ifdef SB_BORDER 165#ifdef SB_BORDER
162 { 166 {
163 int xofs; 167 int xofs;
164 168
165 if (options & Opt_scrollBar_right) 169 if (OPTION (Opt_scrollBar_right))
166 xofs = 0; 170 xofs = 0;
167 else 171 else
168 xofs = sbshadow ? sbwidth : sbwidth - 1; 172 xofs = sbshadow ? sbwidth : sbwidth - 1;
169 173
170 XDrawLine (display->display, scrollBar.win, botShadowGC, 174 XDrawLine (display->display, scrollBar.win, botShadowGC,
196 200
197 return 1; 201 return 1;
198} 202}
199#endif /* RXVT_SCROLLBAR */ 203#endif /* RXVT_SCROLLBAR */
200/*----------------------- end-of-file (C source) -----------------------*/ 204/*----------------------- end-of-file (C source) -----------------------*/
205

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines