on xenial help sign in
provide the close shortcut across stages
commit024ddd24b47897a69a8c1e06293095b9e9373f4f authorLukáš Tinkl <lukas.tinkl@canonical.com> dateMon 30 May 2016, 14:30 (10 years ago) parent64d3f31
3 files changed+18−2
qml/Stages/DesktopStage.qml+4−2 qml/Stages/PhoneStage.qml+7 qml/Stages/TabletStage.qml+7
qml/Stages/DesktopStage.qml+4−2
@@ -50,8 +50,8 @@ AbstractStage {
5050 GlobalShortcut {
5151 id: closeWindowShortcut
5252 shortcut: Qt.AltModifier|Qt.Key_F4
53− onTriggered: { if (priv.focusedAppDelegate) { priv.focusedAppDelegate.close(); } }
54− active: priv.focusedAppDelegate !== null
53+ onTriggered: priv.focusedAppDelegate.close();
54+ active: priv.focusedAppDelegate && !priv.focusedAppDelegate.isDash
5555 }
5656
5757 GlobalShortcut {
@@ -298,6 +298,8 @@ AbstractStage {
298298
299299 readonly property var surface: model.surface
300300
301+ readonly property bool isDash: model.application.appId == "unity8-dash"
302+
301303 function claimFocus() {
302304 if (spread.state == "altTab") {
303305 spread.cancel();
qml/Stages/PhoneStage.qml+7
@@ -20,6 +20,7 @@ import Ubuntu.Gestures 0.1
2020import Unity.Application 0.1
2121import Unity.Session 0.1
2222import Utils 0.1
23+import GlobalShortcut 1.0
2324import Powerd 0.1
2425import "../Components"
2526
@@ -126,6 +127,12 @@ AbstractStage {
126127
127128 signal opened()
128129
130+ GlobalShortcut {
131+ shortcut: Qt.AltModifier|Qt.Key_F4
132+ onTriggered: priv.focusedAppDelegate.closed()
133+ active: priv.focusedAppDelegate && !priv.focusedAppDelegate.isDash
134+ }
135+
129136 function select(appId) {
130137 spreadView.snapTo(priv.indexOf(appId));
131138 }
qml/Stages/TabletStage.qml+7
@@ -19,6 +19,7 @@ import Ubuntu.Components 1.3
1919import Ubuntu.Gestures 0.1
2020import Unity.Application 0.1
2121import Utils 0.1
22+import GlobalShortcut 1.0
2223import Powerd 0.1
2324import "../Components"
2425
@@ -114,6 +115,12 @@ AbstractStage {
114115 }
115116 }
116117
118+ GlobalShortcut {
119+ shortcut: Qt.AltModifier|Qt.Key_F4
120+ onTriggered: priv.focusedAppDelegate.closed()
121+ active: priv.focusedAppDelegate && priv.focusedAppDelegate.isDash
122+ }
123+
117124 // How far left the stage has been dragged, used externally by tutorial code
118125 dragProgress: spreadRepeater.count > 0 ? spreadRepeater.itemAt(0).animatedProgress : 0
119126