1
0

drawing border around sel item

This commit is contained in:
Anselm R.Garbe 2006-08-10 11:07:06 +02:00
parent e94a87eb46
commit 02c882c8e5
2 changed files with 21 additions and 6 deletions

View File

@ -34,7 +34,7 @@ extern Display *dpy;
extern DC dc; extern DC dc;
/* draw.c */ /* draw.c */
extern void drawtext(const char *text, Bool invert); extern void drawtext(const char *text, Bool sel);
extern unsigned long getcolor(const char *colstr); extern unsigned long getcolor(const char *colstr);
extern void setfont(const char *fontstr); extern void setfont(const char *fontstr);
extern unsigned int textw(const char *text); extern unsigned int textw(const char *text);

View File

@ -24,18 +24,18 @@ textnw(const char *text, unsigned int len)
/* extern */ /* extern */
void void
drawtext(const char *text, Bool invert) drawtext(const char *text, Bool sel)
{ {
int x, y, w, h; int x, y, w, h;
static char buf[256]; static char buf[256];
unsigned int len; unsigned int len;
XGCValues gcv; XGCValues gcv;
XPoint points[5];
XRectangle r = { dc.x, dc.y, dc.w, dc.h }; XRectangle r = { dc.x, dc.y, dc.w, dc.h };
XSetForeground(dpy, dc.gc, invert ? dc.fg : dc.bg); XSetForeground(dpy, dc.gc, sel ? dc.fg : dc.bg);
XFillRectangles(dpy, dc.drawable, dc.gc, &r, 1); XFillRectangles(dpy, dc.drawable, dc.gc, &r, 1);
w = 0; w = 0;
if(!text) if(!text)
return; return;