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

@ -220,6 +220,7 @@ snap_shrink_to_next_edge(struct view *view,
*geo = view->pending;
uint32_t resize_edges;
int min_view_width = rc.theme->window_button_width * SSD_BUTTON_COUNT;
/*
* First shrink the view along the relevant edge. The maximum shrink
@ -228,12 +229,12 @@ snap_shrink_to_next_edge(struct view *view,
*/
switch (direction) {
case VIEW_EDGE_RIGHT:
geo->width = MAX(geo->width / 2, LAB_MIN_VIEW_WIDTH);
geo->width = MAX(geo->width / 2, min_view_width);
geo->x = view->pending.x + view->pending.width - geo->width;
resize_edges = WLR_EDGE_LEFT;
break;
case VIEW_EDGE_LEFT:
geo->width = MAX(geo->width / 2, LAB_MIN_VIEW_WIDTH);
geo->width = MAX(geo->width / 2, min_view_width);
resize_edges = WLR_EDGE_RIGHT;
break;
case VIEW_EDGE_DOWN: