From 6c50b5367f350157bbe911c1d9f9c606c32349f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20B=C5=99=C3=ADza?= Date: Fri, 8 Sep 2023 17:59:46 +0200 Subject: [PATCH] Resize the window to the view when starting up --- qml/main.qml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/qml/main.qml b/qml/main.qml index 1ed5eed..6d32d16 100644 --- a/qml/main.qml +++ b/qml/main.qml @@ -123,6 +123,13 @@ ApplicationWindow { } else { button.visible = false button.error = "" + // resize the window to fit the contents if it's larger and gives us implicit size + if (item) { + if (item.implicitWidth !== "undefined" && item.implicitWidth > window.width) + window.width = Math.min(item.implicitWidth, Screen.width) + if (item.implicitHeight !== "undefined" && item.implicitHeight > window.height) + window.height = Math.min(item.implicitHeight, Screen.height) + } } } }