diff options
author | Dominik Holland <dominik.holland@pelagicore.com> | 2016-08-30 17:41:37 +0200 |
---|---|---|
committer | Dominik Holland <dominik.holland@pelagicore.com> | 2016-09-01 08:47:38 +0000 |
commit | dae966c9ed509bab775a30e85364a64b77290081 (patch) | |
tree | 162dcf907ee7153401a2b37c93f6230009d9c0d1 /imports | |
parent | dc7f8ff7c14e25f109990dd0cd42776e40d389b0 (diff) | |
download | neptune-ui-dae966c9ed509bab775a30e85364a64b77290081.tar.gz |
Moved the cluster detection into the AutoConfig.qml
This is needed as also the multi-process applications need to know
whether to display the cluster widget and how big it can be rendered
Change-Id: I589439f50fa3aa60630dd7b1fb6e4008a3d1b8c2
Reviewed-by: Nedim Hadzic <nedim.hadzic@pelagicore.com>
Diffstat (limited to 'imports')
-rw-r--r-- | imports/shared/utils/AutoConfig.qml | 14 | ||||
-rw-r--r-- | imports/shared/utils/Style.qml | 3 |
2 files changed, 17 insertions, 0 deletions
diff --git a/imports/shared/utils/AutoConfig.qml b/imports/shared/utils/AutoConfig.qml index b4136d3..5c567f7 100644 --- a/imports/shared/utils/AutoConfig.qml +++ b/imports/shared/utils/AutoConfig.qml @@ -31,8 +31,10 @@ import QtQuick 2.0 import QtQuick.Window 2.2 +import com.pelagicore.ScreenManager 1.0 QtObject { + property bool withCluster: false property int cellWidth: 53 // 1280/24 property int cellHeight: 33 // 800/24 property var fontWeight: Font.Light @@ -52,12 +54,15 @@ QtObject { property int symbolSizeL: 96 property int symbolSizeXL: 114 property int symbolSizeXXL: 192 + property bool showClusterIfPossible: false property string displayBackground: "background_1920x1080" property int screenWidth: Screen.width property int screenHeight: Math.min(screenWidth * 0.62, Screen.height) + property int clusterWidth: 1920 + property int clusterHeight: 720 onScreenWidthChanged: cellWidth = Math.floor(screenWidth/24) onScreenHeightChanged: cellHeight = Math.floor(screenHeight/24) @@ -103,5 +108,14 @@ QtObject { fontSizeXXL = scalFactor * 48 fontWeight = Font.Light + + var canDisplayCluster = Screen.desktopAvailableWidth > Screen.width || ScreenManager.screenCount() > 1 + if (canDisplayCluster) { + print("Instrument Cluster enabled") + withCluster = true + clusterWidth = ScreenManager.availableScreens[1].size.width + clusterHeight = Math.min(ScreenManager.availableScreens[1].size.width * 0.375, ScreenManager.availableScreens[1].size.height) + print("cluster resolution: " + clusterWidth + "x" + clusterHeight) + } } } diff --git a/imports/shared/utils/Style.qml b/imports/shared/utils/Style.qml index 59cdafe..dfb3e2d 100644 --- a/imports/shared/utils/Style.qml +++ b/imports/shared/utils/Style.qml @@ -87,12 +87,15 @@ QtObject { property bool isClient: typeof ApplicationInterface !== 'undefined' property string styleConfig: isClient ? ApplicationInterface.additionalConfiguration.styleConfig : ApplicationManager.additionalConfiguration.styleConfig + property bool showClusterIfPossible: isClient ? ApplicationInterface.additionalConfiguration.showCluster :ApplicationManager.additionalConfiguration.showCluster property Loader styleLoader: Loader { source: styleConfig === "auto" ? Qt.resolvedUrl("AutoConfig.qml") : styleConfig onLoaded: { print("StyleConfig loaded: ", source) + if (item.showClusterIfPossible) + item.showClusterIfPossible = root.showClusterIfPossible } } |