mirror of
https://github.com/labwc/labwc.git
synced 2025-11-06 13:29:58 -05:00
ssd: apply title layout
This commit is contained in:
parent
9a252249c9
commit
39ff873d5b
7 changed files with 140 additions and 78 deletions
|
|
@ -233,14 +233,17 @@ 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 min_view_width = rc.theme->window_button_width * (
|
||||
wl_list_length(&rc.title_buttons_left) + wl_list_length(&rc.title_buttons_right));
|
||||
int eff_width = current.width;
|
||||
int eff_height = view_effective_height(ssd->view, /* use_pending */ false);
|
||||
|
||||
if (eff_width > 0 && eff_width < min_view_width) {
|
||||
/*
|
||||
* Prevent negative values in calculations like
|
||||
* `width - SSD_BUTTON_WIDTH * SSD_BUTTON_COUNT`
|
||||
* `width - theme->window_button_width
|
||||
* * (wl_list_length(&rc.title_buttons_left)
|
||||
* + wl_list_length(&rc.title_buttons_right))`
|
||||
*/
|
||||
wlr_log(WLR_ERROR,
|
||||
"view width is smaller than its minimal value");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue