summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2020-09-07 20:18:22 +0300
committerJaakko Keränen <jaakko.keranen@iki.fi>2020-09-07 20:18:22 +0300
commit594df27872dbcd72a5bd161260a04ca119928113 (patch)
treed9275a7002e4ca1a1400288c563fc9969a85d8b9 /src
parent4e5396ec75a98463a91ed99523ae76ccb247bdd2 (diff)
Widget: Fixed arranging where widgets uncollapse
Diffstat (limited to 'src')
-rw-r--r--src/ui/widget.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/ui/widget.c b/src/ui/widget.c
index beec8f0e..cfd119cb 100644
--- a/src/ui/widget.c
+++ b/src/ui/widget.c
@@ -242,6 +242,7 @@ void arrange_Widget(iWidget *d) {
242 const iInt2 dirs = init_I2((d->flags & resizeWidthOfChildren_WidgetFlag) != 0, 242 const iInt2 dirs = init_I2((d->flags & resizeWidthOfChildren_WidgetFlag) != 0,
243 (d->flags & resizeHeightOfChildren_WidgetFlag) != 0); 243 (d->flags & resizeHeightOfChildren_WidgetFlag) != 0);
244 /* Collapse hidden children. */ 244 /* Collapse hidden children. */
245 iBool uncollapsed = iFalse;
245 iForEach(ObjectList, c, d->children) { 246 iForEach(ObjectList, c, d->children) {
246 iWidget *child = as_Widget(c.object); 247 iWidget *child = as_Widget(c.object);
247 if (isCollapsed_Widget_(child)) { 248 if (isCollapsed_Widget_(child)) {
@@ -256,10 +257,15 @@ void arrange_Widget(iWidget *d) {
256 setFlags_Widget(child, wasCollapsed_WidgetFlag, iFalse); 257 setFlags_Widget(child, wasCollapsed_WidgetFlag, iFalse);
257 /* Undo collapse and determine the normal size again. */ 258 /* Undo collapse and determine the normal size again. */
258 if (child->flags & arrangeSize_WidgetFlag) { 259 if (child->flags & arrangeSize_WidgetFlag) {
259 arrange_Widget(child); 260 arrange_Widget(d);
261 uncollapsed = iTrue;
260 } 262 }
261 } 263 }
262 } 264 }
265 if (uncollapsed) {
266 arrange_Widget(d); /* Redo with the next child sizes. */
267 return;
268 }
263 const int expCount = numExpandingChildren_Widget_(d); 269 const int expCount = numExpandingChildren_Widget_(d);
264 /* Only resize the expanding children, not touching the others. */ 270 /* Only resize the expanding children, not touching the others. */
265 if (expCount > 0) { 271 if (expCount > 0) {