=> a2a1af76f9414f93cafd48a9b8bc6b49883f51f5
[1mdiff --git a/src/ui/root.c b/src/ui/root.c[m [1mindex da90a796..25bf9618 100644[m [1m--- a/src/ui/root.c[m [1m+++ b/src/ui/root.c[m [36m@@ -241,7 +241,8 @@[m [mstatic int loadAnimIndex_ = 0;[m static iRoot * activeRoot_ = NULL;[m [m static void setupMovableElements_Root_ (iRoot *);[m [31m-static void setBottomBarPosition_ (iWidget *bottomBar, iBool show, iBool animate);[m [32m+[m[32mstatic void updateNavBarSize_ (iWidget *navBar);[m [32m+[m[32mstatic void updateBottomBarPosition_ (iWidget *bottomBar, iBool animate);[m [m iDefineTypeConstruction(Root)[m iDefineAudienceGetter(Root, visualOffsetsChanged)[m [36m@@ -535,7 +536,7 @@[m [mstatic iBool handleRootCommands_(iWidget *root, const char *cmd) {[m setFixedSize_Widget(as_Widget(sidebar), init_I2(-1, midHeight));[m setPos_Widget(as_Widget(sidebar), init_I2(0, height_Widget(root) - midHeight));[m }[m [31m- showToolbar_Root(root->root, isPortrait_App() || prefs_App()->bottomNavBar);[m [32m+[m[32m postCommandf_Root(root->root, "toolbar.show arg:%d", isPortrait_App() || prefs_App()->bottomNavBar);[m return iFalse;[m }[m else if (equal_Command(cmd, "root.arrange")) {[m [36m@@ -543,6 +544,9 @@[m [mstatic iBool handleRootCommands_(iWidget *root, const char *cmd) {[m if (prefs) {[m updatePreferencesLayout_Widget(prefs);[m }[m [32m+[m[32m// if (deviceType_App() == phone_AppDeviceType) {[m [32m+[m[32m// updateBottomBarPosition_(findWidget_Root("bottombar"), iFalse);[m [32m+[m[32m// }[m root->root->pendingArrange = iFalse;[m return iTrue;[m }[m [36m@@ -552,7 +556,7 @@[m [mstatic iBool handleRootCommands_(iWidget *root, const char *cmd) {[m iWidget *bottomBar = findChild_Widget(root, "bottombar");[m if (bottomBar) {[m /* Update bottom bar height and position. */[m [31m- setBottomBarPosition_(bottomBar, isVisible_Widget(bottomBar), iFalse);[m [32m+[m[32m updateBottomBarPosition_(bottomBar, iFalse);[m updateToolbarColors_Root(root->root);[m }[m return iFalse; /* all roots must handle this */[m [36m@@ -891,6 +895,8 @@[m [mstatic void updateNavBarActions_(iWidget *navBar) {[m static iBool handleNavBarCommands_(iWidget *navBar, const char *cmd) {[m if (equal_Command(cmd, "window.resized") || equal_Command(cmd, "metrics.changed")) {[m updateNavBarSize_(navBar);[m [32m+[m[32m //arrange_Widget(root_Widget(navBar));[m [32m+[m[32m //updateBottomBarPosition_(findWidget_Root("bottombar"), iFalse);[m return iFalse;[m }[m else if (equal_Command(cmd, "window.reload.update")) {[m [36m@@ -1197,6 +1203,10 @@[m [mstatic iBool handleToolBarCommands_(iWidget *toolBar, const char *cmd) {[m openMenu_Widget(menu, innerToWindow_Widget(menu, init_I2(0, -height_Widget(menu))));[m return iTrue;[m }[m [32m+[m[32m else if (equal_Command(cmd, "toolbar.show")) {[m [32m+[m[32m showToolbar_Root(toolBar->root, arg_Command(cmd));[m [32m+[m[32m return iTrue;[m [32m+[m[32m }[m else if (equal_Command(cmd, "toolbar.showview")) {[m if (arg_Command(cmd) >= 0) {[m postCommandf_App("sidebar.mode arg:%d show:1", arg_Command(cmd));[m [36m@@ -1310,6 +1320,9 @@[m [mvoid updateMetrics_Root(iRoot *d) {[m setFixedSize_Widget(as_Widget(idName),[m init_I2(-1, 2 * gap_UI + lineHeight_Text(uiLabelTiny_FontId)));[m }[m [32m+[m[32m if (bottomBar) {[m [32m+[m[32m updateBottomBarPosition_(bottomBar, iFalse);[m [32m+[m[32m }[m postRefresh_App();[m }[m [m [36m@@ -1833,10 +1846,10 @@[m [mvoid createUserInterface_Root(iRoot *d) {[m }[m updateMetrics_Root(d);[m updateNavBarSize_(navBar);[m [31m- if (deviceType_App() == phone_AppDeviceType) {[m [32m+[m[32m if (isLandscapePhone_App()) {[m const float sidebarWidth = width_Widget(root) / (float) gap_UI;[m setWidth_SidebarWidget(findChild_Widget(root, "sidebar"), sidebarWidth);[m [31m- setWidth_SidebarWidget(findChild_Widget(root, "sidebar2"), sidebarWidth);[m [32m+[m[32m //setWidth_SidebarWidget(findChild_Widget(root, "sidebar2"), sidebarWidth);[m }[m }[m [m [36m@@ -1897,19 +1910,22 @@[m [mstatic void setupMovableElements_Root_(iRoot *d) {[m postCommand_App("window.resized"); /* not really, but some widgets will update their layout */[m }[m [m [31m-static void setBottomBarPosition_(iWidget *bottomBar, iBool show, iBool animate) {[m [32m+[m[32mstatic void updateBottomBarPosition_(iWidget *bottomBar, iBool animate) {[m if (deviceType_App() != phone_AppDeviceType) {[m return;[m }[m [31m- const iPrefs *prefs = prefs_App();[m [31m- float bottomSafe = 0.0f;[m [31m- iWidget *tabBar = NULL;[m [31m- iRoot *root = bottomBar->root;[m [31m- iWidget *docTabs = findChild_Widget(root->widget, "doctabs");[m [31m- iWidget *toolBar = findChild_Widget(bottomBar, "toolbar");[m [31m- iWidget *navBar = findChild_Widget(root->widget, "navbar");[m [31m- size_t numPages = 0;[m [31m- iBool bottomTabBar = prefs->bottomTabBar;[m [32m+[m[32m if (focus_Widget() && isInstance_Object(focus_Widget(), &Class_InputWidget)) {[m [32m+[m[32m return;[m [32m+[m[32m }[m [32m+[m[32m const iPrefs *prefs = prefs_App();[m [32m+[m[32m float bottomSafe = 0.0f;[m [32m+[m[32m iWidget *tabBar = NULL;[m [32m+[m[32m iRoot *root = bottomBar->root;[m [32m+[m[32m iWidget *docTabs = findChild_Widget(root->widget, "doctabs");[m [32m+[m[32m iWidget *toolBar = findChild_Widget(bottomBar, "toolbar");[m [32m+[m[32m iWidget *navBar = findChild_Widget(root->widget, "navbar");[m [32m+[m[32m size_t numPages = 0;[m [32m+[m[32m iBool bottomTabBar = prefs->bottomTabBar;[m if (prefs->bottomTabBar || prefs->bottomNavBar) {[m tabBar = findChild_Widget(docTabs, "tabs.buttons");[m numPages = tabCount_Widget(docTabs);[m [36m@@ -1925,17 +1941,14 @@[m [mstatic void setBottomBarPosition_(iWidget *bottomBar, iBool show, iBool animate)[m }[m }[m #endif[m [31m- showCollapsed_Widget(toolBar, isPortrait_App());[m [31m- const int height = height_Widget(bottomBar);[m [31m- if (show) {[m [31m- if (flags_Widget(bottomBar) & hidden_WidgetFlag) {[m [31m- setFlags_Widget(bottomBar, hidden_WidgetFlag, iFalse);[m [31m- setVisualOffset_Widget(bottomBar, 0, 200 * animate, easeOut_AnimFlag);[m [31m- if (isPortraitPhone_App()) {[m [31m- setVisualOffset_Widget(toolBar, 0, 200 * animate, 0);[m [31m- }[m [31m- setVisualOffset_Widget(navBar, 0, 200 * animate, 0);[m [31m- }[m [32m+[m[32m const int height = height_Widget(bottomBar);[m [32m+[m[32m const iBool shown = ~flags_Widget(bottomBar) & hidden_WidgetFlag;[m [32m+[m[32m if (shown) {[m [32m+[m[32m setVisualOffset_Widget(bottomBar, 0, 200 * animate, easeOut_AnimFlag);[m [32m+[m[32m if (isPortraitPhone_App()) {[m [32m+[m[32m setVisualOffset_Widget(toolBar, 0, 200 * animate, 0);[m [32m+[m[32m }[m [32m+[m[32m setVisualOffset_Widget(navBar, 0, 200 * animate, 0);[m if (bottomTabBar) {[m /* Tab bar needs to stay visible, too. */[m if (prefs->bottomNavBar || isPortrait_App()) {[m [36m@@ -1944,17 +1957,11 @@[m [mstatic void setBottomBarPosition_(iWidget *bottomBar, iBool show, iBool animate)[m else {[m setVisualOffset_Widget(tabBar, -bottomSafe, 200 * animate, easeOut_AnimFlag);[m }[m [31m- //tabBar->flags2 |= permanentVisualOffset_WidgetFlag2;[m }[m }[m else {[m [31m- if (~flags_Widget(bottomBar) & hidden_WidgetFlag) {[m [31m- setFlags_Widget(bottomBar, hidden_WidgetFlag, iTrue);[m [31m- /* Close any menus that open via the toolbar. */[m [31m- closeMenu_Widget(findChild_Widget(findWidget_App("toolbar.navmenu"), "menu"));[m [31m- closeMenu_Widget(findChild_Widget(bottomBar, "toolbar.menu"));[m [31m- setVisualOffset_Widget(bottomBar, height - bottomSafe, 200 * animate, easeOut_AnimFlag);[m [31m- }[m [32m+[m[32m /* Close any menus that open via the toolbar. */[m [32m+[m[32m setVisualOffset_Widget(bottomBar, height - bottomSafe, 200 * animate, easeOut_AnimFlag);[m if (bottomTabBar) {[m if (isPortraitPhone_App()) {[m setVisualOffset_Widget(toolBar, bottomSafe, 200 * animate, 0);[m [36m@@ -1963,7 +1970,6 @@[m [mstatic void setBottomBarPosition_(iWidget *bottomBar, iBool show, iBool animate)[m setVisualOffset_Widget(navBar, bottomSafe, 200 * animate, 0);[m }[m setVisualOffset_Widget(tabBar, -bottomSafe, 200 * animate, easeOut_AnimFlag);[m [31m- //tabBar->flags2 |= hiddenWithVisualOffset_WidgetFlag2;[m }[m }[m }[m [36m@@ -1971,17 +1977,22 @@[m [mstatic void setBottomBarPosition_(iWidget *bottomBar, iBool show, iBool animate)[m void showToolbar_Root(iRoot *d, iBool show) {[m iWidget *bottomBar = findChild_Widget(d->widget, "bottombar");[m if (!bottomBar) return;[m [32m+[m[32m if (focus_Widget() && isInstance_Object(focus_Widget(), &Class_InputWidget)) {[m [32m+[m[32m /* Don't move anything while text input is active. */[m [32m+[m[32m return;[m [32m+[m[32m }[m const iPrefs *prefs = prefs_App();[m /* The toolbar is only used in the portrait phone layout, but the bottom bar may have other[m elements regardless. The toolbar is needed for clearing the bottom safe area when there[m is a bottom tab bar, even if the URL is at the top. Note that the entire bottom bar may[m be hidden, but the tab bar remains always visible if there are tabs open. */[m if (isLandscape_App() && !prefs->bottomTabBar && !prefs->bottomNavBar) {[m [31m- //setFlags_Widget(bottomBar, hidden_WidgetFlag, iTrue);[m [31m- setBottomBarPosition_(bottomBar, iFalse, iTrue);[m [31m- return;[m [32m+[m[32m// setFlags_Widget(bottomBar, hidden_WidgetFlag, iTrue);[m [32m+[m[32m show = iFalse;[m [32m+[m[32m// setBottomBarPosition_(bottomBar, iFalse, iTrue);[m [32m+[m[32m// return;[m }[m [31m-// iWidget *toolBar = findChild_Widget(bottomBar, "toolbar");[m [32m+[m[32m iWidget *toolBar = findChild_Widget(bottomBar, "toolbar");[m // iWidget *navBar = findChild_Widget(d->widget, "navbar");[m // const int height = size_Root(d).y - top_Rect(boundsWithoutVisualOffset_Widget(bottomBar));[m // float bottomSafe = 0;[m [36m@@ -1999,7 +2010,19 @@[m [mvoid showToolbar_Root(iRoot *d, iBool show) {[m // }[m // }[m //#endif[m [31m- setBottomBarPosition_(bottomBar, show, iTrue);[m [32m+[m[32m if (show) {[m [32m+[m[32m setFlags_Widget(bottomBar, hidden_WidgetFlag, iFalse);[m [32m+[m[32m }[m [32m+[m[32m else {[m [32m+[m[32m if (~flags_Widget(bottomBar) & hidden_WidgetFlag) {[m [32m+[m[32m closeMenu_Widget(findChild_Widget(findWidget_App("toolbar.navmenu"), "menu"));[m [32m+[m[32m closeMenu_Widget(findChild_Widget(bottomBar, "toolbar.menu"));[m [32m+[m[32m }[m [32m+[m[32m setFlags_Widget(bottomBar, hidden_WidgetFlag, iTrue);[m [32m+[m[32m }[m [32m+[m[32m /* The toolbar is only shown when in portrait mode, otherwise buttons are in the navbar. */[m [32m+[m[32m showCollapsed_Widget(toolBar, isPortrait_App());[m [32m+[m[32m updateBottomBarPosition_(bottomBar, iTrue);[m [m #if 0[m if (show && (!isVisible_Widget(bottomBar) || (isBottomTabBar && ~flags_Widget(tabBar) & dragged_WidgetFlag))) {[m [1mdiff --git a/src/ui/widget.c b/src/ui/widget.c[m [1mindex 632e3900..d7754a33 100644[m [1m--- a/src/ui/widget.c[m [1m+++ b/src/ui/widget.c[m [36m@@ -1508,10 +1508,10 @@[m [mvoid drawLayerEffects_Widget(const iWidget *d) {[m right = rootSize.x - right_Rect(rect);[m }[m }[m [32m+[m[32m if (top_Rect(rect) > center.y * 3 / 2) {[m [32m+[m[32m bottom = rootSize.y - bottom_Rect(rect);[m [32m+[m[32m }[m if (d->flags & drawBackgroundToVerticalSafeArea_WidgetFlag) {[m [31m- if (top_Rect(rect) > center.y * 3 / 2) {[m [31m- bottom = rootSize.y - bottom_Rect(rect);[m [31m- }[m if (bottom_Rect(rect) < center.y / 2) {[m top = -top_Rect(rect);[m }[m [36m@@ -1522,11 +1522,11 @@[m [mvoid drawLayerEffects_Widget(const iWidget *d) {[m }[m if (left < 0) {[m fillRect_Paint(&p, (iRect){ init_I2(0, top_Rect(rect)),[m [31m- init_I2(left_Rect(rect), rootSize.y) }, d->bgColor);[m [32m+[m[32m init_I2(left_Rect(rect), height_Rect(rect) + bottom) }, d->bgColor);[m }[m if (right > 0) {[m fillRect_Paint(&p, (iRect){ init_I2(right_Rect(rect), top_Rect(rect)),[m [31m- init_I2(right, rootSize.y) }, d->bgColor);[m [32m+[m[32m init_I2(right, height_Rect(rect) + bottom) }, d->bgColor);[m }[m }[m #endif[m
text/gemini; charset=utf-8
This content has been proxied by September (ba2dc).