Client/conf: Add border_shadow boolean option in the configuration file.

This commit is contained in:
Martin Duquesnoy 2009-03-21 20:53:11 +01:00
parent 1e6bf6821a
commit 9c6ecc2459
5 changed files with 29 additions and 14 deletions

View File

@ -163,6 +163,7 @@ conf_client_section(cfg_t *cfg_c)
/* Client misc */
conf.client.borderheight = (cfg_getint(cfg_c, "border_height")) ? cfg_getint(cfg_c, "border_height") : 1;
conf.client.border_shadow = cfg_getbool(cfg_c, "border_shadow");
conf.client.place_at_mouse = cfg_getbool(cfg_c, "place_at_mouse");
conf.client.bordernormal = getcolor(alias_to_str(cfg_getstr(cfg_c, "border_normal")));
conf.client.borderfocus = getcolor(alias_to_str(cfg_getstr(cfg_c, "border_focus")));

View File

@ -92,6 +92,7 @@ cfg_opt_t titlebar_opts[] =
cfg_opt_t client_opts[]=
{
CFG_BOOL("place_at_mouse", cfg_false, CFGF_NONE),
CFG_BOOL("border_shadow", cfg_false, CFGF_NONE),
CFG_INT("border_height", 1, CFGF_NONE),
CFG_STR("border_normal", "#354B5C", CFGF_NONE),
CFG_STR("border_focus", "#6286A1", CFGF_NONE),

View File

@ -113,10 +113,13 @@ frame_create(Client *c)
c->colors.resizecorner, &at);
/* Border (for shadow) */
CWIN(c->left, c->frame, 0, 0, SHADH, c->frame_geo.height, 0, CWBackPixel, color_enlight(c->colors.frame), &at);
CWIN(c->top, c->frame, 0, 0, c->frame_geo.width, SHADH, 0, CWBackPixel, color_enlight(c->colors.frame), &at);
CWIN(c->bottom, c->frame, 0, c->frame_geo.height - SHADH, c->frame_geo.width, SHADH, 0, CWBackPixel, SHADC, &at);
CWIN(c->right, c->frame, c->frame_geo.width - SHADH, 0, SHADH, c->frame_geo.height, 0, CWBackPixel, SHADC, &at);
if(conf.client.border_shadow)
{
CWIN(c->left, c->frame, 0, 0, SHADH, c->frame_geo.height, 0, CWBackPixel, color_enlight(c->colors.frame), &at);
CWIN(c->top, c->frame, 0, 0, c->frame_geo.width, SHADH, 0, CWBackPixel, color_enlight(c->colors.frame), &at);
CWIN(c->bottom, c->frame, 0, c->frame_geo.height - SHADH, c->frame_geo.width, SHADH, 0, CWBackPixel, SHADC, &at);
CWIN(c->right, c->frame, c->frame_geo.width - SHADH, 0, SHADH, c->frame_geo.height, 0, CWBackPixel, SHADC, &at);
}
/* Reparent window with the frame */
XReparentWindow(dpy, c->win, c->frame, BORDH, BORDH + TBARH);
@ -173,10 +176,13 @@ frame_moveresize(Client *c, XRectangle geo)
XMoveWindow(dpy, c->resize, c->frame_geo.width - RESHW, c->frame_geo.height - RESHW);
/* Border */
if(conf.client.border_shadow)
{
XResizeWindow(dpy, c->left, SHADH, c->frame_geo.height - SHADH);
XResizeWindow(dpy, c->top, c->frame_geo.width, SHADH);
XMoveResizeWindow(dpy, c->bottom, 0, c->frame_geo.height - SHADH, c->frame_geo.width, SHADH);
XMoveResizeWindow(dpy, c->right, c->frame_geo.width - SHADH, 0, SHADH, c->frame_geo.height);
}
return;
}
@ -218,17 +224,22 @@ frame_update(Client *c)
XSetWindowBackground(dpy, c->frame, c->colors.frame);
XSetWindowBackground(dpy, c->resize, c->colors.resizecorner);
XSetWindowBackground(dpy, c->left, color_enlight(c->colors.frame));
XSetWindowBackground(dpy, c->top, color_enlight(c->colors.frame));
XSetWindowBackground(dpy, c->right, SHADC);
XSetWindowBackground(dpy, c->bottom, SHADC);
XClearWindow(dpy, c->resize);
XClearWindow(dpy, c->frame);
XClearWindow(dpy, c->left);
XClearWindow(dpy, c->top);
XClearWindow(dpy, c->right);
XClearWindow(dpy, c->bottom);
XClearWindow(dpy, c->resize);
if(conf.client.border_shadow)
{
XSetWindowBackground(dpy, c->left, color_enlight(c->colors.frame));
XSetWindowBackground(dpy, c->top, color_enlight(c->colors.frame));
XSetWindowBackground(dpy, c->right, SHADC);
XSetWindowBackground(dpy, c->bottom, SHADC);
XClearWindow(dpy, c->left);
XClearWindow(dpy, c->top);
XClearWindow(dpy, c->right);
XClearWindow(dpy, c->bottom);
}
if(TBARH && (TBARH + BORDH + 1) > font->height)
barwin_draw_text(c->titlebar,

View File

@ -291,6 +291,7 @@ typedef struct
struct
{
Bool place_at_mouse;
Bool border_shadow;
int borderheight;
uint bordernormal;
uint borderfocus;

1
wmfsrc
View File

@ -76,6 +76,7 @@ root
client
{
border_height = 3
border_shadow = true
border_normal = "#191919"
border_focus = "#003366"
resize_corner_normal = "#191919"