aewl

diff view.c @ 511:1599c953647b

removed the direction flipping
author Anselm R. Garbe <arg@10kloc.org>
date Fri, 29 Sep 2006 17:02:56 +0200
parents 0dfa6b752aed
children aca04c3022c1
line diff
     1.1 --- a/view.c	Fri Sep 29 16:54:15 2006 +0200
     1.2 +++ b/view.c	Fri Sep 29 17:02:56 2006 +0200
     1.3 @@ -65,7 +65,6 @@
     1.4  /* extern */
     1.5  
     1.6  void (*arrange)(Arg *) = DEFMODE;
     1.7 -Bool isvertical = VERTICALSTACK;
     1.8  StackPos stackpos = STACKPOS;
     1.9  
    1.10  void
    1.11 @@ -119,20 +118,11 @@
    1.12  		stackh = sh - bh;
    1.13  	}
    1.14  
    1.15 -	if(isvertical) {
    1.16 -		tw = stackw;
    1.17 -		if(n > 1)
    1.18 -			th = stackh / (n - 1);
    1.19 -		else
    1.20 -			th = stackh;
    1.21 -	}
    1.22 -	else {
    1.23 +	tw = stackw;
    1.24 +	if(n > 1)
    1.25 +		th = stackh / (n - 1);
    1.26 +	else
    1.27  		th = stackh;
    1.28 -		if(n > 1)
    1.29 -			tw = stackw / (n - 1);
    1.30 -		else
    1.31 -			tw = stackw;
    1.32 -	}
    1.33  
    1.34  	for(i = 0, c = clients; c; c = c->next) {
    1.35  		if(isvisible(c)) {
    1.36 @@ -169,56 +159,32 @@
    1.37  					break;
    1.38  				}
    1.39  			}
    1.40 -			else if((isvertical && th > bh) || (!isvertical && tw > MINW)) {
    1.41 +			else if(th > bh) {
    1.42  				/* tile window */
    1.43  				c->w = tw - 2 * BORDERPX;
    1.44  				c->h = th - 2 * BORDERPX;
    1.45  				switch(stackpos) {
    1.46  				case StackLeft:
    1.47 -					if(isvertical) {
    1.48 -						c->x = sx;
    1.49 -						c->y = sy + (i - 1) * th + bh;
    1.50 -						if(i + 1 == n)
    1.51 -							c->h = sh - c->y - 2 * BORDERPX;
    1.52 -					}
    1.53 -					else {
    1.54 -						c->x = sx + (i - 1) * tw;
    1.55 -						c->y = sy + bh;
    1.56 -						if(i + 1 == n)
    1.57 -							c->w = sx + stackw - c->x - 2 * BORDERPX;
    1.58 -					}
    1.59 +					c->x = sx;
    1.60 +					c->y = sy + (i - 1) * th + bh;
    1.61 +					if(i + 1 == n)
    1.62 +						c->h = sh - c->y - 2 * BORDERPX;
    1.63  					break;
    1.64  				case StackBottom:
    1.65 -					if(isvertical) {
    1.66 -						c->x = sx;
    1.67 -						c->y = sy + master + (i - 1) * th + bh;
    1.68 -						if(i + 1 == n)
    1.69 -							c->h = sh - c->y - 2 * BORDERPX;
    1.70 -					}
    1.71 -					else {
    1.72 -						c->x = sx + (i - 1) * tw;
    1.73 -						c->y = sy + bh + master;
    1.74 -						if(i + 1 == n)
    1.75 -							c->w = sw - c->x - 2 * BORDERPX;
    1.76 -					}
    1.77 +					c->x = sx;
    1.78 +					c->y = sy + master + (i - 1) * th + bh;
    1.79 +					if(i + 1 == n)
    1.80 +						c->h = sh - c->y - 2 * BORDERPX;
    1.81  					break;
    1.82  				case StackRight:
    1.83 -					if(isvertical) {
    1.84 -						c->x = sx + master;
    1.85 -						c->y = sy + (i - 1) * th + bh;
    1.86 -						if(i + 1 == n)
    1.87 -							c->h = sh - c->y - 2 * BORDERPX;
    1.88 -					}
    1.89 -					else {
    1.90 -						c->x = sx + master + (i - 1) * tw;
    1.91 -						c->y = sy + bh;
    1.92 -						if(i + 1 == n)
    1.93 -							c->w = sw - c->x - 2 * BORDERPX;
    1.94 -					}
    1.95 +					c->x = sx + master;
    1.96 +					c->y = sy + (i - 1) * th + bh;
    1.97 +					if(i + 1 == n)
    1.98 +						c->h = sh - c->y - 2 * BORDERPX;
    1.99  					break;
   1.100  				}
   1.101  			}
   1.102 -			else { /* fallback if th < bh resp. tw < MINW */
   1.103 +			else { /* fallback if th < bh */
   1.104  				c->w = stackw - 2 * BORDERPX;
   1.105  				c->h = stackh - 2 * BORDERPX;
   1.106  				switch(stackpos) {
   1.107 @@ -360,14 +326,6 @@
   1.108  }
   1.109  
   1.110  void
   1.111 -togglestackdir(Arg *arg) {
   1.112 -	if(arrange == dofloat)
   1.113 -		return;
   1.114 -	isvertical = !isvertical;
   1.115 -	arrange(NULL);
   1.116 -}
   1.117 -
   1.118 -void
   1.119  togglestackpos(Arg *arg) {
   1.120  	if(arrange == dofloat)
   1.121  		return;