From 7500e7533dc8a4a9c058bb25a568395fbb2e52a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20St=C3=BCrz?= Date: Wed, 25 Feb 2026 15:10:37 +0100 Subject: [PATCH] iOS: Add option to shrink the bottomMargin on iOS --- nymea-app/ui/Configuration.qml | 1 + nymea-app/ui/ConfigurationBase.qml | 3 +++ nymea-app/ui/RootItem.qml | 9 ++++++++- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/nymea-app/ui/Configuration.qml b/nymea-app/ui/Configuration.qml index 60f5afb7..83d4f229 100644 --- a/nymea-app/ui/Configuration.qml +++ b/nymea-app/ui/Configuration.qml @@ -32,6 +32,7 @@ ConfigurationBase { company: "chargebyte GmbH" connectionWizard: "/ui/connection/ConnectionWizard.qml" + iosSafeAreaBottomMarginScale: 1.0 magicEnabled: true networkSettingsEnabled: true diff --git a/nymea-app/ui/ConfigurationBase.qml b/nymea-app/ui/ConfigurationBase.qml index 9f77919d..36292715 100644 --- a/nymea-app/ui/ConfigurationBase.qml +++ b/nymea-app/ui/ConfigurationBase.qml @@ -53,6 +53,9 @@ Item { property string alternativeMainPage: "" + // iOS only: scales the safe area bottom inset before applying it as bottom margin. + property real iosSafeAreaBottomMarginScale: 1.0 + property var mainMenuLinks: null property bool closedSource: false diff --git a/nymea-app/ui/RootItem.qml b/nymea-app/ui/RootItem.qml index ed301478..cdf03e3c 100644 --- a/nymea-app/ui/RootItem.qml +++ b/nymea-app/ui/RootItem.qml @@ -37,6 +37,13 @@ import "connection" Item { id: root + readonly property int safeAreaBottomMargin: { + if (Qt.platform.os !== "ios") { + return PlatformHelper.bottomPadding + } + return Math.round(PlatformHelper.bottomPadding * Math.max(0, Configuration.iosSafeAreaBottomMarginScale)) + } + function handleAndroidBackButton() { return swipeView.currentItem.handleAndroidBackButton() } @@ -80,7 +87,7 @@ Item { anchors.fill: parent anchors.topMargin: PlatformHelper.topPadding - anchors.bottomMargin: PlatformHelper.bottomPadding + anchors.bottomMargin: root.safeAreaBottomMargin anchors.leftMargin: PlatformHelper.leftPadding anchors.rightMargin: PlatformHelper.rightPadding