csd: add support for a visible border

When we’re using CSDs, we’ve up until now rendered a 5px invisible
border. This border handles interactive resizing. I.e. hovering it
changes the mouse cursor, and mouse button events are used to start an
interactive resize.

This patch makes it possible to color part of (or the entire) border,
with a configurable color.

To facilitate this, two new options have been added:

* csd.border-width
* csd.border-color

border-width defaults to 0, resulting in the look we’re used to.

border-color defaults to the title bar color. If the title bar color
hasn’t been set, it defaults to the default foreground color (just
like the title bar color does).

This means that, setting border-width but not border-color, results in
a border that blends with the title bar.
This commit is contained in:
Daniel Eklöf 2021-10-27 18:27:08 +02:00
parent eebec8e38d
commit 5e4de143de
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
6 changed files with 99 additions and 7 deletions

View file

@ -214,6 +214,7 @@ struct config {
int title_height;
int border_width;
int border_width_visible;
int button_width;
struct {
@ -222,11 +223,13 @@ struct config {
bool minimize_set:1;
bool maximize_set:1;
bool close_set:1;
bool border_set:1;
uint32_t title;
uint32_t buttons;
uint32_t minimize;
uint32_t maximize;
uint32_t close;
uint32_t border;
} color;
struct config_font_list font;