dwm-meillo
diff tag.c @ 284:5f5c56e104de
changed replacetag into toggletag
author | Anselm R.Garbe <arg@10ksloc.org> |
---|---|
date | Mon, 14 Aug 2006 16:59:18 +0200 |
parents | 1e7fa455e3b4 |
children | e864d658eb02 |
line diff
1.1 --- a/tag.c Mon Aug 14 16:37:55 2006 +0200 1.2 +++ b/tag.c Mon Aug 14 16:59:18 2006 +0200 1.3 @@ -35,16 +35,6 @@ 1.4 /* extern */ 1.5 1.6 void 1.7 -appendtag(Arg *arg) 1.8 -{ 1.9 - if(!sel) 1.10 - return; 1.11 - 1.12 - sel->tags[arg->i] = True; 1.13 - settitle(sel); 1.14 -} 1.15 - 1.16 -void 1.17 dofloat(Arg *arg) 1.18 { 1.19 Client *c; 1.20 @@ -183,19 +173,6 @@ 1.21 } 1.22 1.23 void 1.24 -replacetag(Arg *arg) 1.25 -{ 1.26 - int i; 1.27 - 1.28 - if(!sel) 1.29 - return; 1.30 - 1.31 - for(i = 0; i < ntags; i++) 1.32 - sel->tags[i] = False; 1.33 - appendtag(arg); 1.34 -} 1.35 - 1.36 -void 1.37 restack() 1.38 { 1.39 static unsigned int nwins = 0; 1.40 @@ -281,6 +258,20 @@ 1.41 } 1.42 1.43 void 1.44 +tag(Arg *arg) 1.45 +{ 1.46 + unsigned int i; 1.47 + 1.48 + if(!sel) 1.49 + return; 1.50 + 1.51 + for(i = 0; i < ntags; i++) 1.52 + sel->tags[i] = False; 1.53 + sel->tags[arg->i] = True; 1.54 + settitle(sel); 1.55 +} 1.56 + 1.57 +void 1.58 togglemode(Arg *arg) 1.59 { 1.60 arrange = arrange == dofloat ? dotile : dofloat; 1.61 @@ -288,6 +279,34 @@ 1.62 } 1.63 1.64 void 1.65 +toggletag(Arg *arg) 1.66 +{ 1.67 + unsigned int i; 1.68 + 1.69 + if(!sel) 1.70 + return; 1.71 + 1.72 + sel->tags[arg->i] = !sel->tags[arg->i]; 1.73 + for(i = 0; i < ntags && !sel->tags[i]; i++); 1.74 + if(i == ntags) 1.75 + sel->tags[arg->i] = True; 1.76 + settitle(sel); 1.77 +} 1.78 + 1.79 + 1.80 +void 1.81 +toggleview(Arg *arg) 1.82 +{ 1.83 + unsigned int i; 1.84 + 1.85 + seltag[arg->i] = !seltag[arg->i]; 1.86 + for(i = 0; i < ntags && !seltag[i]; i++); 1.87 + if(i == ntags) 1.88 + seltag[arg->i] = True; /* cannot toggle last view */ 1.89 + arrange(NULL); 1.90 +} 1.91 + 1.92 +void 1.93 view(Arg *arg) 1.94 { 1.95 unsigned int i; 1.96 @@ -297,15 +316,3 @@ 1.97 seltag[arg->i] = True; 1.98 arrange(NULL); 1.99 } 1.100 - 1.101 -void 1.102 -toggleview(Arg *arg) 1.103 -{ 1.104 - unsigned int i; 1.105 - 1.106 - seltag[arg->i] = !seltag[arg->i]; 1.107 - for(i = 0; !seltag[i] && i < ntags; i++); 1.108 - if(i == ntags) 1.109 - seltag[arg->i] = True; /* cannot toggle last view */ 1.110 - arrange(NULL); 1.111 -}