Client: Add padding option in client to set space between tiled client (Feature #52 requested by Armael)

This commit is contained in:
Martin Duquesnoy 2010-04-25 17:20:24 +02:00
parent d3207be191
commit 995c4e94e7
5 changed files with 20 additions and 0 deletions

View File

@ -698,6 +698,17 @@ client_moveresize(Client *c, XRectangle geo, Bool r)
client_geo_hints(&geo, c);
c->flags &= ~MaxFlag;
if(conf.client.padding && c->flags & TileFlag && c->flags & FLayFlag)
{
geo.x += conf.client.padding;
geo.y += conf.client.padding;
geo.width -= conf.client.padding;
geo.height -= conf.client.padding;
c->flags &= ~FLayFlag;
}
c->geo = c->ogeo = geo;
if(c->flags & FreeFlag || tags[c->screen][c->tag].layout.func == freelayout)

View File

@ -263,6 +263,7 @@ conf_client_section(void)
conf.client.resizecorner_focus = getcolor(fetch_opt_first(sec, "#DDDDDD", "resize_corner_focus").str);
conf.client.mod |= char_to_modkey(fetch_opt_first(sec, "Alt", "modifier").str, key_list);
conf.client.set_new_win_master = fetch_opt_first(sec, "true", "set_new_win_master").bool;
conf.client.padding = fetch_opt_first(sec, "0", "padding").num;
mouse = fetch_section(sec, "mouse");

View File

@ -175,6 +175,9 @@ tiled_client(int screen, Client *c)
|| c->screen != screen
|| ishide(c, screen)); c = c->next);
if(c)
c->flags |= FLayFlag;
return c;
}

View File

@ -51,6 +51,7 @@
#define FSSFlag (1 << 8)
#define AboveFlag (1 << 9)
#define UrgentFlag (1 << 10)
#define FLayFlag (1 << 11)
#define TagFlag(t) (1 << (t))
@ -400,6 +401,7 @@ typedef struct
uint resizecorner_normal;
uint resizecorner_focus;
uint mod;
uint padding;
MouseBinding *mouse;
int nmouse;
} client;

View File

@ -124,6 +124,9 @@
resize_corner_normal = "#191919"
resize_corner_focus = "#003366"
# Space between tiled clients
padding = 0
modifier = "Alt"
[mouse] button = "1" func = "client_raise" [/mouse]