Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/shell
diff options
context:
space:
mode:
authorNickolay V. Shmyrev <nshmyrev@yandex.ru>2007-01-30 18:55:12 (GMT)
committer Nickolay V. Shmyrev <nshmyrev@src.gnome.org>2007-01-30 18:55:12 (GMT)
commite98242e3e677e78840e8a417801c2831602831ce (patch)
tree901861b35bc71fb2b54d5cbd481b19fb7931eb78 /shell
parent794bbc93d05e090d7fef7b39f6f0237cbb26fa31 (diff)
Correctly show menu and fix crash when navigaton action is out of toolbar
2007-01-30 Nickolay V. Shmyrev <nshmyrev@yandex.ru> * shell/ev-navigation-action.c: (connect_proxy), (create_menu_item), (ev_navigation_action_class_init): Correctly show menu and fix crash when navigaton action is out of toolbar visible area. svn path=/trunk/; revision=2278
Diffstat (limited to 'shell')
-rw-r--r--shell/ev-navigation-action.c30
1 files changed, 25 insertions, 5 deletions
diff --git a/shell/ev-navigation-action.c b/shell/ev-navigation-action.c
index c87940a..c4f6191 100644
--- a/shell/ev-navigation-action.c
+++ b/shell/ev-navigation-action.c
@@ -166,12 +166,14 @@ connect_proxy (GtkAction *action, GtkWidget *proxy)
{
GtkWidget *menu;
- /* set dummy menu so the arrow gets sensitive */
- menu = gtk_menu_new ();
- ev_navigation_action_widget_set_menu (EV_NAVIGATION_ACTION_WIDGET (proxy), menu);
+ if (EV_IS_NAVIGATION_ACTION (proxy)) {
+ /* set dummy menu so the arrow gets sensitive */
+ menu = gtk_menu_new ();
+ ev_navigation_action_widget_set_menu (EV_NAVIGATION_ACTION_WIDGET (proxy), menu);
- g_signal_connect (proxy, "show-menu",
- G_CALLBACK (menu_activated_cb), action);
+ g_signal_connect (proxy, "show-menu",
+ G_CALLBACK (menu_activated_cb), action);
+ }
GTK_ACTION_CLASS (ev_navigation_action_parent_class)->connect_proxy (action, proxy);
}
@@ -187,6 +189,23 @@ create_tool_item (GtkAction *action)
return GTK_WIDGET (proxy);
}
+static GtkWidget *
+create_menu_item (GtkAction *action)
+{
+ GtkWidget *menu;
+ GtkWidget *menu_item;
+
+ menu = build_menu (EV_NAVIGATION_ACTION (action));
+
+ menu_item = GTK_ACTION_CLASS (ev_navigation_action_parent_class)->create_menu_item (action);
+
+ gtk_menu_item_set_submenu (GTK_MENU_ITEM (menu_item), menu);
+
+ gtk_widget_show (menu_item);
+
+ return menu_item;
+}
+
static void
ev_navigation_action_init (EvNavigationAction *action)
{
@@ -217,6 +236,7 @@ ev_navigation_action_class_init (EvNavigationActionClass *class)
action_class->toolbar_item_type = GTK_TYPE_TOOL_ITEM;
action_class->create_tool_item = create_tool_item;
action_class->connect_proxy = connect_proxy;
+ action_class->create_menu_item = create_menu_item;
widget_signals[WIDGET_ACTIVATE_LINK] = g_signal_new ("activate_link",
G_OBJECT_CLASS_TYPE (object_class),