From c2866b4d36eb7af2057dca0e1b85295b6234f5c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaakko=20Kera=CC=88nen?= Date: Tue, 22 Nov 2022 21:08:07 +0200 Subject: [PATCH 1/1] Mobile: Tablet layout improvements New threshold for a tight navbar layout on tablets, and fix for New Identity dialog jumping down when pressing "More". --- src/app.c | 2 ++ src/ui/root.c | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/app.c b/src/app.c index 61c39ccf..057c8d1b 100644 --- a/src/app.c +++ b/src/app.c @@ -2720,8 +2720,10 @@ static iBool handleIdentityCreationCommands_(iWidget *dlg, const char *cmd) { } } setFlags_Widget(pointer_Command(cmd), isUsingPanelLayout_Mobile() ? hidden_WidgetFlag : disabled_WidgetFlag, iTrue); + const int oldY = dlg->rect.pos.y; arrange_Widget(dlg); refresh_Widget(dlg); + dlg->rect.pos.y = oldY; return iTrue; } if (equal_Command(cmd, "ident.scope")) { diff --git a/src/ui/root.c b/src/ui/root.c index 341fd456..3c7dc51a 100644 --- a/src/ui/root.c +++ b/src/ui/root.c @@ -820,7 +820,8 @@ static int navBarAvailableSpace_(iWidget *navBar) { } iBool isNarrow_Root(const iRoot *d) { - return width_Rect(safeRect_Root(d)) / gap_UI < (isTerminal_Platform() ? 81 : 140); + return width_Rect(safeRect_Root(d)) / gap_UI < + (isTerminal_Platform() ? 81 : deviceType_App() == tablet_AppDeviceType ? 160 : 140); } static void updateNavBarSize_(iWidget *navBar) { -- 2.34.1