summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/app.c1
-rw-r--r--src/ui/certimportwidget.c2
-rw-r--r--src/ui/sidebarwidget.c25
-rw-r--r--src/ui/util.c4
-rw-r--r--src/ui/widget.c7
-rw-r--r--src/ui/widget.h1
6 files changed, 23 insertions, 17 deletions
diff --git a/src/app.c b/src/app.c
index 3107cda3..11c79bcb 100644
--- a/src/app.c
+++ b/src/app.c
@@ -2103,6 +2103,7 @@ iBool handleCommand_App(const char *cmd) {
2103 iCertImportWidget *imp = new_CertImportWidget(); 2103 iCertImportWidget *imp = new_CertImportWidget();
2104 setPageContent_CertImportWidget(imp, sourceContent_DocumentWidget(document_App())); 2104 setPageContent_CertImportWidget(imp, sourceContent_DocumentWidget(document_App()));
2105 addChild_Widget(d->window->root, iClob(imp)); 2105 addChild_Widget(d->window->root, iClob(imp));
2106 finalizeSheet_Widget(as_Widget(imp));
2106 postRefresh_App(); 2107 postRefresh_App();
2107 return iTrue; 2108 return iTrue;
2108 } 2109 }
diff --git a/src/ui/certimportwidget.c b/src/ui/certimportwidget.c
index dd800dd2..3a037135 100644
--- a/src/ui/certimportwidget.c
+++ b/src/ui/certimportwidget.c
@@ -167,7 +167,7 @@ void init_CertImportWidget(iCertImportWidget *d) {
167 "certimport.accept" } }, 167 "certimport.accept" } },
168 2); 168 2);
169 addChild_Widget(w, iClob(buttons)); 169 addChild_Widget(w, iClob(buttons));
170 arrange_Widget(w); 170// arrange_Widget(w);
171 if (deviceType_App() != desktop_AppDeviceType) { 171 if (deviceType_App() != desktop_AppDeviceType) {
172 /* Try auto-pasting. */ 172 /* Try auto-pasting. */
173 postCommand_App("certimport.paste"); 173 postCommand_App("certimport.paste");
diff --git a/src/ui/sidebarwidget.c b/src/ui/sidebarwidget.c
index 4d1cb3b0..cb084ccc 100644
--- a/src/ui/sidebarwidget.c
+++ b/src/ui/sidebarwidget.c
@@ -627,23 +627,17 @@ void init_SidebarWidget(iSidebarWidget *d, enum iSidebarSide side) {
627 addChild_Widget(content, iClob(listAndActions)); 627 addChild_Widget(content, iClob(listAndActions));
628 d->list = new_ListWidget(); 628 d->list = new_ListWidget();
629 setPadding_Widget(as_Widget(d->list), 0, gap_UI, 0, gap_UI); 629 setPadding_Widget(as_Widget(d->list), 0, gap_UI, 0, gap_UI);
630 if (!isPhone) { 630 addChildFlags_Widget(listAndActions,
631 addChildFlags_Widget(listAndActions, 631 iClob(d->list),
632 iClob(d->list), 632 expand_WidgetFlag | drawBackgroundToHorizontalSafeArea_WidgetFlag);
633 expand_WidgetFlag | drawBackgroundToHorizontalSafeArea_WidgetFlag); 633 setId_Widget(addChildPosFlags_Widget(listAndActions,
634 } 634 iClob(d->actions = new_Widget()),
635 setId_Widget(addChildFlags_Widget(listAndActions, 635 isPhone ? front_WidgetAddPos : back_WidgetAddPos,
636 iClob(d->actions = new_Widget()), 636 arrangeHorizontal_WidgetFlag | arrangeHeight_WidgetFlag |
637 arrangeHorizontal_WidgetFlag | arrangeHeight_WidgetFlag | 637 resizeWidthOfChildren_WidgetFlag |
638 resizeWidthOfChildren_WidgetFlag | 638 drawBackgroundToHorizontalSafeArea_WidgetFlag),
639 drawBackgroundToHorizontalSafeArea_WidgetFlag),
640 "actions"); 639 "actions");
641 setBackgroundColor_Widget(d->actions, uiBackgroundSidebar_ColorId); 640 setBackgroundColor_Widget(d->actions, uiBackgroundSidebar_ColorId);
642 if (isPhone) {
643 addChildFlags_Widget(listAndActions,
644 iClob(d->list),
645 expand_WidgetFlag | drawBackgroundToHorizontalSafeArea_WidgetFlag);
646 }
647 d->contextItem = NULL; 641 d->contextItem = NULL;
648 d->blank = new_Widget(); 642 d->blank = new_Widget();
649 addChildFlags_Widget(content, iClob(d->blank), resizeChildren_WidgetFlag); 643 addChildFlags_Widget(content, iClob(d->blank), resizeChildren_WidgetFlag);
@@ -669,7 +663,6 @@ void init_SidebarWidget(iSidebarWidget *d, enum iSidebarSide side) {
669 if (side == left_SideBarSide) { 663 if (side == left_SideBarSide) {
670 postCommand_App("~sidebar.update"); /* unread count */ 664 postCommand_App("~sidebar.update"); /* unread count */
671 } 665 }
672 printTree_Widget(as_Widget(d));
673} 666}
674 667
675void deinit_SidebarWidget(iSidebarWidget *d) { 668void deinit_SidebarWidget(iSidebarWidget *d) {
diff --git a/src/ui/util.c b/src/ui/util.c
index 6fa3e293..f430ac1c 100644
--- a/src/ui/util.c
+++ b/src/ui/util.c
@@ -1138,6 +1138,9 @@ static iAnyObject *addPanelChild_(iWidget *panel, iAnyObject *child, int64_t fla
1138 precedingElementType != heading_PrefsElement) || 1138 precedingElementType != heading_PrefsElement) ||
1139 (elementType == dropdown_PrefsElement && 1139 (elementType == dropdown_PrefsElement &&
1140 precedingElementType != dropdown_PrefsElement && 1140 precedingElementType != dropdown_PrefsElement &&
1141 precedingElementType != heading_PrefsElement) ||
1142 (elementType == textInput_PrefsElement &&
1143 precedingElementType != textInput_PrefsElement &&
1141 precedingElementType != heading_PrefsElement)) { 1144 precedingElementType != heading_PrefsElement)) {
1142 addChild_Widget(panel, iClob(makePadding_Widget(lineHeight_Text(defaultBig_FontId)))); 1145 addChild_Widget(panel, iClob(makePadding_Widget(lineHeight_Text(defaultBig_FontId))));
1143 } 1146 }
@@ -1552,6 +1555,7 @@ void finalizeSheet_Widget(iWidget *sheet) {
1552 resizeToParentWidth_WidgetFlag | arrangeVertical_WidgetFlag); 1555 resizeToParentWidth_WidgetFlag | arrangeVertical_WidgetFlag);
1553 } 1556 }
1554 updateSheetPanelMetrics_(sheet); 1557 updateSheetPanelMetrics_(sheet);
1558 iAssert(sheet->parent);
1555 arrange_Widget(sheet->parent); 1559 arrange_Widget(sheet->parent);
1556 postCommand_App("widget.overflow"); /* with the correct dimensions */ 1560 postCommand_App("widget.overflow"); /* with the correct dimensions */
1557// printTree_Widget(sheet); 1561// printTree_Widget(sheet);
diff --git a/src/ui/widget.c b/src/ui/widget.c
index 78a8a8bf..da7efb57 100644
--- a/src/ui/widget.c
+++ b/src/ui/widget.c
@@ -1130,6 +1130,10 @@ iAny *addChild_Widget(iWidget *d, iAnyObject *child) {
1130} 1130}
1131 1131
1132iAny *addChildPos_Widget(iWidget *d, iAnyObject *child, enum iWidgetAddPos addPos) { 1132iAny *addChildPos_Widget(iWidget *d, iAnyObject *child, enum iWidgetAddPos addPos) {
1133 return addChildPosFlags_Widget(d, child, addPos, 0);
1134}
1135
1136iAny *addChildPosFlags_Widget(iWidget *d, iAnyObject *child, enum iWidgetAddPos addPos, int64_t flags) {
1133 iAssert(child); 1137 iAssert(child);
1134 iAssert(d != child); 1138 iAssert(d != child);
1135 iWidget *widget = as_Widget(child); 1139 iWidget *widget = as_Widget(child);
@@ -1144,6 +1148,9 @@ iAny *addChildPos_Widget(iWidget *d, iAnyObject *child, enum iWidgetAddPos addPo
1144 pushFront_ObjectList(d->children, widget); /* ref */ 1148 pushFront_ObjectList(d->children, widget); /* ref */
1145 } 1149 }
1146 widget->parent = d; 1150 widget->parent = d;
1151 if (flags) {
1152 setFlags_Widget(child, flags, iTrue);
1153 }
1147 return child; 1154 return child;
1148} 1155}
1149 1156
diff --git a/src/ui/widget.h b/src/ui/widget.h
index 2116e0d8..64e502e6 100644
--- a/src/ui/widget.h
+++ b/src/ui/widget.h
@@ -235,6 +235,7 @@ void setFrameColor_Widget (iWidget *, int frameColor);
235void setCommandHandler_Widget (iWidget *, iBool (*handler)(iWidget *, const char *)); 235void setCommandHandler_Widget (iWidget *, iBool (*handler)(iWidget *, const char *));
236iAny * addChild_Widget (iWidget *, iAnyObject *child); /* holds a ref */ 236iAny * addChild_Widget (iWidget *, iAnyObject *child); /* holds a ref */
237iAny * addChildPos_Widget (iWidget *, iAnyObject *child, enum iWidgetAddPos addPos); 237iAny * addChildPos_Widget (iWidget *, iAnyObject *child, enum iWidgetAddPos addPos);
238iAny * addChildPosFlags_Widget (iWidget *, iAnyObject *child, enum iWidgetAddPos addPos, int64_t childFlags);
238iAny * addChildFlags_Widget (iWidget *, iAnyObject *child, int64_t childFlags); /* holds a ref */ 239iAny * addChildFlags_Widget (iWidget *, iAnyObject *child, int64_t childFlags); /* holds a ref */
239iAny * insertChildAfter_Widget (iWidget *, iAnyObject *child, size_t afterIndex); 240iAny * insertChildAfter_Widget (iWidget *, iAnyObject *child, size_t afterIndex);
240iAny * insertChildAfterFlags_Widget(iWidget *, iAnyObject *child, size_t afterIndex, int64_t childFlags); 241iAny * insertChildAfterFlags_Widget(iWidget *, iAnyObject *child, size_t afterIndex, int64_t childFlags);