theme: allow to set window button size (#1965)

This commit introduces new option "window.button.width". Despite the name
it currently affects both width and height.
This commit is contained in:
Consus 2024-07-20 11:33:57 +03:00 committed by GitHub
parent 46ec513630
commit e4afa10fe4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 59 additions and 33 deletions

View file

@ -32,7 +32,8 @@ ssd_extents_create(struct ssd *ssd)
struct theme *theme = view->server->theme;
struct wl_list *part_list = &ssd->extents.parts;
int extended_area = SSD_EXTENDED_AREA;
int corner_size = extended_area + theme->border_width + SSD_BUTTON_WIDTH / 2;
int corner_size = extended_area + theme->border_width +
theme->window_button_width / 2;
ssd->extents.tree = wlr_scene_tree_create(ssd->tree);
struct wlr_scene_tree *parent = ssd->extents.tree;
@ -109,7 +110,8 @@ ssd_extents_update(struct ssd *ssd)
int full_height = height + theme->border_width * 2 + ssd->titlebar.height;
int full_width = width + 2 * theme->border_width;
int extended_area = SSD_EXTENDED_AREA;
int corner_size = extended_area + theme->border_width + SSD_BUTTON_WIDTH / 2;
int corner_size = extended_area + theme->border_width +
theme->window_button_width / 2;
int side_width = full_width + extended_area * 2 - corner_size * 2;
int side_height = full_height + extended_area * 2 - corner_size * 2;