# HG changeset patch # User meillo@marmaro.de # Date 1228557403 -3600 # Node ID 59a6f0ba547841933ed141b81d841afee918a546 # Parent 33cec428212037315a65a8a451d818d68b92a0a8 beautified status bar diff -r 33cec4282120 -r 59a6f0ba5478 aewl.c --- 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;