found less intrusive way c976bc6c
Anselm R. Garbe · 2006-08-24 09:41 1 file(s) · +12 −6
draw.c +12 −6
22 22
}
23 23
24 24
static void
25 -
drawtext(const char *text, Bool invert, Bool underline)
25 +
drawtext(const char *text, Bool invert, Bool highlight)
26 26
{
27 27
	int x, y, w, h;
28 28
	static char buf[256];
85 85
		XChangeGC(dpy, dc.gc, GCForeground | GCBackground | GCFont, &gcv);
86 86
		XDrawString(dpy, dc.drawable, dc.gc, x, y, buf, len);
87 87
	}
88 -
	if(underline) {
89 -
		points[0].x = dc.x + (h / 2) - 1;
90 -
		points[0].y = dc.y + dc.h - 3;
91 -
		points[1].x = dc.w - h + 2;
88 +
	if(highlight) {
89 +
		points[0].x = dc.x + 1;
90 +
		points[0].y = dc.y + 1;
91 +
		points[1].x = dc.w - 3;
92 92
		points[1].y = 0;
93 -
		XDrawLines(dpy, dc.drawable, dc.gc, points, 2, CoordModePrevious);
93 +
		points[2].x = 0;
94 +
		points[2].y = dc.h - 3;
95 +
		points[3].x = -(dc.w - 3);
96 +
		points[3].y = 0;
97 +
		points[4].x = 0;
98 +
		points[4].y = -(dc.h - 3);
99 +
		XDrawLines(dpy, dc.drawable, dc.gc, points, 5, CoordModePrevious);
94 100
	}
95 101
}
96 102