aewl

changeset 771:59a6f0ba5478

beautified status bar
author meillo@marmaro.de
date Sat, 06 Dec 2008 10:56:43 +0100
parents 33cec4282120
children 0c1e9952a278
files aewl.c
diffstat 1 files changed, 26 insertions(+), 10 deletions(-) [+]
line diff
     1.1 --- a/aewl.c	Fri Dec 05 21:45:42 2008 +0100
     1.2 +++ b/aewl.c	Sat Dec 06 10:56:43 2008 +0100
     1.3 @@ -21,10 +21,8 @@
     1.4   * stack list. [...]
     1.5   *
     1.6   * Keys and tagging rules are organized as arrays and defined in the config.h
     1.7 - * file. These arrays are kept static in event.o and tag.o respectively,
     1.8 - * because no other part of dwm needs access to them.  The current mode is
     1.9 - * represented by the arrange() function pointer, which wether points to
    1.10 - * domax() or dotile().
    1.11 + * file. [...] The current mode is represented by the arrange() function
    1.12 + * pointer, which wether points to [domax()] or dotile().
    1.13   *
    1.14   * To understand everything else, start reading main.c:main().
    1.15   *
    1.16 @@ -126,7 +124,7 @@
    1.17  
    1.18  
    1.19  char stext[256];				/* status text */
    1.20 -int bh, bmw;				/* bar height, bar mode label width */
    1.21 +int bh;				/* bar height */
    1.22  int screen, sx, sy, sw, sh;		/* screen geometry */
    1.23  int wax, way, wah, waw;			/* windowarea geometry */
    1.24  unsigned int nmaster;		/* number of master clients */
    1.25 @@ -1007,16 +1005,28 @@
    1.26  void
    1.27  drawstatus(void) {
    1.28  	int x;
    1.29 +	unsigned long black[ColLast];
    1.30 +	black[ColBG] = getcolor("#000000");
    1.31 +	black[ColFG] = getcolor("#ffffff");
    1.32  
    1.33 +	/* views */
    1.34  	dc.x = dc.y = 0;
    1.35  	dc.w = textw(NAMETAGGED);
    1.36  	drawtext(NAMETAGGED, ( seltag ? dc.sel : dc.norm ));
    1.37 -	dc.x += dc.w + 1;
    1.38 +
    1.39 +	dc.x += dc.w;
    1.40 +	dc.w = BORDERPX;
    1.41 +	drawtext(NULL, black);
    1.42 +
    1.43 +	dc.x += dc.w;
    1.44  	dc.w = textw(NAMEUNTAGGED);
    1.45  	drawtext(NAMEUNTAGGED, ( seltag ? dc.norm : dc.sel ));
    1.46 -	dc.x += dc.w + 1;
    1.47 -	dc.w = bmw;
    1.48 -	drawtext("", dc.norm);
    1.49 +
    1.50 +	dc.x += dc.w;
    1.51 +	dc.w = BORDERPX;
    1.52 +	drawtext(NULL, black);
    1.53 +
    1.54 +	/* status text */
    1.55  	x = dc.x + dc.w;
    1.56  	dc.w = textw(stext);
    1.57  	dc.x = sw - dc.w;
    1.58 @@ -1025,10 +1035,17 @@
    1.59  		dc.w = sw - x;
    1.60  	}
    1.61  	drawtext(stext, dc.norm);
    1.62 +
    1.63 +	/* client title */
    1.64  	if((dc.w = dc.x - x) > bh) {
    1.65  		dc.x = x;
    1.66  		drawtext(sel ? sel->name : NULL, dc.norm);
    1.67 +
    1.68 +		dc.x += dc.w;
    1.69 +		dc.w = BORDERPX;
    1.70 +		drawtext(NULL, black);
    1.71  	}
    1.72 +
    1.73  	XCopyArea(dpy, dc.drawable, barwin, dc.gc, 0, 0, sw, bh, 0, 0);
    1.74  	XSync(dpy, False);
    1.75  }
    1.76 @@ -1557,7 +1574,6 @@
    1.77  	sw = DisplayWidth(dpy, screen);
    1.78  	sh = DisplayHeight(dpy, screen);
    1.79  	nmaster = NMASTER;
    1.80 -	bmw = 1;
    1.81  	/* bar */
    1.82  	dc.h = bh = dc.font.height + 2;
    1.83  	wa.override_redirect = 1;