theme: add button padding and spacing (#2127)

While at it, separate corner width from button
width. Both are independed and having them
separately improves readability.
This commit is contained in:
Jens Peters 2024-09-09 17:43:38 +02:00 committed by Johan Malm
parent 8850368ab9
commit 824b0fa4e3
13 changed files with 105 additions and 39 deletions

View file

@ -220,8 +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 * (
wl_list_length(&rc.title_buttons_left) + wl_list_length(&rc.title_buttons_right));
int min_width = view_get_min_width();
/*
* First shrink the view along the relevant edge. The maximum shrink
@ -230,12 +229,12 @@ snap_shrink_to_next_edge(struct view *view,
*/
switch (direction) {
case VIEW_EDGE_RIGHT:
geo->width = MAX(geo->width / 2, min_view_width);
geo->width = MAX(geo->width / 2, min_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, min_view_width);
geo->width = MAX(geo->width / 2, min_width);
resize_edges = WLR_EDGE_RIGHT;
break;
case VIEW_EDGE_DOWN: