Conf: Buttons as indicators of client mode (Feature #33)
This commit is contained in:
parent
06a9c44792
commit
c350bb45d0
@ -264,6 +264,15 @@ conf_client_section(char *src)
|
|||||||
|
|
||||||
cfg_set_sauv(tmp2);
|
cfg_set_sauv(tmp2);
|
||||||
|
|
||||||
|
tmp3 = get_opt(tmp2, "none", "flags").str;
|
||||||
|
conf.titlebar.button[i].flags = 0;
|
||||||
|
if(strstr(tmp3, "free"))
|
||||||
|
conf.titlebar.button[i].flags |= FreeFlag;
|
||||||
|
if(strstr(tmp3, "max"))
|
||||||
|
conf.titlebar.button[i].flags |= MaxFlag;
|
||||||
|
if(strstr(tmp3, "tile"))
|
||||||
|
conf.titlebar.button[i].flags |= TileFlag;
|
||||||
|
|
||||||
/* Multi mouse section */
|
/* Multi mouse section */
|
||||||
if((conf.titlebar.button[i].nmouse = get_size_sec(tmp2, "mouse")))
|
if((conf.titlebar.button[i].nmouse = get_size_sec(tmp2, "mouse")))
|
||||||
{
|
{
|
||||||
|
|||||||
24
src/frame.c
24
src/frame.c
@ -220,16 +220,26 @@ frame_update(Client *c)
|
|||||||
{
|
{
|
||||||
XSetWindowBackground(dpy, c->button[i], c->colors.frame);
|
XSetWindowBackground(dpy, c->button[i], c->colors.frame);
|
||||||
XClearWindow(dpy, c->button[i]);
|
XClearWindow(dpy, c->button[i]);
|
||||||
XSetWindowBorder(dpy, c->button[i], getcolor(c->colors.fg));
|
|
||||||
|
|
||||||
/* Button's lines */
|
if((!conf.titlebar.button[i].flags)
|
||||||
if(conf.titlebar.button[i].nlines)
|
|| ((conf.titlebar.button[i].flags & FreeFlag) && (c->flags & FreeFlag))
|
||||||
|
|| ((conf.titlebar.button[i].flags & MaxFlag) && (c->flags & MaxFlag))
|
||||||
|
|| ((conf.titlebar.button[i].flags & TileFlag) && (c->flags & TileFlag)))
|
||||||
{
|
{
|
||||||
XSetForeground(dpy, gc, getcolor(c->colors.fg));
|
|
||||||
XDrawSegments(dpy, c->button[i], gc,
|
XSetWindowBorder(dpy, c->button[i], getcolor(c->colors.fg));
|
||||||
conf.titlebar.button[i].linecoord,
|
|
||||||
conf.titlebar.button[i].nlines);
|
/* Button's lines */
|
||||||
|
if(conf.titlebar.button[i].nlines)
|
||||||
|
{
|
||||||
|
XSetForeground(dpy, gc, getcolor(c->colors.fg));
|
||||||
|
XDrawSegments(dpy, c->button[i], gc,
|
||||||
|
conf.titlebar.button[i].linecoord,
|
||||||
|
conf.titlebar.button[i].nlines);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
XSetWindowBorder(dpy, c->button[i], c->colors.frame);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -303,6 +303,7 @@ typedef struct
|
|||||||
XSegment *linecoord;
|
XSegment *linecoord;
|
||||||
int nlines;
|
int nlines;
|
||||||
int nmouse;
|
int nmouse;
|
||||||
|
uint flags;
|
||||||
} Button;
|
} Button;
|
||||||
|
|
||||||
/* Alias struct */
|
/* Alias struct */
|
||||||
|
|||||||
@ -111,6 +111,8 @@
|
|||||||
[mouse] button = "3" func = "mouse_resize" [/mouse]
|
[mouse] button = "3" func = "mouse_resize" [/mouse]
|
||||||
|
|
||||||
[button]
|
[button]
|
||||||
|
# Available "free", "max", "tile" flags of button.
|
||||||
|
flags = "free,max,tile"
|
||||||
[mouse] button = "1" func = "client_kill" [/mouse]
|
[mouse] button = "1" func = "client_kill" [/mouse]
|
||||||
[mouse] button = "3" func = "menu" cmd = "clientmenu" [/mouse]
|
[mouse] button = "3" func = "menu" cmd = "clientmenu" [/mouse]
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user