removed mode label stuff

master
Anselm R. Garbe 2007-01-14 22:32:26 +01:00
parent 6c5dc7017c
commit ceea528eff
6 changed files with 6 additions and 16 deletions

View File

@ -7,7 +7,7 @@ const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9", NULL };
#define DEFMODE dotile /* dofloat */ #define DEFMODE dotile /* dofloat */
#define FLOATSYMBOL "><>" #define FLOATSYMBOL "><>"
#define TILESYMBOL "[%u]=" /* %u is replaced with nmaster */ #define TILESYMBOL "[]="
#define FONT "-*-terminus-medium-r-*-*-14-*-*-*-*-*-*-*" #define FONT "-*-terminus-medium-r-*-*-14-*-*-*-*-*-*-*"
#define NORMBGCOLOR "#222" #define NORMBGCOLOR "#222"

View File

@ -7,7 +7,7 @@ const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9", NULL };
#define DEFMODE dotile /* dofloat */ #define DEFMODE dotile /* dofloat */
#define FLOATSYMBOL "><>" #define FLOATSYMBOL "><>"
#define TILESYMBOL "[%u]=" /* %u is replaced with nmaster */ #define TILESYMBOL "[]="
#define FONT "-*-fixed-medium-r-normal-*-13-*-*-*-*-*-*-*" #define FONT "-*-fixed-medium-r-normal-*-13-*-*-*-*-*-*-*"
#define NORMBGCOLOR "#333366" #define NORMBGCOLOR "#333366"

2
draw.c
View File

@ -120,7 +120,7 @@ drawstatus(void) {
dc.x += dc.w; dc.x += dc.w;
} }
dc.w = bmw; dc.w = bmw;
drawtext(mtext, dc.status, False, False); drawtext(arrange == dofloat ? FLOATSYMBOL : TILESYMBOL, dc.status, False, False);
x = dc.x + dc.w; x = dc.x + dc.w;
dc.w = textw(stext); dc.w = textw(stext);
dc.x = bw - dc.w; dc.x = bw - dc.w;

4
dwm.h
View File

@ -90,8 +90,7 @@ struct Client {
}; };
extern const char *tags[]; /* all tags */ extern const char *tags[]; /* all tags */
extern char stext[1024]; /* status text */ extern char stext[256]; /* status text */
extern char mtext[32]; /* mode text */
extern int bx, by, bw, bh, bmw; /* bar geometry, bar mode label width */ extern int bx, by, bw, bh, bmw; /* bar geometry, bar mode label width */
extern int screen, sx, sy, sw, sh; /* screen geometry */ extern int screen, sx, sy, sw, sh; /* screen geometry */
extern int wax, way, wah, waw; /* windowarea geometry */ extern int wax, way, wah, waw; /* windowarea geometry */
@ -163,6 +162,5 @@ extern void restack(void); /* restores z layers of all clients */
extern void togglefloat(Arg *arg); /* toggles focusesd client between floating/non-floating state */ extern void togglefloat(Arg *arg); /* toggles focusesd client between floating/non-floating state */
extern void togglemode(Arg *arg); /* toggles global arrange function (dotile/dofloat) */ extern void togglemode(Arg *arg); /* toggles global arrange function (dotile/dofloat) */
extern void toggleview(Arg *arg); /* toggles the tag with arg's index (in)visible */ extern void toggleview(Arg *arg); /* toggles the tag with arg's index (in)visible */
extern void updatemodetext(void); /* updates mtext */
extern void view(Arg *arg); /* views the tag with arg's index */ extern void view(Arg *arg); /* views the tag with arg's index */
extern void zoom(Arg *arg); /* zooms the focused client to master area, arg is ignored */ extern void zoom(Arg *arg); /* zooms the focused client to master area, arg is ignored */

4
main.c
View File

@ -17,7 +17,7 @@
/* extern */ /* extern */
char stext[1024], mtext[32]; char stext[256];
Bool *seltag; Bool *seltag;
int bx, by, bw, bh, bmw, masterd, screen, sx, sy, sw, sh, wax, way, waw, wah; int bx, by, bw, bh, bmw, masterd, screen, sx, sy, sw, sh, wax, way, waw, wah;
unsigned int master, nmaster, ntags, numlockmask; unsigned int master, nmaster, ntags, numlockmask;
@ -134,7 +134,7 @@ setup(void) {
sh = DisplayHeight(dpy, screen); sh = DisplayHeight(dpy, screen);
master = MASTER; master = MASTER;
nmaster = NMASTER; nmaster = NMASTER;
updatemodetext(); bmw = textw(TILESYMBOL) > textw(FLOATSYMBOL) ? textw(TILESYMBOL) : textw(FLOATSYMBOL);
/* bar */ /* bar */
bx = sx; bx = sx;
by = sy; by = sy;

8
view.c
View File

@ -152,7 +152,6 @@ incnmaster(Arg *arg) {
if((arrange == dofloat) || (nmaster + arg->i < 1) || (wah / (nmaster + arg->i) < bh)) if((arrange == dofloat) || (nmaster + arg->i < 1) || (wah / (nmaster + arg->i) < bh))
return; return;
nmaster += arg->i; nmaster += arg->i;
updatemodetext();
if(sel) if(sel)
arrange(); arrange();
else else
@ -217,7 +216,6 @@ togglefloat(Arg *arg) {
void void
togglemode(Arg *arg) { togglemode(Arg *arg) {
arrange = (arrange == dofloat) ? dotile : dofloat; arrange = (arrange == dofloat) ? dotile : dofloat;
updatemodetext();
if(sel) if(sel)
arrange(); arrange();
else else
@ -235,12 +233,6 @@ toggleview(Arg *arg) {
arrange(); arrange();
} }
void
updatemodetext() {
snprintf(mtext, sizeof mtext, arrange == dofloat ? FLOATSYMBOL : TILESYMBOL, nmaster);
bmw = textw(mtext);
}
void void
view(Arg *arg) { view(Arg *arg) {
unsigned int i; unsigned int i;