Merge lp:~marcus-lundgren/slingshot/fix-1182740 into lp:~elementary-pantheon/slingshot/trunk

Proposed by Marcus Lundgren
Status: Merged
Approved by: David Gomes
Approved revision: 367
Merged at revision: 367
Proposed branch: lp:~marcus-lundgren/slingshot/fix-1182740
Merge into: lp:~elementary-pantheon/slingshot/trunk
Diff against target: 34 lines (+17/-0)
1 file modified
src/SlingshotView.vala (+17/-0)
To merge this branch: bzr merge lp:~marcus-lundgren/slingshot/fix-1182740
Reviewer Review Type Date Requested Status
Julián Unrrein (community) Approve
David Gomes (community) Approve
elementary UX Pending
Review via email: mp+179598@code.launchpad.net

Commit message

Change view modes with Ctrl + n, fixing bug #1182740.

Description of the change

Change view modes with Ctrl + n.

To post a comment you must log in.
Revision history for this message
David Gomes (davidgomes) wrote :

I'm not sure we need more keyboard shortcuts, but I approve the code. Adding ~elementary-design to review too.

review: Approve
Revision history for this message
David Gomes (davidgomes) wrote :

I also need somebody who tests this on Pantheon please (13.04 here).

Revision history for this message
Julián Unrrein (junrrein) wrote :

Tested under elementary Luna. Works as expected.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/SlingshotView.vala'
2--- src/SlingshotView.vala 2013-06-12 21:40:45 +0000
3+++ src/SlingshotView.vala 2013-08-11 12:04:24 +0000
4@@ -295,6 +295,17 @@
5 move_to_rect (app_launcher_pos, show);
6 }
7
8+ private void change_view_mode (string key) {
9+ switch (key) {
10+ case "1": // Normal view
11+ view_selector.selected = 0;
12+ break;
13+ default: // Category view
14+ view_selector.selected = 1;
15+ break;
16+ }
17+ }
18+
19 public override bool key_press_event (Gdk.EventKey event) {
20
21 var key = Gdk.keyval_name (event.keyval).replace ("KP_", "");
22@@ -303,6 +314,12 @@
23 Gdk.ModifierType.MOD1_MASK |
24 Gdk.ModifierType.CONTROL_MASK);
25
26+ if ((event.state & Gdk.ModifierType.CONTROL_MASK) != 0 &&
27+ (key == "1" || key == "2")) {
28+ change_view_mode (key);
29+ return true;
30+ }
31+
32 switch (key) {
33
34 case "Escape":

Subscribers

People subscribed via source and target branches