reorganized 5a5851ba
Anselm R. Garbe · 2007-01-08 17:36 3 file(s) · +10 −6
dwm.h +1 −0
168 168
extern void togglefloat(Arg *arg);		/* toggles focusesd client between floating/non-floating state */
169 169
extern void togglemode(Arg *arg);		/* toggles global arrange function (dotile/dofloat) */
170 170
extern void toggleview(Arg *arg);		/* toggles the tag with arg's index (in)visible */
171 +
extern void updatemodetext(void);		/* updates mtext */
171 172
extern void view(Arg *arg);			/* views the tag with arg's index */
172 173
extern void zoom(Arg *arg);			/* zooms the focused client to master area, arg is ignored */
main.c +1 −2
133 133
	sh = DisplayHeight(dpy, screen);
134 134
	master = MASTER;
135 135
	nmaster = NMASTER;
136 -
	snprintf(mtext, sizeof mtext, arrange == dofloat ? FLOATSYMBOL : TILESYMBOL, nmaster);
137 -
	bmw = textw(mtext);
136 +
	updatemodetext();
138 137
	/* bar */
139 138
	bx = sx;
140 139
	by = sy;
view.c +8 −4
153 153
	if((arrange == dofloat) || (nmaster + arg->i < 1) || (wah / (nmaster + arg->i) < bh))
154 154
		return;
155 155
	nmaster += arg->i;
156 -
	snprintf(mtext, sizeof mtext, arrange == dofloat ? FLOATSYMBOL : TILESYMBOL, nmaster);
157 -
	bmw = textw(mtext);
156 +
	updatemodetext();
158 157
	if(sel)
159 158
		arrange();
160 159
	else
224 223
void
225 224
togglemode(Arg *arg) {
226 225
	arrange = (arrange == dofloat) ? dotile : dofloat;
227 -
	snprintf(mtext, sizeof mtext, arrange == dofloat ? FLOATSYMBOL : TILESYMBOL, nmaster);
228 -
	bmw = textw(mtext);
226 +
	updatemodetext();
229 227
	if(sel)
230 228
		arrange();
231 229
	else
241 239
	if(i == ntags)
242 240
		seltag[arg->i] = True; /* cannot toggle last view */
243 241
	arrange();
242 +
}
243 +
244 +
void
245 +
updatemodetext() {
246 +
	snprintf(mtext, sizeof mtext, arrange == dofloat ? FLOATSYMBOL : TILESYMBOL, nmaster);
247 +
	bmw = textw(mtext);
244 248
}
245 249
246 250
void