fix: add upper limit to initialized app window size

This is needed because on screens that are too big, the app becomes
huge.
This commit is contained in:
Pascal Precht 2021-12-07 10:20:41 +01:00 committed by r4bbit.eth
parent cebe20a152
commit 35233a01e7
1 changed files with 6 additions and 5 deletions

View File

@ -192,14 +192,15 @@ StatusWindow {
Component.onCompleted: { Component.onCompleted: {
Style.changeTheme(localAppSettings.theme, systemPalette.isCurrentSystemThemeDark()) 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); setX(Qt.application.screens[0].width / 2 - width / 2);
setY(Qt.application.screens[0].height / 2 - height / 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(); applicationWindow.updatePosition();
} }