dwm-meillo
changeset 237:7f8f7f14e9cd
readded border color, this sucks least
author | Anselm R.Garbe <arg@10ksloc.org> |
---|---|
date | Thu, 10 Aug 2006 11:12:15 +0200 |
parents | ebecb98a1c29 |
children | 969fb6be25e1 |
files | config.arg.h config.default.h draw.c dwm.h main.c |
diffstat | 5 files changed, 26 insertions(+), 14 deletions(-) [+] |
line diff
1.1 --- a/config.arg.h Thu Aug 10 11:07:27 2006 +0200 1.2 +++ b/config.arg.h Thu Aug 10 11:12:15 2006 +0200 1.3 @@ -11,6 +11,7 @@ 1.4 #define FONT "-*-terminus-medium-*-*-*-12-*-*-*-*-*-iso10646-*" 1.5 #define BGCOLOR "#eeeeee" 1.6 #define FGCOLOR "#666699" 1.7 +#define BORDERCOLOR "#9999CC" 1.8 #define MODKEY Mod1Mask 1.9 #define NUMLOCKMASK Mod2Mask 1.10 #define MASTERW 60 /* percent */
2.1 --- a/config.default.h Thu Aug 10 11:07:27 2006 +0200 2.2 +++ b/config.default.h Thu Aug 10 11:12:15 2006 +0200 2.3 @@ -11,6 +11,7 @@ 2.4 #define FONT "fixed" 2.5 #define BGCOLOR "#666699" 2.6 #define FGCOLOR "#eeeeee" 2.7 +#define BORDERCOLOR "#9999CC" 2.8 #define MODKEY Mod1Mask 2.9 #define NUMLOCKMASK Mod2Mask 2.10 #define MASTERW 60 /* percent */
3.1 --- a/draw.c Thu Aug 10 11:07:27 2006 +0200 3.2 +++ b/draw.c Thu Aug 10 11:12:15 2006 +0200 3.3 @@ -9,6 +9,26 @@ 3.4 3.5 /* static */ 3.6 3.7 +static void 3.8 +drawborder(void) 3.9 +{ 3.10 + XPoint points[5]; 3.11 + 3.12 + XSetLineAttributes(dpy, dc.gc, 1, LineSolid, CapButt, JoinMiter); 3.13 + XSetForeground(dpy, dc.gc, dc.border); 3.14 + points[0].x = dc.x; 3.15 + points[0].y = dc.y; 3.16 + points[1].x = dc.w - 1; 3.17 + points[1].y = 0; 3.18 + points[2].x = 0; 3.19 + points[2].y = dc.h - 1; 3.20 + points[3].x = -(dc.w - 1); 3.21 + points[3].y = 0; 3.22 + points[4].x = 0; 3.23 + points[4].y = -(dc.h - 1); 3.24 + XDrawLines(dpy, dc.drawable, dc.gc, points, 5, CoordModePrevious); 3.25 +} 3.26 + 3.27 static unsigned int 3.28 textnw(const char *text, unsigned int len) 3.29 { 3.30 @@ -28,11 +48,12 @@ 3.31 static char buf[256]; 3.32 unsigned int len; 3.33 XGCValues gcv; 3.34 - XPoint points[5]; 3.35 XRectangle r = { dc.x, dc.y, dc.w, dc.h }; 3.36 3.37 XSetForeground(dpy, dc.gc, invert ? dc.fg : dc.bg); 3.38 XFillRectangles(dpy, dc.drawable, dc.gc, &r, 1); 3.39 + drawborder(); 3.40 + 3.41 if(!text) 3.42 return; 3.43 3.44 @@ -66,19 +87,6 @@ 3.45 XChangeGC(dpy, dc.gc, GCForeground | GCBackground | GCFont, &gcv); 3.46 XDrawImageString(dpy, dc.drawable, dc.gc, x, y, buf, len); 3.47 } 3.48 - 3.49 - XSetLineAttributes(dpy, dc.gc, 1, LineSolid, CapButt, JoinMiter); 3.50 - points[0].x = dc.x; 3.51 - points[0].y = dc.y; 3.52 - points[1].x = dc.w - 1; 3.53 - points[1].y = 0; 3.54 - points[2].x = 0; 3.55 - points[2].y = dc.h - 1; 3.56 - points[3].x = -(dc.w - 1); 3.57 - points[3].y = 0; 3.58 - points[4].x = 0; 3.59 - points[4].y = -(dc.h - 1); 3.60 - XDrawLines(dpy, dc.drawable, dc.gc, points, 5, CoordModePrevious); 3.61 } 3.62 3.63 /* extern */