Introduction
Introduction Statistics Contact Development Disclaimer Help
tchanging tag indicator through underline - dwm - [fork] customized build of dw…
git clone git://src.adamsgaard.dk/dwm
Log
Files
Refs
README
LICENSE
---
commit 2e834e941f695481894123e0665416f96333653b
parent 77e5f3167c97863ef8e27b6e57fd35ee0c73c8ff
Author: Anselm R. Garbe <[email protected]>
Date: Thu, 24 Aug 2006 09:25:10 +0200
changing tag indicator through underline
Diffstat:
M draw.c | 42 ++++++++++++-----------------…
M main.c | 1 +
2 files changed, 17 insertions(+), 26 deletions(-)
---
diff --git a/draw.c b/draw.c
t@@ -22,9 +22,17 @@ textnw(const char *text, unsigned int len)
}
static void
-drawborder()
+drawtext(const char *text, Bool invert, Bool underline)
{
+ int x, y, w, h;
+ static char buf[256];
+ unsigned int len, olen;
+ XGCValues gcv;
XPoint points[5];
+ XRectangle r = { dc.x, dc.y, dc.w, dc.h };
+
+ XSetForeground(dpy, dc.gc, invert ? dc.fg : dc.bg);
+ XFillRectangles(dpy, dc.drawable, dc.gc, &r, 1);
points[0].x = dc.x;
points[0].y = dc.y;
points[1].x = dc.w - 1;
t@@ -35,24 +43,8 @@ drawborder()
points[3].y = 0;
points[4].x = 0;
points[4].y = -(dc.h - 1);
- XDrawLines(dpy, dc.drawable, dc.gc, points, 5, CoordModePrevious);
-}
-
-static void
-drawtext(const char *text, Bool invert, Bool highlight)
-{
- int x, y, w, h;
- static char buf[256];
- unsigned int len, olen;
- DC tmp;
- XGCValues gcv;
- XRectangle r = { dc.x, dc.y, dc.w, dc.h };
-
- XSetForeground(dpy, dc.gc, invert ? dc.fg : dc.bg);
- XFillRectangles(dpy, dc.drawable, dc.gc, &r, 1);
- XSetLineAttributes(dpy, dc.gc, 1, LineSolid, CapButt, JoinMiter);
XSetForeground(dpy, dc.gc, dc.border);
- drawborder();
+ XDrawLines(dpy, dc.drawable, dc.gc, points, 5, CoordModePrevious);
if(!text)
return;
t@@ -93,14 +85,12 @@ drawtext(const char *text, Bool invert, Bool highlight)
XChangeGC(dpy, dc.gc, GCForeground | GCBackground | GCFont, &g…
XDrawString(dpy, dc.drawable, dc.gc, x, y, buf, len);
}
- if(highlight) {
- tmp = dc;
- dc.x += 2;
- dc.y += 2;
- dc.w -= 4;
- dc.h -= 4;
- drawborder();
- dc = tmp;
+ if(underline) {
+ points[0].x = dc.x + (h / 2) - 1;
+ points[0].y = dc.y + dc.h - 3;
+ points[1].x = dc.w - h + 2;
+ points[1].y = 0;
+ XDrawLines(dpy, dc.drawable, dc.gc, points, 2, CoordModePrevio…
}
}
diff --git a/main.c b/main.c
t@@ -145,6 +145,7 @@ setup()
dc.drawable = XCreatePixmap(dpy, root, sw, bh, DefaultDepth(dpy, scree…
dc.gc = XCreateGC(dpy, root, 0, 0);
+ XSetLineAttributes(dpy, dc.gc, 1, LineSolid, CapButt, JoinMiter);
issel = XQueryPointer(dpy, root, &w, &w, &i, &i, &i, &i, &mask);
strcpy(stext, "dwm-"VERSION);
You are viewing proxied material from mx1.adamsgaard.dk. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.