aewl
changeset 598:38bbcf31accc
changed things like I described in last mail
author | arg@mig29 |
---|---|
date | Fri, 01 Dec 2006 10:16:10 +0100 |
parents | 7a48d1f06223 |
children | a21891491770 |
files | draw.c |
diffstat | 1 files changed, 11 insertions(+), 15 deletions(-) [+] |
line diff
1.1 --- a/draw.c Fri Dec 01 09:52:15 2006 +0100 1.2 +++ b/draw.c Fri Dec 01 10:16:10 2006 +0100 1.3 @@ -30,13 +30,13 @@ 1.4 } 1.5 1.6 static void 1.7 -drawtext(const char *text, unsigned long col[ColLast], Bool border, Bool ldot) { 1.8 +drawtext(const char *text, unsigned long col[ColLast], Bool dot, Bool border) { 1.9 int x, y, w, h; 1.10 static char buf[256]; 1.11 unsigned int len, olen; 1.12 XGCValues gcv; 1.13 XRectangle r = { dc.x, dc.y, dc.w, dc.h }; 1.14 - XPoint pt[5]; 1.15 + XPoint pt[3]; 1.16 1.17 XSetForeground(dpy, dc.gc, col[ColBG]); 1.18 XFillRectangles(dpy, dc.drawable, dc.gc, &r, 1); 1.19 @@ -74,24 +74,20 @@ 1.20 XChangeGC(dpy, dc.gc, GCForeground | GCFont, &gcv); 1.21 XDrawString(dpy, dc.drawable, dc.gc, x, y, buf, len); 1.22 } 1.23 - if(ldot) { 1.24 - r.x = dc.x + 2; 1.25 - r.y = dc.y + 2; 1.26 + if(dot) { 1.27 r.width = r.height = (h + 2) / 4; 1.28 + r.x = dc.x + dc.w - r.width - 2; 1.29 + r.y = dc.y + dc.h - r.height - 2; 1.30 XFillRectangles(dpy, dc.drawable, dc.gc, &r, 1); 1.31 } 1.32 if(border) { 1.33 pt[0].x = dc.x; 1.34 - pt[0].y = dc.y; 1.35 - pt[1].x = dc.w - 1; 1.36 - pt[1].y = 0; 1.37 - pt[2].x = 0; 1.38 - pt[2].y = dc.h - 1; 1.39 - pt[3].x = -(dc.w - 1); 1.40 - pt[3].y = 0; 1.41 - pt[4].x = 0; 1.42 - pt[4].y = -(dc.h - 1); 1.43 - XDrawLines(dpy, dc.drawable, dc.gc, pt, 5, CoordModePrevious); 1.44 + pt[0].y = dc.y + dc.h - 1; 1.45 + pt[1].x = 0; 1.46 + pt[1].y = -(dc.h - 1); 1.47 + pt[2].x = dc.w - 1; 1.48 + pt[2].y = 0; 1.49 + XDrawLines(dpy, dc.drawable, dc.gc, pt, 3, CoordModePrevious); 1.50 } 1.51 } 1.52