summaryrefslogtreecommitdiff
path: root/src/ui/root.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/root.c')
-rw-r--r--src/ui/root.c26
1 files changed, 9 insertions, 17 deletions
diff --git a/src/ui/root.c b/src/ui/root.c
index 5ec63e91..d5148056 100644
--- a/src/ui/root.c
+++ b/src/ui/root.c
@@ -650,10 +650,10 @@ static void checkLoadAnimation_Root_(iRoot *d) {
650 650
651void updatePadding_Root(iRoot *d) { 651void updatePadding_Root(iRoot *d) {
652 if (d == NULL) return; 652 if (d == NULL) return;
653 iWidget *toolBar = findChild_Widget(d->widget, "toolbar");
654 float bottom = 0.0f;
655#if defined (iPlatformAppleMobile) 653#if defined (iPlatformAppleMobile)
654 iWidget *toolBar = findChild_Widget(d->widget, "toolbar");
656 float left, top, right; 655 float left, top, right;
656 float bottom = 0.0f;
657 safeAreaInsets_iOS(&left, &top, &right, &bottom); 657 safeAreaInsets_iOS(&left, &top, &right, &bottom);
658 /* Respect the safe area insets. */ { 658 /* Respect the safe area insets. */ {
659 setPadding_Widget(findChild_Widget(d->widget, "navdiv"), left, top, right, 0); 659 setPadding_Widget(findChild_Widget(d->widget, "navdiv"), left, top, right, 0);
@@ -662,15 +662,6 @@ void updatePadding_Root(iRoot *d) {
662 } 662 }
663 } 663 }
664#endif 664#endif
665// if (toolBar) {
666 /* TODO: get this from toolBar height, but it's buggy for some reason */
667// const int sidebarBottomPad = isPortrait_App() ? 11 * gap_UI + bottom : 0;
668// setPadding_Widget(findChild_Widget(d->widget, "sidebar"), 0, 0, 0, sidebarBottomPad);
669 //setPadding_Widget(findChild_Widget(d->widget, "sidebar2"), 0, 0, 0, sidebarBottomPad);
670 /* TODO: There seems to be unrelated layout glitch in the sidebar where its children
671 are not arranged correctly until it's hidden and reshown. */
672// }
673 /* Note that `handleNavBarCommands_` also adjusts padding and spacing. */
674} 665}
675 666
676void updateToolbarColors_Root(iRoot *d) { 667void updateToolbarColors_Root(iRoot *d) {
@@ -773,9 +764,8 @@ static void updateNavBarSize_(iWidget *navBar) {
773 const iBool isPhone = deviceType_App() == phone_AppDeviceType; 764 const iBool isPhone = deviceType_App() == phone_AppDeviceType;
774 const iBool isNarrow = !isPhone && isNarrow_Root(navBar->root); 765 const iBool isNarrow = !isPhone && isNarrow_Root(navBar->root);
775 /* Adjust navbar padding. */ { 766 /* Adjust navbar padding. */ {
776 int hPad = isPhone && isPortrait_App() ? 0 : (isPhone || isNarrow) ? gap_UI / 2 767 int hPad = isPortraitPhone_App() ? 0 : isPhone || isNarrow ? gap_UI / 2 : (gap_UI * 3 / 2);
777 : gap_UI * 3 / 2; 768 int vPad = gap_UI * 3 / 2;
778 int vPad = gap_UI * 3 / 2;
779 int topPad = !findWidget_Root("winbar") ? gap_UI / 2 : 0; 769 int topPad = !findWidget_Root("winbar") ? gap_UI / 2 : 0;
780 setPadding_Widget(navBar, hPad, vPad / 3 + topPad, hPad, vPad / 2); 770 setPadding_Widget(navBar, hPad, vPad / 3 + topPad, hPad, vPad / 2);
781 } 771 }
@@ -1162,7 +1152,7 @@ void updateMetrics_Root(iRoot *d) {
1162 iWidget *urlButtons = findChild_Widget(navBar, "url.buttons"); 1152 iWidget *urlButtons = findChild_Widget(navBar, "url.buttons");
1163 iLabelWidget *idName = findChild_Widget(d->widget, "toolbar.name"); 1153 iLabelWidget *idName = findChild_Widget(d->widget, "toolbar.name");
1164 setPadding_Widget(as_Widget(url), 0, gap_UI, 0, gap_UI); 1154 setPadding_Widget(as_Widget(url), 0, gap_UI, 0, gap_UI);
1165 navBar->rect.size.y = 0; /* recalculate height based on children (FIXME: shouldn't be needed) */ 1155// navBar->rect.size.y = 0; /* recalculate height based on children (FIXME: shouldn't be needed) */
1166 setFixedSize_Widget(embedPad, init_I2(width_Widget(urlButtons) + gap_UI / 2, 1)); 1156 setFixedSize_Widget(embedPad, init_I2(width_Widget(urlButtons) + gap_UI / 2, 1));
1167 rightEmbed->rect.pos.y = gap_UI; 1157 rightEmbed->rect.pos.y = gap_UI;
1168 updatePadding_Root(d); 1158 updatePadding_Root(d);
@@ -1403,13 +1393,15 @@ void createUserInterface_Root(iRoot *d) {
1403 setFont_LabelWidget(pageMenuButton, uiContentBold_FontId); 1393 setFont_LabelWidget(pageMenuButton, uiContentBold_FontId);
1404 setAlignVisually_LabelWidget(pageMenuButton, iTrue); 1394 setAlignVisually_LabelWidget(pageMenuButton, iTrue);
1405 addChildFlags_Widget(urlButtons, iClob(pageMenuButton), 1395 addChildFlags_Widget(urlButtons, iClob(pageMenuButton),
1406 embedFlags | tight_WidgetFlag | collapse_WidgetFlag); 1396 embedFlags | tight_WidgetFlag | collapse_WidgetFlag |
1397 resizeToParentHeight_WidgetFlag);
1407 updateSize_LabelWidget(pageMenuButton); 1398 updateSize_LabelWidget(pageMenuButton);
1408 } 1399 }
1409 /* Reload button. */ { 1400 /* Reload button. */ {
1410 iLabelWidget *reload = newIcon_LabelWidget(reloadCStr_, 0, 0, "navigate.reload"); 1401 iLabelWidget *reload = newIcon_LabelWidget(reloadCStr_, 0, 0, "navigate.reload");
1411 setId_Widget(as_Widget(reload), "reload"); 1402 setId_Widget(as_Widget(reload), "reload");
1412 addChildFlags_Widget(urlButtons, iClob(reload), embedFlags | collapse_WidgetFlag); 1403 addChildFlags_Widget(urlButtons, iClob(reload), embedFlags | collapse_WidgetFlag |
1404 resizeToParentHeight_WidgetFlag);
1413 updateSize_LabelWidget(reload); 1405 updateSize_LabelWidget(reload);
1414 } 1406 }
1415 addChildFlags_Widget(as_Widget(url), iClob(urlButtons), moveToParentRightEdge_WidgetFlag); 1407 addChildFlags_Widget(as_Widget(url), iClob(urlButtons), moveToParentRightEdge_WidgetFlag);