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

@ -233,10 +233,11 @@ ssd_update_geometry(struct ssd *ssd)
struct wlr_box cached = ssd->state.geometry;
struct wlr_box current = ssd->view->current;
int min_view_width = rc.theme->window_button_width * SSD_BUTTON_COUNT;
int eff_width = current.width;
int eff_height = view_effective_height(ssd->view, /* use_pending */ false);
if (eff_width > 0 && eff_width < LAB_MIN_VIEW_WIDTH) {
if (eff_width > 0 && eff_width < min_view_width) {
/*
* Prevent negative values in calculations like
* `width - SSD_BUTTON_WIDTH * SSD_BUTTON_COUNT`