]> www.fi.muni.cz Git - evince.git/commitdiff
Connect to button-press event on correct widget. Fixes bug #431988
authorNickolay V. Shmyrev <nshmyrev@yandex.ru>
Wed, 9 May 2007 20:52:48 +0000 (20:52 +0000)
committerNickolay V. Shmyrev <nshmyrev@src.gnome.org>
Wed, 9 May 2007 20:52:48 +0000 (20:52 +0000)
2007-05-10  Nickolay V. Shmyrev  <nshmyrev@yandex.ru>

* shell/ev-navigation-action-widget.c:
(ev_navigation_action_widget_init),
(ev_navigation_action_widget_class_init),
(ev_navigation_action_widget_button_press_event):

Connect to button-press event on correct widget. Fixes
bug #431988

svn path=/trunk/; revision=2445

ChangeLog
shell/ev-navigation-action-widget.c

index 611368135a30c1ba2dbe860eb20523024924541e..0cc791fedfff0d928de5a131f1be9cecf9c1b217 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,13 +1,12 @@
-2007-05-09  Nickolay V. Shmyrev  <nshmyrev@yandex.ru>
+2007-05-10  Nickolay V. Shmyrev  <nshmyrev@yandex.ru>
 
-       * shell/ev-application.c: (ev_application_open_window),
-       (ev_application_add_icon_path_for_screen),
-       (ev_application_open_uri_at_dest):
-       * shell/ev-navigation-action-widget.c: (popup_menu_under_arrow):
-       * shell/ev-navigation-action.c: (build_menu):
+       * shell/ev-navigation-action-widget.c:
+       (ev_navigation_action_widget_init),
+       (ev_navigation_action_widget_class_init),
+       (ev_navigation_action_widget_button_press_event):
        
-       Add app-specific icons to our icon theme. Fixes bug
-       #425508.
+       Connect to button-press event on correct widget. Fixes
+       bug #431988
 
 2007-05-09  Nickolay V. Shmyrev  <nshmyrev@yandex.ru>
 
@@ -16,6 +15,9 @@
        (ev_application_open_uri_at_dest):
        * shell/ev-navigation-action-widget.c: (popup_menu_under_arrow):
        * shell/ev-navigation-action.c: (build_menu):
+       
+       Add app-specific icons to our icon theme. Fixes bug
+       #425508.
 
 2007-05-09  Nickolay V. Shmyrev  <nshmyrev@yandex.ru>
 
@@ -29,7 +31,7 @@
        * shell/ev-window.c: (ev_window_setup_action_sensitivity):
        
        Make navigation action unsensitive instead of showing
-       menu with unsensitive word.
+       menu with unsensitive word. Fixes bug #417392.
 
 2007-05-08  Carlos Garcia Campos  <carlosgc@gnome.org>
 
index fafa5017cdeee0797c2b7d88996c6a481b877aca..116ff9c4807c33712fd7094378095e25246718b2 100644 (file)
@@ -27,7 +27,8 @@ static void  ev_navigation_action_widget_init       (EvNavigationActionWidget
 static void  ev_navigation_action_widget_class_init (EvNavigationActionWidgetClass *action_widget);
 static void ev_navigation_action_widget_toggled (GtkToggleToolButton *toggle);
 static gboolean ev_navigation_action_widget_button_press_event (GtkWidget *widget,
-                                                            GdkEventButton    *event);
+                                                               GdkEventButton    *event, 
+                                                               gpointer data);
 
 G_DEFINE_TYPE (EvNavigationActionWidget, ev_navigation_action_widget, GTK_TYPE_TOGGLE_TOOL_BUTTON)
 
@@ -42,19 +43,27 @@ static gint signals[LAST_SIGNAL];
 static void
 ev_navigation_action_widget_init (EvNavigationActionWidget *action_widget)
 {
+       GtkWidget *toggle_button;
+       
+       /* It's rather dirty hack but we need a child to connect to
+        * button press event
+        */
+               
+       toggle_button = gtk_bin_get_child (GTK_BIN (action_widget));
+       
+       g_signal_connect (toggle_button, "button-press-event", 
+                         ev_navigation_action_widget_button_press_event,
+                         action_widget);
        return;
 }
 
 static void
 ev_navigation_action_widget_class_init (EvNavigationActionWidgetClass *klass)
 {
-       GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
        GtkToggleToolButtonClass *toggle_tool_button_class = GTK_TOGGLE_TOOL_BUTTON_CLASS (klass);
 
-       widget_class->button_press_event = ev_navigation_action_widget_button_press_event;
        toggle_tool_button_class->toggled = ev_navigation_action_widget_toggled;
 
-
        signals[SHOW_MENU] =
                  g_signal_new ("show-menu",
                                G_OBJECT_CLASS_TYPE (klass),
@@ -187,9 +196,11 @@ ev_navigation_action_widget_toggled (GtkToggleToolButton *toggle)
 
 static gboolean
 ev_navigation_action_widget_button_press_event (GtkWidget *widget,
-                                               GdkEventButton    *event)
+                                               GdkEventButton    *event,
+                                               gpointer data)
 {
-       EvNavigationActionWidget *button = EV_NAVIGATION_ACTION_WIDGET (widget);
+       EvNavigationActionWidget *button = EV_NAVIGATION_ACTION_WIDGET (data);
+
        if (event->button == 1) {
                 popup_menu_under_arrow (button, event);
                 gtk_toggle_tool_button_set_active (GTK_TOGGLE_TOOL_BUTTON (button), TRUE);