summaryrefslogtreecommitdiff
path: root/src/ui/widget.c
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-09-11 07:43:57 +0300
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-09-11 07:43:57 +0300
commit1410bbde7779efe3a20f603523547c8b8f55b6a1 (patch)
tree54e8ab43ea6d3dc35d7993b6909096c6c8429e50 /src/ui/widget.c
parent61c23be799956615ceeeda10aaeccc2bb11e9c94 (diff)
Mobile: Many UI improvements; Upload UI
Diffstat (limited to 'src/ui/widget.c')
-rw-r--r--src/ui/widget.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ui/widget.c b/src/ui/widget.c
index 4fd8f066..659a00cc 100644
--- a/src/ui/widget.c
+++ b/src/ui/widget.c
@@ -452,7 +452,7 @@ static void arrange_Widget_(iWidget *d) {
452 else if (d->flags & centerHorizontal_WidgetFlag) { 452 else if (d->flags & centerHorizontal_WidgetFlag) {
453 centerHorizontal_Widget_(d); 453 centerHorizontal_Widget_(d);
454 } 454 }
455 if (d->flags & resizeToParentWidth_WidgetFlag) { 455 if (d->flags & resizeToParentWidth_WidgetFlag && d->parent) {
456 iRect childBounds = zero_Rect(); 456 iRect childBounds = zero_Rect();
457 if (flags_Widget(d->parent) & arrangeWidth_WidgetFlag) { 457 if (flags_Widget(d->parent) & arrangeWidth_WidgetFlag) {
458 /* Can't go narrower than what the children require, though. */ 458 /* Can't go narrower than what the children require, though. */
@@ -462,7 +462,7 @@ static void arrange_Widget_(iWidget *d) {
462 setWidth_Widget_(d, iMaxi(width_Rect(innerRect_Widget_(d->parent)), 462 setWidth_Widget_(d, iMaxi(width_Rect(innerRect_Widget_(d->parent)),
463 width_Rect(childBounds))); 463 width_Rect(childBounds)));
464 } 464 }
465 if (d->flags & resizeToParentHeight_WidgetFlag) { 465 if (d->flags & resizeToParentHeight_WidgetFlag && d->parent) {
466 TRACE(d, "resize to parent height"); 466 TRACE(d, "resize to parent height");
467 setHeight_Widget_(d, height_Rect(innerRect_Widget_(d->parent))); 467 setHeight_Widget_(d, height_Rect(innerRect_Widget_(d->parent)));
468 } 468 }