changeset 771:59a6f0ba5478

beautified status bar
author meillo@marmaro.de
date Sat, 06 Dec 2008 10:56:43 +0100 (2008-12-06)
parents 33cec4282120
children 0c1e9952a278
files aewl.c
diffstat 1 files changed, 26 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/aewl.c	Fri Dec 05 21:45:42 2008 +0100
+++ b/aewl.c	Sat Dec 06 10:56:43 2008 +0100
@@ -21,10 +21,8 @@
  * stack list. [...]
  *
  * Keys and tagging rules are organized as arrays and defined in the config.h
- * file. These arrays are kept static in event.o and tag.o respectively,
- * because no other part of dwm needs access to them.  The current mode is
- * represented by the arrange() function pointer, which wether points to
- * domax() or dotile().
+ * file. [...] The current mode is represented by the arrange() function
+ * pointer, which wether points to [domax()] or dotile().
  *
  * To understand everything else, start reading main.c:main().
  *
@@ -126,7 +124,7 @@
 
 
 char stext[256];				/* status text */
-int bh, bmw;				/* bar height, bar mode label width */
+int bh;				/* bar height */
 int screen, sx, sy, sw, sh;		/* screen geometry */
 int wax, way, wah, waw;			/* windowarea geometry */
 unsigned int nmaster;		/* number of master clients */
@@ -1007,16 +1005,28 @@
 void
 drawstatus(void) {
 	int x;
+	unsigned long black[ColLast];
+	black[ColBG] = getcolor("#000000");
+	black[ColFG] = getcolor("#ffffff");
 
+	/* views */
 	dc.x = dc.y = 0;
 	dc.w = textw(NAMETAGGED);
 	drawtext(NAMETAGGED, ( seltag ? dc.sel : dc.norm ));
-	dc.x += dc.w + 1;
+
+	dc.x += dc.w;
+	dc.w = BORDERPX;
+	drawtext(NULL, black);
+
+	dc.x += dc.w;
 	dc.w = textw(NAMEUNTAGGED);
 	drawtext(NAMEUNTAGGED, ( seltag ? dc.norm : dc.sel ));
-	dc.x += dc.w + 1;
-	dc.w = bmw;
-	drawtext("", dc.norm);
+
+	dc.x += dc.w;
+	dc.w = BORDERPX;
+	drawtext(NULL, black);
+
+	/* status text */
 	x = dc.x + dc.w;
 	dc.w = textw(stext);
 	dc.x = sw - dc.w;
@@ -1025,10 +1035,17 @@
 		dc.w = sw - x;
 	}
 	drawtext(stext, dc.norm);
+
+	/* client title */
 	if((dc.w = dc.x - x) > bh) {
 		dc.x = x;
 		drawtext(sel ? sel->name : NULL, dc.norm);
+
+		dc.x += dc.w;
+		dc.w = BORDERPX;
+		drawtext(NULL, black);
 	}
+
 	XCopyArea(dpy, dc.drawable, barwin, dc.gc, 0, 0, sw, bh, 0, 0);
 	XSync(dpy, False);
 }
@@ -1557,7 +1574,6 @@
 	sw = DisplayWidth(dpy, screen);
 	sh = DisplayHeight(dpy, screen);
 	nmaster = NMASTER;
-	bmw = 1;
 	/* bar */
 	dc.h = bh = dc.font.height + 2;
 	wa.override_redirect = 1;