summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-05-16 21:35:33 +0300
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-05-16 21:35:33 +0300
commit0d983d9445af3f1ecee83dc8a19615a14003e1c6 (patch)
tree91c5fac1c162c5584d50b338c464c391c35edaf5
parent97f9a1c9bf49ca67fe1f99c57aa70e0bdf64a466 (diff)
Widget: Fixed arrangement resetting
The expand flag should be reset only in the context of the parent's arrangement/resize direction.
-rw-r--r--src/ui/mobile.c2
-rw-r--r--src/ui/sidebarwidget.c8
-rw-r--r--src/ui/widget.c9
3 files changed, 10 insertions, 9 deletions
diff --git a/src/ui/mobile.c b/src/ui/mobile.c
index f93d4352..ae503f77 100644
--- a/src/ui/mobile.c
+++ b/src/ui/mobile.c
@@ -657,8 +657,6 @@ void finalizeSheet_Mobile(iWidget *sheet) {
657 iAssert(sheet->parent); 657 iAssert(sheet->parent);
658 arrange_Widget(sheet->parent); 658 arrange_Widget(sheet->parent);
659 postCommand_App("widget.overflow"); /* with the correct dimensions */ 659 postCommand_App("widget.overflow"); /* with the correct dimensions */
660 //puts("---- MOBILE LAYOUT ----");
661 //printTree_Widget(sheet);
662 } 660 }
663 else { 661 else {
664 arrange_Widget(sheet); 662 arrange_Widget(sheet);
diff --git a/src/ui/sidebarwidget.c b/src/ui/sidebarwidget.c
index 6ae611b9..9f8eac19 100644
--- a/src/ui/sidebarwidget.c
+++ b/src/ui/sidebarwidget.c
@@ -522,11 +522,11 @@ float width_SidebarWidget(const iSidebarWidget *d) {
522} 522}
523 523
524static const char *normalModeLabels_[max_SidebarMode] = { 524static const char *normalModeLabels_[max_SidebarMode] = {
525 book_Icon " ${sidebar.bookmarks}", 525 book_Icon " ${sidebar.bookmarks}",
526 star_Icon " ${sidebar.feeds}", 526 star_Icon " ${sidebar.feeds}",
527 clock_Icon " ${sidebar.history}", 527 clock_Icon " ${sidebar.history}",
528 person_Icon " ${sidebar.identities}", 528 person_Icon " ${sidebar.identities}",
529 page_Icon " ${sidebar.outline}", 529 page_Icon " ${sidebar.outline}",
530}; 530};
531 531
532static const char *tightModeLabels_[max_SidebarMode] = { 532static const char *tightModeLabels_[max_SidebarMode] = {
diff --git a/src/ui/widget.c b/src/ui/widget.c
index 23c701e4..475e7c1f 100644
--- a/src/ui/widget.c
+++ b/src/ui/widget.c
@@ -725,12 +725,15 @@ static void resetArrangement_Widget_(iWidget *d) {
725 if (d->flags & arrangeHorizontal_WidgetFlag) { 725 if (d->flags & arrangeHorizontal_WidgetFlag) {
726 child->rect.pos.x = 0; 726 child->rect.pos.x = 0;
727 } 727 }
728 if (d->flags & resizeWidthOfChildren_WidgetFlag && child->flags & expand_WidgetFlag) {
729 child->rect.size.x = 0;
730 }
728 if (d->flags & arrangeVertical_WidgetFlag) { 731 if (d->flags & arrangeVertical_WidgetFlag) {
729 child->rect.pos.y = 0; 732 child->rect.pos.y = 0;
730 } 733 }
731 } 734 if (d->flags & resizeHeightOfChildren_WidgetFlag && child->flags & expand_WidgetFlag) {
732 if (child->flags & expand_WidgetFlag) { 735 child->rect.size.y = 0;
733 child->rect = zero_Rect(); 736 }
734 } 737 }
735 } 738 }
736} 739}