diff options
author | Dave Davenport <qball@gmpclient.org> | 2024-02-15 09:13:37 +0100 |
---|---|---|
committer | Dave Davenport <qball@gmpclient.org> | 2024-02-15 09:13:37 +0100 |
commit | 831bddc68b79c58044dbfeb2be62f77948e1726b (patch) | |
tree | 8b897bd0b778706dc8aea324ebed7400b8870d01 | |
parent | 13c2a617666d5ee054fee2bba6abc3ce6a557570 (diff) |
[Box] When estimating height, set correct width on children
Issue: #1943
-rw-r--r-- | source/widgets/box.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/source/widgets/box.c b/source/widgets/box.c index 3a5c49d4..e0425b8e 100644 --- a/source/widgets/box.c +++ b/source/widgets/box.c @@ -96,6 +96,7 @@ static int box_get_desired_height(widget *wid, const int width) { box *b = (box *)wid; int spacing = distance_get_pixel(b->spacing, b->type); int height = 0; + int nw = width - widget_padding_get_padding_width(wid); if (b->type == ROFI_ORIENTATION_VERTICAL) { int active_widgets = 0; for (GList *iter = g_list_first(b->children); iter != NULL; @@ -105,7 +106,7 @@ static int box_get_desired_height(widget *wid, const int width) { continue; } active_widgets++; - height += widget_get_desired_height(child, width); + height += widget_get_desired_height(child, nw); } if (active_widgets > 0) { height += (active_widgets - 1) * spacing; @@ -117,7 +118,7 @@ static int box_get_desired_height(widget *wid, const int width) { if (!child->enabled) { continue; } - height = MAX(widget_get_desired_height(child, width), height); + height = MAX(widget_get_desired_height(child, nw), height); } } height += widget_padding_get_padding_height(wid); |