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

@ -48,8 +48,8 @@ ssd_border_create(struct ssd *ssd)
add_scene_rect(&subtree->parts, LAB_SSD_PART_BOTTOM, parent,
full_width, theme->border_width, 0, height, color);
add_scene_rect(&subtree->parts, LAB_SSD_PART_TOP, parent,
width - 2 * SSD_BUTTON_WIDTH, theme->border_width,
theme->border_width + SSD_BUTTON_WIDTH,
width - 2 * theme->window_button_width, theme->border_width,
theme->border_width + theme->window_button_width,
-(ssd->titlebar.height + theme->border_width), color);
} FOR_EACH_END
@ -121,10 +121,10 @@ ssd_border_update(struct ssd *ssd)
: 0;
int top_width = ssd->titlebar.height <= 0 || ssd->state.was_tiled_not_maximized
? full_width
: width - 2 * SSD_BUTTON_WIDTH;
: width - 2 * theme->window_button_width;
int top_x = ssd->titlebar.height <= 0 || ssd->state.was_tiled_not_maximized
? 0
: theme->border_width + SSD_BUTTON_WIDTH;
: theme->border_width + theme->window_button_width;
struct ssd_part *part;
struct wlr_scene_rect *rect;