]> www.fi.muni.cz Git - evince.git/commitdiff
Bind context menu to keyboard also. Fix for the bug #325065.
authorNickolay V. Shmyrev <nshmyrev@src.gnome.org>
Tue, 27 Dec 2005 22:49:49 +0000 (22:49 +0000)
committerNickolay V. Shmyrev <nshmyrev@src.gnome.org>
Tue, 27 Dec 2005 22:49:49 +0000 (22:49 +0000)
* shell/ev-view.c: (ev_view_popup_menu), (ev_view_class_init):

Bind context menu to keyboard also. Fix for the bug
#325065.

ChangeLog
shell/ev-view.c

index a1d1ed274d1435472ce6213834a47219fc96689b..1adab92c98ffc1ea7aac173c8a6008bea6c4c7ea 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2005-12-28  Nickolay V. Shmyrev  <nshmyrev@yandex.ru>
+
+       * shell/ev-view.c: (ev_view_popup_menu), (ev_view_class_init):
+       
+       Bind context menu to keyboard also. Fix for the bug
+       #325065.
+
 2005-12-27  Nickolay V. Shmyrev  <nshmyrev@yandex.ru>
 
        * shell/ev-view.c: (selection_scroll_timeout_cb):
index 285d52bd39963bb3aa90e3fd3af26345ae25976b..b1e9733648c3a6376dd0ef5628399687a451986c 100644 (file)
@@ -179,6 +179,7 @@ static gboolean   ev_view_scroll_event                       (GtkWidget
                                                              GdkEventScroll     *event);
 static gboolean   ev_view_expose_event                       (GtkWidget          *widget,
                                                              GdkEventExpose     *event);
+static gboolean   ev_view_popup_menu                         (GtkWidget         *widget);
 static gboolean   ev_view_button_press_event                 (GtkWidget          *widget,
                                                              GdkEventButton     *event);
 static gboolean   ev_view_motion_notify_event                (GtkWidget          *widget,
@@ -1622,6 +1623,19 @@ ev_view_expose_event (GtkWidget      *widget,
        return FALSE;
 }
 
+static gboolean
+ev_view_popup_menu (GtkWidget *widget)
+{
+    gint x, y;
+    EvLink *link;
+    EvView *view = EV_VIEW (widget);
+    
+    gtk_widget_get_pointer (widget, &x, &y);
+    link = ev_view_get_link_at_location (view, x, y);
+    g_signal_emit (view, signals[SIGNAL_POPUP_MENU], 0, link);
+    return TRUE;
+}
+
 static gboolean
 ev_view_button_press_event (GtkWidget      *widget,
                            GdkEventButton *event)
@@ -2386,6 +2400,7 @@ ev_view_class_init (EvViewClass *class)
        widget_class->leave_notify_event = ev_view_leave_notify_event;
        widget_class->style_set = ev_view_style_set;
        widget_class->drag_data_get = ev_view_drag_data_get;
+       widget_class->popup_menu = ev_view_popup_menu;
        gtk_object_class->destroy = ev_view_destroy;
 
        class->set_scroll_adjustments = ev_view_set_scroll_adjustments;