From 1b716d38a4d7355ded5e495fcfb9a0e45e5fc83f Mon Sep 17 00:00:00 2001

From: =?UTF-8?q?Jaakko=20Kera=CC=88nen?= jaakko.keranen@iki.fi

Date: Mon, 28 Mar 2022 14:31:39 +0300

Subject: [PATCH 1/1] Mobile: Fixed layout issues

The top URL bar should never be animated.

Centered widgets shouldn't be placed outside the root area, if they can fit inside.


src/ui/inputwidget.c | 2 +-

src/ui/root.c | 2 +-

src/ui/widget.c | 31 +++++++++++++++++++++++++++----

3 files changed, 29 insertions(+), 6 deletions(-)

diff --git a/src/ui/inputwidget.c b/src/ui/inputwidget.c

index 49918152..de09db47 100644

--- a/src/ui/inputwidget.c

+++ b/src/ui/inputwidget.c

@@ -2302,7 +2302,7 @@ static iBool processEvent_InputWidget_(iInputWidget *d, const SDL_Event *ev) {

 else if (isCommand_UserEvent(ev, "keyboard.changed")) {

     const iBool isKeyboardVisible = (arg_Command(command_UserEvent(ev)) != 0);

     /* Scroll to keep widget visible when keyboard appears. */

         if (isKeyboardVisible) {

             d->lastOverflowScrollTime = SDL_GetTicks();

             overflowScrollToKeepVisible_InputWidget_(d);

diff --git a/src/ui/root.c b/src/ui/root.c

index 9bbfe0d9..5d3e436d 100644

--- a/src/ui/root.c

+++ b/src/ui/root.c

@@ -1120,7 +1120,7 @@ static iBool handleNavBarCommands_(iWidget *navBar, const char *cmd) {

 }

 else if (deviceType_App() == tablet_AppDeviceType && equal_Command(cmd, "keyboard.changed")) {

     const int keyboardHeight = arg_Command(cmd);

         setVisualOffset_Widget(navBar, -keyboardHeight + bottomSafeInset_Mobile(),

                                400, easeOut_AnimFlag | softer_AnimFlag);

     }

diff --git a/src/ui/widget.c b/src/ui/widget.c

index dbf992aa..d1e139e6 100644

--- a/src/ui/widget.c

+++ b/src/ui/widget.c

@@ -519,10 +519,10 @@ static size_t numArrangedChildren_Widget_(const iWidget *d) {

}

static void centerHorizontal_Widget_(iWidget *d) {

 TRACE(d, "center horizontally: %d", d->rect.pos.x);

}

@@ -922,6 +922,28 @@ static void notifySizeChanged_Widget_(iWidget *d) {

 }

}

+static void clampCenteredInRoot_Widget_(iWidget *d) {

+}

void arrange_Widget(iWidget *d) {

 if (d) {

#if !defined (NDEBUG)

@@ -931,6 +953,7 @@ void arrange_Widget(iWidget *d) {

#endif

     resetArrangement_Widget_(d); /* back to initial default sizes */

     arrange_Widget_(d);

     notifySizeChanged_Widget_(d);

     d->root->didChangeArrangement = iTrue;

 }

--

2.25.1

Proxy Information
Original URL
gemini://git.skyjake.fi/lagrange/work%2Fv1.12/patch/1b716d38a4d7355ded5e495fcfb9a0e45e5fc83f.patch
Status Code
Success (20)
Meta
text/plain
Capsule Response Time
64.999279 milliseconds
Gemini-to-HTML Time
2.235785 milliseconds

This content has been proxied by September (ba2dc).