From aeae3fa0c61afcfdec3a18342a8c2d072e234875 Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Sat, 15 May 2021 22:54:31 +0300 Subject: Widget: Rearranging expanding widgets When starting a new arrangement, expanding widgets must be reset so they won't affect the outcome. --- src/ui/util.c | 2 +- src/ui/widget.c | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ui/util.c b/src/ui/util.c index e653b58c..82047479 100644 --- a/src/ui/util.c +++ b/src/ui/util.c @@ -1836,7 +1836,7 @@ static void updateValueInputWidth_(iWidget *dlg) { } else { dlg->rect.size.x = - iMaxi(iMaxi(iMin(rootSize.x, 100 * gap_UI), title->rect.size.x), prompt->rect.size.x); + iMin(rootSize.x, iMaxi(iMaxi(100 * gap_UI, title->rect.size.x), prompt->rect.size.x)); } } diff --git a/src/ui/widget.c b/src/ui/widget.c index 3a67bf4e..310522ce 100644 --- a/src/ui/widget.c +++ b/src/ui/widget.c @@ -741,6 +741,9 @@ static void resetArrangement_Widget_(iWidget *d) { child->rect.pos.y = 0; } } + if (child->flags & expand_WidgetFlag) { + child->rect = zero_Rect(); + } } } -- cgit v1.2.3