introduce a min_colwidth (32 pix for now), limit the amount of columns to screenwidth/(2*min_colwidth)

This commit is contained in:
Sander van Dijk 2006-03-23 21:39:02 +01:00
parent 80bde63776
commit 9d96bc2fe6
3 changed files with 12 additions and 11 deletions

View File

@ -407,12 +407,12 @@ drop_resize(Frame *f, XRectangle *new)
/* horizontal resize */
if(west && (new->x != f->rect.x)) {
horiz_resize = True;
if(new->x < 0 || new->x < (west->rect.x + min)) {
new->width -= (west->rect.x + min) - new->x;
new->x = west->rect.x + min;
} else if(new->width < min) {
new->x -= min - new->width;
new->width = min;
if(new->x < 0 || new->x < (west->rect.x + MIN_COLWIDTH)) {
new->width -= (west->rect.x + MIN_COLWIDTH) - new->x;
new->x = west->rect.x + MIN_COLWIDTH;
} else if(new->width < MIN_COLWIDTH) {
new->x -= MIN_COLWIDTH - new->width;
new->width = MIN_COLWIDTH;
}
west->rect.width = new->x - west->rect.x;
a->rect.width += a->rect.x - new->x;
@ -422,10 +422,10 @@ drop_resize(Frame *f, XRectangle *new)
}
if(east && (new->x + new->width != f->rect.x + f->rect.width)) {
horiz_resize = True;
if((new->x + new->width) > (east->rect.x + east->rect.width - min))
new->width = (east->rect.x + east->rect.width - min) - new->x;
else if(new->width < min)
new->width = min;
if((new->x + new->width) > (east->rect.x + east->rect.width - MIN_COLWIDTH))
new->width = (east->rect.x + east->rect.width - MIN_COLWIDTH) - new->x;
else if(new->width < MIN_COLWIDTH)
new->width = MIN_COLWIDTH;
east->rect.width -= new->x + new->width - east->rect.x;
east->rect.x = new->x + new->width;
a->rect.width = (new->x + new->width) - a->rect.x;

View File

@ -506,7 +506,7 @@ send2area_client(Client *c, char *arg)
if(i == -1)
return;
if(!strncmp(arg, "new", 4) && i) {
if(a->nframe == 1)
if(a->nframe == 1 || v->narea - 1 >= rect.width / (2 * MIN_COLWIDTH))
return;
to = alloc_area(v);
arrange_tag(v, True);

View File

@ -66,6 +66,7 @@ enum {
#define MAX_TAGS 8
#define MAX_TAGLEN 32
#define WM_PROTOCOL_DELWIN 1
#define MIN_COLWIDTH 32
typedef struct View View;
typedef struct Area Area;