fix: [re-add] add upper limit to initialised app window size

Fixes #4698

This is needed because on screens that are too big, the app becomes huge.
This commit is contained in:
Jonathan Rainville 2022-02-03 15:42:22 -05:00
parent d4410c1aa7
commit 2207e047bb
1 changed files with 7 additions and 5 deletions

View File

@ -200,14 +200,16 @@ StatusWindow {
Component.onCompleted: {
Global.applicationWindow = this;
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();
}