[gitg] Activate select mode in dash on right click



commit 8913023f6720032a9799a421811ce5fb2489a0ad
Author: Jesse van den Kieboom <jessevdk gnome org>
Date:   Tue Jul 15 10:16:54 2014 +0200

    Activate select mode in dash on right click

 gitg/gitg-window.vala            |   14 ++++++++++++++
 gitg/resources/ui/gitg-window.ui |    1 +
 2 files changed, 15 insertions(+), 0 deletions(-)
---
diff --git a/gitg/gitg-window.vala b/gitg/gitg-window.vala
index c61c2a3..0ea9dbc 100644
--- a/gitg/gitg-window.vala
+++ b/gitg/gitg-window.vala
@@ -750,6 +750,20 @@ public class Window : Gtk.ApplicationWindow, GitgExt.Application, Initable
                }
        }
 
+       [GtkCallback]
+       private bool dash_view_button_press(Gdk.EventButton event)
+       {
+               Gdk.Event *ev = (Gdk.Event *)event;
+
+               if (ev->triggers_context_menu() && !d_dash_view.is_selection)
+               {
+                       d_select_button.active = true;
+                       return true;
+               }
+
+               return false;
+       }
+
        private Gtk.Widget make_dash_select_actions()
        {
                var ab = new Gtk.ActionBar();
diff --git a/gitg/resources/ui/gitg-window.ui b/gitg/resources/ui/gitg-window.ui
index aa6348e..361e3a5 100644
--- a/gitg/resources/ui/gitg-window.ui
+++ b/gitg/resources/ui/gitg-window.ui
@@ -240,6 +240,7 @@
                     <property name="can_focus">True</property>
                     <signal name="repository_activated" handler="dash_view_repository_activated" 
swapped="no"/>
                     <signal name="show_error" handler="dash_view_show_error" swapped="no"/>
+                    <signal name="button_press_event" handler="dash_view_button_press"/>
                     <style>
                       <class name="view"/>
                     </style>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]