From c53ffebeceed97e56d57cf5dfed2a6d598eb8a92 Mon Sep 17 00:00:00 2001 From: Logan McNaughton <848146+loganmc10@users.noreply.github.com> Date: Wed, 20 May 2026 09:47:34 +0200 Subject: [PATCH] only show window in safe area (#924) --- src/ui/gui/appwindow.slint | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/src/ui/gui/appwindow.slint b/src/ui/gui/appwindow.slint index 3dfc7fe..0bf2e9d 100644 --- a/src/ui/gui/appwindow.slint +++ b/src/ui/gui/appwindow.slint @@ -87,6 +87,12 @@ export component AppWindow inherits Window { private property is-portrait: root.width < root.height; private property bar-thickness: 56px; + private property safe-left: root.safe-area-insets.left; + private property safe-top: root.safe-area-insets.top; + private property safe-right: root.safe-area-insets.right; + private property safe-bottom: root.safe-area-insets.bottom; + private property safe-width: root.width - root.safe-left - root.safe-right; + private property safe-height: root.height - root.safe-top - root.safe-bottom; min-width: 320px; min-height: 240px; @@ -128,18 +134,18 @@ export component AppWindow inherits Window { label: @tr("Menu" => "About"), }, ]; - x: 0; - y: root.is-portrait ? parent.height - root.bar-thickness : 0; - width: root.is-portrait ? parent.width : root.bar-thickness; - height: root.is-portrait ? root.bar-thickness : parent.height; + x: root.safe-left; + y: root.is-portrait ? parent.height - root.bar-thickness - root.safe-bottom : root.safe-top; + width: root.is-portrait ? root.safe-width : root.bar-thickness; + height: root.is-portrait ? root.bar-thickness : root.safe-height; } content-area := Rectangle { clip: true; - x: root.is-portrait ? 0 : root.bar-thickness; - y: 0; - width: root.is-portrait ? parent.width : parent.width - root.bar-thickness; - height: root.is-portrait ? parent.height - root.bar-thickness : parent.height; + x: root.is-portrait ? root.safe-left : root.safe-left + root.bar-thickness; + y: root.safe-top; + width: root.is-portrait ? root.safe-width : root.safe-width - root.bar-thickness; + height: root.is-portrait ? root.safe-height - root.bar-thickness : root.safe-height; if(side-bar.current-item == 0): LocalGame { width: 100%;