summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDominik Holland <dominik.holland@pelagicore.com>2016-10-19 12:08:42 +0200
committerDominik Holland <dominik.holland@pelagicore.com>2016-10-19 10:16:35 +0000
commitd2f0e1f05a05de3a936655afe2b8a3ec82418eff (patch)
tree9b52ee9a90c5e9c3b55210147ddb902298b3a78d
parent105c1aa9d8d380275946d9cd8b3236e4c844969a (diff)
downloadneptune-ui-d2f0e1f05a05de3a936655afe2b8a3ec82418eff.tar.gz
Only have one logic for detecting whether an instrument cluster is shown
Instead of having our own detection in the AutoConfig.qml we now pass the "showClusterIfPossible" to the config and decide what's needed based on this value. Otherwise we might end up in a situation where we show an instrument cluster, but the Compositor doesn't know about it and doesn't accept the windows Change-Id: I7929f8a95f3d6462b63d856aaa51c93a87881786 Reviewed-by: Nedim Hadzic <nedim.hadzic@pelagicore.com>
-rw-r--r--imports/shared/utils/AutoConfig.qml4
-rw-r--r--imports/shared/utils/Style.qml3
2 files changed, 2 insertions, 5 deletions
diff --git a/imports/shared/utils/AutoConfig.qml b/imports/shared/utils/AutoConfig.qml
index 5c567f7..e49a513 100644
--- a/imports/shared/utils/AutoConfig.qml
+++ b/imports/shared/utils/AutoConfig.qml
@@ -54,7 +54,6 @@ QtObject {
property int symbolSizeL: 96
property int symbolSizeXL: 114
property int symbolSizeXXL: 192
- property bool showClusterIfPossible: false
property string displayBackground: "background_1920x1080"
@@ -109,8 +108,7 @@ QtObject {
fontWeight = Font.Light
- var canDisplayCluster = Screen.desktopAvailableWidth > Screen.width || ScreenManager.screenCount() > 1
- if (canDisplayCluster) {
+ if (showClusterIfPossible) {
print("Instrument Cluster enabled")
withCluster = true
clusterWidth = ScreenManager.availableScreens[1].size.width
diff --git a/imports/shared/utils/Style.qml b/imports/shared/utils/Style.qml
index dfb3e2d..cf7f20f 100644
--- a/imports/shared/utils/Style.qml
+++ b/imports/shared/utils/Style.qml
@@ -90,12 +90,11 @@ QtObject {
property bool showClusterIfPossible: isClient ? ApplicationInterface.additionalConfiguration.showCluster :ApplicationManager.additionalConfiguration.showCluster
property Loader styleLoader: Loader {
+ property bool showClusterIfPossible: root.showClusterIfPossible
source: styleConfig === "auto" ? Qt.resolvedUrl("AutoConfig.qml") : styleConfig
onLoaded: {
print("StyleConfig loaded: ", source)
- if (item.showClusterIfPossible)
- item.showClusterIfPossible = root.showClusterIfPossible
}
}