Commit 2f0742af authored by Matthieu Bruel's avatar Matthieu Bruel
Browse files

Fix issue with null size Window when the config doesn't exist yet

=> we need default min values (3*4 Screen.width, Screen.height)
parent 543d093f
...@@ -20,13 +20,14 @@ import QtQuick.Layouts 1.3 ...@@ -20,13 +20,14 @@ import QtQuick.Layouts 1.3
import QtQuick.Controls.Material 2.3 import QtQuick.Controls.Material 2.3
import Qt.labs.settings 1.0 import Qt.labs.settings 1.0
import Qt.labs.platform 1.0 as Platform import Qt.labs.platform 1.0 as Platform
import QtQuick.Window 2.10 import QtQuick.Window 2.12
import io.qrop.components 1.0 import io.qrop.components 1.0
ApplicationWindow { ApplicationWindow {
id: window id: window
readonly property int minLoadingDisplaySize: 100
readonly property bool largeDisplay: width > 100 readonly property bool largeDisplay: width > 100
readonly property bool smallDisplay: width < 500 readonly property bool smallDisplay: width < 500
property bool railMode: width > 1200 property bool railMode: width > 1200
...@@ -74,11 +75,16 @@ ApplicationWindow { ...@@ -74,11 +75,16 @@ ApplicationWindow {
window.visibility = Window.FullScreen; window.visibility = Window.FullScreen;
else { else {
window.visibility = Window.Windowed; window.visibility = Window.Windowed;
if (mainSettings.windowWidth < minLoadingDisplaySize) {
window.x = Screen.width*1/8;
window.width = Screen.width*3/4;
} else {
window.x = mainSettings.windowX; window.x = mainSettings.windowX;
window.y = mainSettings.windowY;
window.height = mainSettings.windowHeight;
window.width = mainSettings.windowWidth; window.width = mainSettings.windowWidth;
} }
window.y = mainSettings.windowY;
window.height = mainSettings.windowHeight < minLoadingDisplaySize ? Screen.height : mainSettings.windowHeight;
}
} }
Component.onDestruction: { Component.onDestruction: {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment