From 35233a01e7864e14f02b53e8ebe1442a740ddf4e Mon Sep 17 00:00:00 2001 From: Pascal Precht Date: Tue, 7 Dec 2021 10:20:41 +0100 Subject: [PATCH] fix: add upper limit to initialized app window size This is needed because on screens that are too big, the app becomes huge. --- ui/main.qml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/ui/main.qml b/ui/main.qml index 2993457338..23d1ce74d2 100644 --- a/ui/main.qml +++ b/ui/main.qml @@ -192,14 +192,15 @@ StatusWindow { Component.onCompleted: { Style.changeTheme(localAppSettings.theme, systemPalette.isCurrentSystemThemeDark()) + if (!localAppSettings.appSizeInitialized) { + width = Math.min(Screen.desktopAvailableWidth - 125, 1400) + height = Math.min(Screen.desktopAvailableHeight - 125, 840) + localAppSettings.appSizeInitialized = true + } + setX(Qt.application.screens[0].width / 2 - width / 2); setY(Qt.application.screens[0].height / 2 - height / 2); - if (!localAppSettings.appSizeInitialized) { - width = Screen.desktopAvailableWidth - 125 - height = Screen.desktopAvailableHeight - 125 - localAppSettings.appSizeInitialized = true - } applicationWindow.updatePosition(); }