=> 1b716d38a4d7355ded5e495fcfb9a0e45e5fc83f
[1mdiff --git a/src/ui/inputwidget.c b/src/ui/inputwidget.c[m [1mindex 49918152..de09db47 100644[m [1m--- a/src/ui/inputwidget.c[m [1m+++ b/src/ui/inputwidget.c[m [36m@@ -2302,7 +2302,7 @@[m [mstatic iBool processEvent_InputWidget_(iInputWidget *d, const SDL_Event *ev) {[m else if (isCommand_UserEvent(ev, "keyboard.changed")) {[m const iBool isKeyboardVisible = (arg_Command(command_UserEvent(ev)) != 0);[m /* Scroll to keep widget visible when keyboard appears. */[m [31m- if (isFocused_Widget(d)) {[m [32m+[m[32m if (isFocused_Widget(d) && findOverflowScrollable_Widget(parent_Widget(d))) {[m if (isKeyboardVisible) {[m d->lastOverflowScrollTime = SDL_GetTicks();[m overflowScrollToKeepVisible_InputWidget_(d);[m [1mdiff --git a/src/ui/root.c b/src/ui/root.c[m [1mindex 9bbfe0d9..5d3e436d 100644[m [1m--- a/src/ui/root.c[m [1m+++ b/src/ui/root.c[m [36m@@ -1120,7 +1120,7 @@[m [mstatic iBool handleNavBarCommands_(iWidget *navBar, const char *cmd) {[m }[m else if (deviceType_App() == tablet_AppDeviceType && equal_Command(cmd, "keyboard.changed")) {[m const int keyboardHeight = arg_Command(cmd);[m [31m- if (focus_Widget() == findChild_Widget(navBar, "url")) {[m [32m+[m[32m if (focus_Widget() == findChild_Widget(navBar, "url") && prefs_App()->bottomNavBar) {[m setVisualOffset_Widget(navBar, -keyboardHeight + bottomSafeInset_Mobile(),[m 400, easeOut_AnimFlag | softer_AnimFlag);[m }[m [1mdiff --git a/src/ui/widget.c b/src/ui/widget.c[m [1mindex dbf992aa..d1e139e6 100644[m [1m--- a/src/ui/widget.c[m [1m+++ b/src/ui/widget.c[m [36m@@ -519,10 +519,10 @@[m [mstatic size_t numArrangedChildren_Widget_(const iWidget *d) {[m }[m [m static void centerHorizontal_Widget_(iWidget *d) {[m [31m- d->rect.pos.x = ((d->parent ? width_Rect(innerRect_Widget_(d->parent))[m [31m- : size_Root(d->root).x) -[m [31m- width_Rect(d->rect)) /[m [31m- 2;[m [32m+[m[32m const int width = width_Rect(d->rect);[m [32m+[m[32m const int containerWidth = d->parent ? width_Rect(innerRect_Widget_(d->parent))[m [32m+[m[32m : size_Root(d->root).x;[m [32m+[m[32m d->rect.pos.x = (containerWidth - width) / 2;[m TRACE(d, "center horizontally: %d", d->rect.pos.x);[m }[m [m [36m@@ -922,6 +922,28 @@[m [mstatic void notifySizeChanged_Widget_(iWidget *d) {[m }[m }[m [m [32m+[m[32mstatic void clampCenteredInRoot_Widget_(iWidget *d) {[m [32m+[m[32m /* When arranging, we don't yet know if centered widgets will end up outside the root[m [32m+[m[32m area, because the parent sizes and positions may change. */[m [32m+[m[32m if (d->flags & centerHorizontal_WidgetFlag) {[m [32m+[m[32m iRect rootRect = safeRect_Root(d->root);[m [32m+[m[32m iRect bounds = boundsWithoutVisualOffset_Widget(d);[m [32m+[m[32m if (width_Rect(bounds) <= width_Rect(rootRect)) {[m [32m+[m[32m int excess = left_Rect(rootRect) - left_Rect(bounds);[m [32m+[m[32m if (excess > 0) {[m [32m+[m[32m d->rect.pos.x += excess;[m [32m+[m[32m }[m [32m+[m[32m excess = right_Rect(bounds) - right_Rect(rootRect);[m [32m+[m[32m if (excess > 0) {[m [32m+[m[32m d->rect.pos.x -= excess;[m [32m+[m[32m }[m [32m+[m[32m }[m [32m+[m[32m }[m [32m+[m[32m iForEach(ObjectList, i, d->children) {[m [32m+[m[32m clampCenteredInRoot_Widget_(i.object);[m [32m+[m[32m }[m [32m+[m[32m}[m [32m+[m void arrange_Widget(iWidget *d) {[m if (d) {[m #if !defined (NDEBUG)[m [36m@@ -931,6 +953,7 @@[m [mvoid arrange_Widget(iWidget *d) {[m #endif[m resetArrangement_Widget_(d); /* back to initial default sizes */[m arrange_Widget_(d);[m [32m+[m[32m clampCenteredInRoot_Widget_(d);[m notifySizeChanged_Widget_(d);[m d->root->didChangeArrangement = iTrue;[m }[m
text/gemini; charset=utf-8
This content has been proxied by September (ba2dc).