on xenial help sign in
fix Super+0
commit00a969793b954d450b5ef970266a91ea71a14c7a authorMichael Zanetti <michael.zanetti@canonical.com> dateMon 7 Dec 2015, 22:32 (11 years ago) parent6ff6301
3 files changed+23−11
qml/Launcher/LauncherDelegate.qml+1−1 qml/Shell.qml+9−2 tests/qmltests/tst_Shell.qml+13−8
qml/Launcher/LauncherDelegate.qml+1−1
@@ -257,7 +257,7 @@ Item {
257257 visible: root.shortcutHintShown
258258 Label {
259259 anchors.centerIn: parent
260− text: itemIndex + 1
260+ text: (itemIndex + 1) % 10
261261 color: "white"
262262 }
263263 }
qml/Shell.qml+9−2
@@ -583,11 +583,18 @@ Item {
583583 launcher.openForKeyboardNavigation();
584584 }
585585 }
586−
586+ GlobalShortcut {
587+ shortcut: Qt.MetaModifier | Qt.Key_0
588+ onTriggered: {
589+ if (LauncherModel.get(9)) {
590+ activateApplication(LauncherModel.get(9).appId);
591+ }
592+ }
593+ }
587594 Repeater {
588595 model: 9
589596 GlobalShortcut {
590− shortcut: Qt.MetaModifier | (Qt.Key_1 + index)
597+ shortcut: Qt.MetaModifier | (Qt.Key_1 + index)
591598 onTriggered: {
592599 if (LauncherModel.get(index)) {
593600 activateApplication(LauncherModel.get(index).appId);
tests/qmltests/tst_Shell.qml+13−8
@@ -2007,18 +2007,23 @@ Rectangle {
20072007 tryCompare(shortcutHint, "visible", false);
20082008 }
20092009
2010− function test_metaNumberLaunchesFromLauncher() {
2010+ function test_metaNumberLaunchesFromLauncher_data() {
2011+ return [
2012+ {tag: "Meta+1", key: Qt.Key_1, index: 0},
2013+ {tag: "Meta+2", key: Qt.Key_2, index: 1},
2014+ {tag: "Meta+4", key: Qt.Key_5, index: 4},
2015+ {tag: "Meta+0", key: Qt.Key_0, index: 9},
2016+ ]
2017+ }
2018+
2019+ function test_metaNumberLaunchesFromLauncher(data) {
20112020 loadShell("desktop");
20122021 var launcher = findChild(shell, "launcher");
2013− var firstAppInLauncher = LauncherModel.get(0).appId;
2014− var secondAppInLauncher = LauncherModel.get(1).appId;
2022+ var appId = LauncherModel.get(data.index).appId;
20152023 waitForRendering(shell);
20162024
2017− keyClick(Qt.Key_1, Qt.MetaModifier);
2018− tryCompare(ApplicationManager, "focusedApplicationId", firstAppInLauncher);
2019−
2020− keyClick(Qt.Key_2, Qt.MetaModifier);
2021− tryCompare(ApplicationManager, "focusedApplicationId", secondAppInLauncher);
2025+ keyClick(data.key, Qt.MetaModifier);
2026+ tryCompare(ApplicationManager, "focusedApplicationId", appId);
20222027 }
20232028
20242029 function test_altF1OpensLauncherForKeyboardNavigation() {