comparison view.c @ 674:5d79c351e30a

implemented nmaster appearance in mode label (using %u)
author Anselm R. Garbe <arg@suckless.org>
date Mon, 08 Jan 2007 17:33:24 +0100
parents 3e0f11a44293
children 1438e35b622e
comparison
equal deleted inserted replaced
673:d47d6e28441b 674:5d79c351e30a
1 /* (C)opyright MMVI-MMVII Anselm R. Garbe <garbeam at gmail dot com> 1 /* (C)opyright MMVI-MMVII Anselm R. Garbe <garbeam at gmail dot com>
2 * See LICENSE file for license details. 2 * See LICENSE file for license details.
3 */ 3 */
4 #include "dwm.h" 4 #include "dwm.h"
5 #include <stdio.h>
5 6
6 /* static */ 7 /* static */
7 8
8 static Client * 9 static Client *
9 nexttiled(Client *c) { 10 nexttiled(Client *c) {
147 } 148 }
148 } 149 }
149 150
150 void 151 void
151 incnmaster(Arg *arg) { 152 incnmaster(Arg *arg) {
152 if((nmaster + arg->i < 1) || (wah / (nmaster + arg->i) < bh)) 153 if((arrange == dofloat) || (nmaster + arg->i < 1) || (wah / (nmaster + arg->i) < bh))
153 return; 154 return;
154 nmaster += arg->i; 155 nmaster += arg->i;
155 arrange(); 156 snprintf(mtext, sizeof mtext, arrange == dofloat ? FLOATSYMBOL : TILESYMBOL, nmaster);
157 bmw = textw(mtext);
158 if(sel)
159 arrange();
160 else
161 drawstatus();
156 } 162 }
157 163
158 Bool 164 Bool
159 isvisible(Client *c) { 165 isvisible(Client *c) {
160 unsigned int i; 166 unsigned int i;
216 } 222 }
217 223
218 void 224 void
219 togglemode(Arg *arg) { 225 togglemode(Arg *arg) {
220 arrange = (arrange == dofloat) ? dotile : dofloat; 226 arrange = (arrange == dofloat) ? dotile : dofloat;
227 snprintf(mtext, sizeof mtext, arrange == dofloat ? FLOATSYMBOL : TILESYMBOL, nmaster);
228 bmw = textw(mtext);
221 if(sel) 229 if(sel)
222 arrange(); 230 arrange();
223 else 231 else
224 drawstatus(); 232 drawstatus();
225 } 233 }