about summary refs log tree commit diff stats
path: root/draw.c
diff options
context:
space:
mode:
Diffstat (limited to 'draw.c')
-rw-r--r--draw.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/draw.c b/draw.c
index ec7a3cd..3fbc85c 100644
--- a/draw.c
+++ b/draw.c
@@ -30,7 +30,7 @@ drawborder(void)
 }
 
 void
-drawtext(const char *text, Bool border)
+drawtext(const char *text, Bool invert, Bool border)
 {
 	int x, y, w, h;
 	unsigned int len;
@@ -38,7 +38,7 @@ drawtext(const char *text, Bool border)
 	XGCValues gcv;
 	XRectangle r = { dc.x, dc.y, dc.w, dc.h };
 
-	XSetForeground(dpy, dc.gc, dc.bg);
+	XSetForeground(dpy, dc.gc, invert ? dc.fg : dc.bg);
 	XFillRectangles(dpy, dc.drawable, dc.gc, &r, 1);
 
 	w = 0;
@@ -65,8 +65,8 @@ drawtext(const char *text, Bool border)
 	if(w > dc.w)
 		return; /* too long */
 
-	gcv.foreground = dc.fg;
-	gcv.background = dc.bg;
+	gcv.foreground = invert ? dc.bg : dc.fg;
+	gcv.background = invert ? dc.fg : dc.bg;
 	if(dc.font.set) {
 		XChangeGC(dpy, dc.gc, GCForeground | GCBackground, &gcv);
 		XmbDrawImageString(dpy, dc.drawable, dc.font.set, dc.gc,
2ce37bc ^
39af3c2 ^
2dbfda7 ^
00ca643 ^
a8e0772 ^
ae1d865 ^
39d1ecd ^
2ce37bc ^

f196b71 ^
3794c62 ^
f196b71 ^
051a404 ^
f25cc56 ^
5497268 ^
a8e0772 ^
2d4faae ^
12ea925 ^

a6d23fb ^
3794c62 ^

f196b71 ^
349d768 ^
0fe2e78 ^
5cd65f8 ^



0fe2e78 ^
512541b ^
1edf6a7 ^




d662f98 ^
a8e0772 ^
349d768 ^
1edf6a7 ^

5cd65f8 ^




5cd65f8 ^


12ea925 ^



5cd65f8 ^
a8e0772 ^

2ce37bc ^





5cd65f8 ^









b515765 ^
5cd65f8 ^

5cd65f8 ^



12ea925 ^

5cd65f8 ^
1edf6a7 ^
5cd65f8 ^


829b6b5 ^


b86c818 ^
5cd65f8 ^

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107