From d2f0e1f05a05de3a936655afe2b8a3ec82418eff Mon Sep 17 00:00:00 2001 From: Dominik Holland Date: Wed, 19 Oct 2016 12:08:42 +0200 Subject: 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 --- imports/shared/utils/AutoConfig.qml | 4 +--- imports/shared/utils/Style.qml | 3 +-- 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 } } -- cgit v1.2.1