diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-05-14 12:06:55 +0300 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-05-14 12:06:55 +0300 |
commit | 52cb02415da32d1d378cafb6f475f85e9491b0b0 (patch) | |
tree | 5a48735f7b2a31c5c76ed91070a1040dee06c793 /src/ui | |
parent | 79f02ba0448c559e37539ece389aea8ec7e5a173 (diff) |
Widget: Fixed layout issue
Reset sequential arrangements so the previous child bounds don't affect a newly calculated arrangement.
Diffstat (limited to 'src/ui')
-rw-r--r-- | src/ui/widget.c | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/src/ui/widget.c b/src/ui/widget.c index 18f98050..4749de23 100644 --- a/src/ui/widget.c +++ b/src/ui/widget.c | |||
@@ -699,25 +699,23 @@ static void arrange_Widget_(iWidget *d) { | |||
699 | TRACE(d, "END"); | 699 | TRACE(d, "END"); |
700 | } | 700 | } |
701 | 701 | ||
702 | #if 0 | 702 | static void resetArrangement_Widget_(iWidget *d) { |
703 | void resetSize_Widget(iWidget *d) { | ||
704 | if (~d->flags & fixedWidth_WidgetFlag) { | ||
705 | d->rect.size.x = d->minSize.x; | ||
706 | } | ||
707 | if (~d->flags & fixedHeight_WidgetFlag) { | ||
708 | d->rect.size.y = d->minSize.y; | ||
709 | } | ||
710 | iForEach(ObjectList, i, children_Widget(d)) { | 703 | iForEach(ObjectList, i, children_Widget(d)) { |
711 | iWidget *child = as_Widget(i.object); | 704 | iWidget *child = as_Widget(i.object); |
712 | if (isArrangedSize_Widget_(child)) { | 705 | resetArrangement_Widget_(child); |
713 | resetSize_Widget(child); | 706 | if (isArrangedPos_Widget_(child)) { |
707 | if (d->flags & arrangeHorizontal_WidgetFlag) { | ||
708 | child->rect.pos.x = 0; | ||
709 | } | ||
710 | if (d->flags & arrangeVertical_WidgetFlag) { | ||
711 | child->rect.pos.y = 0; | ||
712 | } | ||
714 | } | 713 | } |
715 | } | 714 | } |
716 | } | 715 | } |
717 | #endif | ||
718 | 716 | ||
719 | void arrange_Widget(iWidget *d) { | 717 | void arrange_Widget(iWidget *d) { |
720 | //resetSize_Widget_(d); /* back to initial default sizes */ | 718 | resetArrangement_Widget_(d); /* back to initial default sizes */ |
721 | arrange_Widget_(d); | 719 | arrange_Widget_(d); |
722 | } | 720 | } |
723 | 721 | ||