[gnome-music/wip/mschraal/backbutton: 2/2] window: Enable back mouse button to navigate backwards
- From: Marinus Schraal <mschraal src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music/wip/mschraal/backbutton: 2/2] window: Enable back mouse button to navigate backwards
- Date: Tue, 19 Dec 2017 12:36:25 +0000 (UTC)
commit e8b554ced46363978f3ef66158273efe5ddc1843
Author: theawless <thawless gmail com>
Date: Sat Jan 14 04:03:57 2017 +0530
window: Enable back mouse button to navigate backwards
Creates the same effect as having pressed "Alt+Left" combination.
Override button_release_event to handle mouse button 8.
https://bugzilla.gnome.org/show_bug.cgi?id=771934
gnomemusic/window.py | 11 +++++++++++
1 file changed, 11 insertions(+)
---
diff --git a/gnomemusic/window.py b/gnomemusic/window.py
index f0fba83..7b269f6 100644
--- a/gnomemusic/window.py
+++ b/gnomemusic/window.py
@@ -474,6 +474,17 @@ class Window(Gtk.ApplicationWindow):
self.toolbar.searchbar.show_bar(True)
@log
+ def do_button_release_event(self, event):
+ """Override default button release event
+
+ :param Gdk.EventButton event: Button event
+ """
+ __, code = event.get_button()
+ # Mouse button 8 is the navigation button
+ if code == 8:
+ self.toolbar.on_back_button_clicked()
+
+ @log
def _notify_mode_disconnect(self, data=None):
self.player.Stop()
self._stack.disconnect(self._on_notify_model_id)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]