[gnome-games/wip/exalm/views: 14/17] display-view: Handle mouse back	button
- From: Alexander Mikhaylenko <alexm src gnome org>
 
- To: commits-list gnome org
 
- Cc: 
 
- Subject: [gnome-games/wip/exalm/views: 14/17] display-view: Handle mouse back	button
 
- Date: Fri,  5 Oct 2018 14:00:54 +0000 (UTC)
 
commit f7cfce13d2bc97d94f7a418dab5e7afebf51f8dd
Author: Alexander Mikhaylenko <exalm7659 gmail com>
Date:   Thu Oct 4 21:42:35 2018 +0500
    display-view: Handle mouse back button
 src/ui/application-window.vala | 11 +----------
 src/ui/display-view.vala       |  6 ++++++
 2 files changed, 7 insertions(+), 10 deletions(-)
---
diff --git a/src/ui/application-window.vala b/src/ui/application-window.vala
index a620b9b1..136a3ec5 100644
--- a/src/ui/application-window.vala
+++ b/src/ui/application-window.vala
@@ -198,16 +198,7 @@ private class Games.ApplicationWindow : Gtk.ApplicationWindow {
 
        [GtkCallback]
        public bool on_button_pressed (Gdk.EventButton event) {
-               // Mouse button 8 is the navigation previous button
-               if (event.button == 8) {
-                       if (current_view != display_view)
-                               return false;
-
-                       on_display_back ();
-                       return true;
-               }
-
-               return false;
+               return current_view.on_button_pressed (event);
        }
 
        [GtkCallback]
diff --git a/src/ui/display-view.vala b/src/ui/display-view.vala
index b7c4a5cc..bd6ac610 100644
--- a/src/ui/display-view.vala
+++ b/src/ui/display-view.vala
@@ -50,6 +50,12 @@ private class Games.DisplayView: Gtk.Bin, ApplicationView {
        }
 
        public bool on_button_pressed (Gdk.EventButton event) {
+               // Mouse button 8 is the navigation previous button
+               if (event.button == 8) {
+                       back ();
+                       return true;
+               }
+
                return false;
        }
 
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]