aewl

changeset 236:ebecb98a1c29

drawing border with fg color
author Anselm R.Garbe <arg@10ksloc.org>
date Thu, 10 Aug 2006 11:07:27 +0200
parents 60e73ebaab27
children 7f8f7f14e9cd
files draw.c
diffstat 1 files changed, 14 insertions(+), 1 deletions(-) [+]
line diff
     1.1 --- a/draw.c	Thu Aug 10 10:27:08 2006 +0200
     1.2 +++ b/draw.c	Thu Aug 10 11:07:27 2006 +0200
     1.3 @@ -28,11 +28,11 @@
     1.4  	static char buf[256];
     1.5  	unsigned int len;
     1.6  	XGCValues gcv;
     1.7 +	XPoint points[5];
     1.8  	XRectangle r = { dc.x, dc.y, dc.w, dc.h };
     1.9  
    1.10  	XSetForeground(dpy, dc.gc, invert ? dc.fg : dc.bg);
    1.11  	XFillRectangles(dpy, dc.drawable, dc.gc, &r, 1);
    1.12 -
    1.13  	if(!text)
    1.14  		return;
    1.15  
    1.16 @@ -66,6 +66,19 @@
    1.17  		XChangeGC(dpy, dc.gc, GCForeground | GCBackground | GCFont, &gcv);
    1.18  		XDrawImageString(dpy, dc.drawable, dc.gc, x, y, buf, len);
    1.19  	}
    1.20 +
    1.21 +	XSetLineAttributes(dpy, dc.gc, 1, LineSolid, CapButt, JoinMiter);
    1.22 +	points[0].x = dc.x;
    1.23 +	points[0].y = dc.y;
    1.24 +	points[1].x = dc.w - 1;
    1.25 +	points[1].y = 0;
    1.26 +	points[2].x = 0;
    1.27 +	points[2].y = dc.h - 1;
    1.28 +	points[3].x = -(dc.w - 1);
    1.29 +	points[3].y = 0;
    1.30 +	points[4].x = 0;
    1.31 +	points[4].y = -(dc.h - 1);
    1.32 +	XDrawLines(dpy, dc.drawable, dc.gc, points, 5, CoordModePrevious);
    1.33  }
    1.34  
    1.35  /* extern */