Merge lp:~evfool/switchboard/lp1096425-mousenav into lp:~elementary-pantheon/switchboard/switchboard

Proposed by Robert Roth
Status: Merged
Approved by: Cody Garver
Approved revision: 515
Merged at revision: 516
Proposed branch: lp:~evfool/switchboard/lp1096425-mousenav
Merge into: lp:~elementary-pantheon/switchboard/switchboard
Diff against target: 19 lines (+9/-0)
1 file modified
src/Switchboard.vala (+9/-0)
To merge this branch: bzr merge lp:~evfool/switchboard/lp1096425-mousenav
Reviewer Review Type Date Requested Status
elementary Pantheon team Pending
Review via email: mp+240787@code.launchpad.net

Commit message

Handle the mouse back button to navigate back from the plug to All settings (lp:1096425)

Description of the change

Handle the mouse back button to navigate back from the plug to All settings (lp:1096425)
Unfortunately the button value of 8 looks like something needing hard-coding, as:
* Gtk+Gdk docs say that the Gdk.EventButton.event will be a number between 1-5, but a physical mouse with back/forward buttons reports 8 and 9 for these buttons
* Gtk+Gdk constants are defined for Primary, Secondary and Third mouse button, or Button 1-5 as ModifierType, but no others can be found.

To post a comment you must log in.
Revision history for this message
Cody Garver (codygarver) wrote :

What about forward?

Revision history for this message
Danielle Foré (danrabbit) wrote :

What about it? We don't offer forward in switchboard :p

Revision history for this message
Cody Garver (codygarver) wrote :

We don't offer it but the mouse offers it and the bug title is "Mouse navigation buttons...". Buttons with an S.

Revision history for this message
Robert Roth (evfool) wrote :

I've been thinking about a forward myself, but as currently there's no notion of forward in switchboard, I have chosen the easier path. When we define what forward should do, I will happily implement it both with mouse button 9 and alt+Right shortcuts :)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/Switchboard.vala'
2--- src/Switchboard.vala 2014-09-25 09:41:29 +0000
3+++ src/Switchboard.vala 2014-11-05 22:03:59 +0000
4@@ -406,6 +406,15 @@
5 navigation_button.clicked.connect (handle_navigation_button_clicked);
6 navigation_button.sensitive = false;
7
8+ main_window.button_release_event.connect ((event) => {
9+ // On back mouse button pressed
10+ if (event.button == 8) {
11+ navigation_button.clicked ();
12+ }
13+
14+ return false;
15+ });
16+
17 // Add everything to the toolbar
18 headerbar.pack_start (navigation_button);
19 headerbar.pack_end (search_box);

Subscribers

People subscribed via source and target branches

to all changes: