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);
|
||||
|
||||
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 */
|
||||
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);
|
||||
XClearWindow(dpy, c->button[i]);
|
||||
XSetWindowBorder(dpy, c->button[i], getcolor(c->colors.fg));
|
||||
|
||||
/* Button's lines */
|
||||
if(conf.titlebar.button[i].nlines)
|
||||
if((!conf.titlebar.button[i].flags)
|
||||
|| ((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,
|
||||
conf.titlebar.button[i].linecoord,
|
||||
conf.titlebar.button[i].nlines);
|
||||
|
||||
XSetWindowBorder(dpy, c->button[i], getcolor(c->colors.fg));
|
||||
|
||||
/* 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;
|
||||
int nlines;
|
||||
int nmouse;
|
||||
uint flags;
|
||||
} Button;
|
||||
|
||||
/* Alias struct */
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user