diff options
author | Bramastyo Harimukti <bramastyo.harimukti.santoso@pelagicore.com> | 2019-10-28 15:39:52 +0100 |
---|---|---|
committer | Bramastyo Harimukti Santoso <bramastyo.harimukti.santoso@pelagicore.com> | 2019-10-29 09:53:30 +0000 |
commit | 05f1ca355a963bec9a996892536cb8142eab3cc7 (patch) | |
tree | 79c4ee2e4ae0ada16d35e012c988b675cc4ac87c | |
parent | ed6440659dc93ddfff8542abbdb80f34bbff14e8 (diff) |
[cluster] add shortcut to move the cluster up and down
Change-Id: I56de9951ee0befdb9eb137a2f7b0eb9ff7828607
Reviewed-by: Egor Nemtsev <enemtsev@luxoft.com>
-rw-r--r-- | sysui/centerconsole/AbstractCenterConsole.qml | 7 | ||||
-rw-r--r-- | sysui/centerconsole/UIShortcuts.qml | 6 | ||||
-rw-r--r-- | sysui/instrumentcluster/InstrumentClusterWindow.qml | 36 | ||||
-rw-r--r-- | sysui/stores/ClusterStore.qml | 2 |
4 files changed, 50 insertions, 1 deletions
diff --git a/sysui/centerconsole/AbstractCenterConsole.qml b/sysui/centerconsole/AbstractCenterConsole.qml index 02b96594..29efabc6 100644 --- a/sysui/centerconsole/AbstractCenterConsole.qml +++ b/sysui/centerconsole/AbstractCenterConsole.qml @@ -189,5 +189,12 @@ Item { onCtrlXPressed: { Config.showCursorSpots = !Config.showCursorSpots; } + onCtrlAPressed: { + if (root.store.clusterStore.clusterPosition > 1) { + root.store.clusterStore.clusterPosition = 0 + } else { + root.store.clusterStore.clusterPosition = root.store.clusterStore.clusterPosition + 1; + } + } } } diff --git a/sysui/centerconsole/UIShortcuts.qml b/sysui/centerconsole/UIShortcuts.qml index 6ce6b325..eeee27e3 100644 --- a/sysui/centerconsole/UIShortcuts.qml +++ b/sysui/centerconsole/UIShortcuts.qml @@ -47,6 +47,7 @@ Item { signal ctrl3Pressed() signal ctrlPPressed() signal ctrlXPressed() + signal ctrlAPressed() Shortcut { sequence: "Ctrl+r" @@ -89,4 +90,9 @@ Item { context: Qt.ApplicationShortcut onActivated: root.ctrlXPressed() } + Shortcut { + sequence: "Ctrl+a" + context: Qt.ApplicationShortcut + onActivated: root.ctrlAPressed() + } } diff --git a/sysui/instrumentcluster/InstrumentClusterWindow.qml b/sysui/instrumentcluster/InstrumentClusterWindow.qml index 5383ff98..9af5ffa8 100644 --- a/sysui/instrumentcluster/InstrumentClusterWindow.qml +++ b/sysui/instrumentcluster/InstrumentClusterWindow.qml @@ -46,6 +46,7 @@ Window { property var uiSettings property bool invertedOrientation: root.clusterStore.invertedCluster property bool performanceOverlayVisible: false + property int clusterPosition: root.clusterStore.clusterPosition // 0: top 1: center 2: bottom function nextApplicationICWindow() { applicationICWindows.next(); @@ -97,7 +98,40 @@ Window { Item { id: uiSlot - anchors.centerIn: parent + + states: [ + State { + name: "top" + when: root.clusterPosition === 0 + AnchorChanges { + target: uiSlot + anchors.top: parent.top + anchors.bottom: undefined + anchors.verticalCenter: undefined + } + }, + State { + name: "center" + when: root.clusterPosition === 1 + AnchorChanges { + target: uiSlot + anchors.top: undefined + anchors.bottom: undefined + anchors.verticalCenter: parent.verticalCenter + } + }, + State { + name: "bottom" + when: root.clusterPosition === 2 + AnchorChanges { + target: uiSlot + anchors.top: undefined + anchors.bottom: parent.bottom + anchors.verticalCenter: undefined + } + } + ] + width: parent.width height: width / Config.instrumentClusterUIAspectRatio rotation: root.invertedOrientation ? 180 : 0 diff --git a/sysui/stores/ClusterStore.qml b/sysui/stores/ClusterStore.qml index c1af73b8..c678ac79 100644 --- a/sysui/stores/ClusterStore.qml +++ b/sysui/stores/ClusterStore.qml @@ -60,6 +60,8 @@ QtObject { property int desktopWidth property int desktopHeight + property int clusterPosition: 1 // 0: top 1: center 2: bottom + onClusterScreenChanged: { if (qsrEnabled || !adjustSizesForScreen) { desktopWidth = Config.instrumentClusterWidth; |