reorganized
Anselm R. Garbe arg@suckless.org
Mon, 08 Jan 2007 17:36:56 +0100
M
dwm.h
→
dwm.h
@@ -168,5 +168,6 @@ 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 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 updatemodetext(void); /* updates mtext */ 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 */
M
view.c
→
view.c
@@ -153,8 +153,7 @@ incnmaster(Arg *arg) {
if((arrange == dofloat) || (nmaster + arg->i < 1) || (wah / (nmaster + arg->i) < bh)) return; nmaster += arg->i; - snprintf(mtext, sizeof mtext, arrange == dofloat ? FLOATSYMBOL : TILESYMBOL, nmaster); - bmw = textw(mtext); + updatemodetext(); if(sel) arrange(); else@@ -224,8 +223,7 @@
void togglemode(Arg *arg) { arrange = (arrange == dofloat) ? dotile : dofloat; - snprintf(mtext, sizeof mtext, arrange == dofloat ? FLOATSYMBOL : TILESYMBOL, nmaster); - bmw = textw(mtext); + updatemodetext(); if(sel) arrange(); else@@ -241,6 +239,12 @@ for(i = 0; i < ntags && !seltag[i]; i++);
if(i == ntags) seltag[arg->i] = True; /* cannot toggle last view */ arrange(); +} + +void +updatemodetext() { + snprintf(mtext, sizeof mtext, arrange == dofloat ? FLOATSYMBOL : TILESYMBOL, nmaster); + bmw = textw(mtext); } void