14
src/config.c
14
src/config.c
@ -193,13 +193,13 @@ void load_configuration(xcb_connection_t *conn, const char *override_configpath,
|
||||
memset(&config, 0, sizeof(config));
|
||||
|
||||
/* Initialize default colors */
|
||||
#define INIT_COLOR(x, cborder, cbackground, ctext, cindicator) \
|
||||
do { \
|
||||
x.border = draw_util_hex_to_color(cborder); \
|
||||
x.background = draw_util_hex_to_color(cbackground); \
|
||||
x.text = draw_util_hex_to_color(ctext); \
|
||||
x.indicator = draw_util_hex_to_color(cindicator); \
|
||||
x.decoration_border = draw_util_hex_to_color(cbackground); \
|
||||
#define INIT_COLOR(x, cborder, cbackground, ctext, cindicator) \
|
||||
do { \
|
||||
x.border = draw_util_hex_to_color(cborder); \
|
||||
x.background = draw_util_hex_to_color(cbackground); \
|
||||
x.text = draw_util_hex_to_color(ctext); \
|
||||
x.indicator = draw_util_hex_to_color(cindicator); \
|
||||
x.child_border = draw_util_hex_to_color(cbackground); \
|
||||
} while (0)
|
||||
|
||||
config.client.background = draw_util_hex_to_color("#000000");
|
||||
|
@ -338,22 +338,22 @@ CFGFUN(color_single, const char *colorclass, const char *color) {
|
||||
config.client.background = draw_util_hex_to_color(color);
|
||||
}
|
||||
|
||||
CFGFUN(color, const char *colorclass, const char *border, const char *background, const char *text, const char *indicator, const char *decoration_border) {
|
||||
#define APPLY_COLORS(classname) \
|
||||
do { \
|
||||
if (strcmp(colorclass, "client." #classname) == 0) { \
|
||||
config.client.classname.border = draw_util_hex_to_color(border); \
|
||||
config.client.classname.background = draw_util_hex_to_color(background); \
|
||||
config.client.classname.text = draw_util_hex_to_color(text); \
|
||||
if (indicator != NULL) { \
|
||||
config.client.classname.indicator = draw_util_hex_to_color(indicator); \
|
||||
} \
|
||||
if (decoration_border != NULL) { \
|
||||
config.client.classname.decoration_border = draw_util_hex_to_color(decoration_border); \
|
||||
} else { \
|
||||
config.client.classname.decoration_border = config.client.classname.background; \
|
||||
} \
|
||||
} \
|
||||
CFGFUN(color, const char *colorclass, const char *border, const char *background, const char *text, const char *indicator, const char *child_border) {
|
||||
#define APPLY_COLORS(classname) \
|
||||
do { \
|
||||
if (strcmp(colorclass, "client." #classname) == 0) { \
|
||||
config.client.classname.border = draw_util_hex_to_color(border); \
|
||||
config.client.classname.background = draw_util_hex_to_color(background); \
|
||||
config.client.classname.text = draw_util_hex_to_color(text); \
|
||||
if (indicator != NULL) { \
|
||||
config.client.classname.indicator = draw_util_hex_to_color(indicator); \
|
||||
} \
|
||||
if (child_border != NULL) { \
|
||||
config.client.classname.child_border = draw_util_hex_to_color(child_border); \
|
||||
} else { \
|
||||
config.client.classname.child_border = config.client.classname.background; \
|
||||
} \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
APPLY_COLORS(focused_inactive);
|
||||
|
10
src/x.c
10
src/x.c
@ -464,24 +464,22 @@ void x_draw_decoration(Con *con) {
|
||||
* rectangle because some childs are not freely resizable and we want
|
||||
* their background color to "shine through". */
|
||||
if (!(borders_to_hide & ADJ_LEFT_SCREEN_EDGE)) {
|
||||
draw_util_rectangle(conn, &(con->frame_buffer), p->color->decoration_border, 0, 0, br.x, r->height);
|
||||
draw_util_rectangle(conn, &(con->frame_buffer), p->color->child_border, 0, 0, br.x, r->height);
|
||||
}
|
||||
if (!(borders_to_hide & ADJ_RIGHT_SCREEN_EDGE)) {
|
||||
draw_util_rectangle(conn, &(con->frame_buffer),
|
||||
p->color->decoration_border, r->width + (br.width + br.x), 0,
|
||||
p->color->child_border, r->width + (br.width + br.x), 0,
|
||||
-(br.width + br.x), r->height);
|
||||
}
|
||||
if (!(borders_to_hide & ADJ_LOWER_SCREEN_EDGE)) {
|
||||
draw_util_rectangle(conn, &(con->frame_buffer),
|
||||
p->color->decoration_border, br.x, r->height + (br.height +
|
||||
br.y),
|
||||
p->color->child_border, br.x, r->height + (br.height + br.y),
|
||||
r->width + br.width, -(br.height + br.y));
|
||||
}
|
||||
/* pixel border needs an additional line at the top */
|
||||
if (p->border_style == BS_PIXEL && !(borders_to_hide & ADJ_UPPER_SCREEN_EDGE)) {
|
||||
draw_util_rectangle(conn, &(con->frame_buffer),
|
||||
p->color->decoration_border, br.x, 0, r->width + br.width,
|
||||
br.y);
|
||||
p->color->child_border, br.x, 0, r->width + br.width, br.y);
|
||||
}
|
||||
|
||||
/* Highlight the side of the border at which the next window will be
|
||||
|
Reference in New Issue
Block a user