Skip to content

Commit

Permalink
Only have one logic for detecting whether an instrument cluster is shown
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
Gagi2k committed Oct 19, 2016
1 parent 105c1aa commit d2f0e1f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
4 changes: 1 addition & 3 deletions imports/shared/utils/AutoConfig.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions imports/shared/utils/Style.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

Expand Down

0 comments on commit d2f0e1f

Please sign in to comment.