diff options
-rw-r--r-- | ChangeLog | 9 | ||||
-rw-r--r-- | src/bookmarks/ephy-bookmark-action.c | 19 | ||||
-rw-r--r-- | src/bookmarks/ephy-topic-action.c | 22 |
3 files changed, 41 insertions, 9 deletions
@@ -1,5 +1,14 @@ 2004-07-02 Marco Pesenti Gritti <marco@gnome.org> + * src/bookmarks/ephy-bookmark-action.c: (show_context_menu), + (popup_menu_cb), (button_press_cb), (connect_proxy): + * src/bookmarks/ephy-topic-action.c: (show_context_menu), + (popup_menu_cb), (button_press_cb), (connect_proxy): + + Follow popups keybindings. + +2004-07-02 Marco Pesenti Gritti <marco@gnome.org> + * src/bookmarks/ephy-bookmark-action.c: (open_in_tab_activate_cb), (open_in_window_activate_cb), (remove_from_model), (drag_data_delete_cb), (remove_activate_cb), (show_context_menu), diff --git a/src/bookmarks/ephy-bookmark-action.c b/src/bookmarks/ephy-bookmark-action.c index 26b592a84..d0e1840ff 100644 --- a/src/bookmarks/ephy-bookmark-action.c +++ b/src/bookmarks/ephy-bookmark-action.c @@ -448,7 +448,8 @@ remove_activate_cb (GtkWidget *menu, GtkWidget *proxy) } static void -show_context_menu (EphyBookmarkAction *action, GtkWidget *proxy) +show_context_menu (EphyBookmarkAction *action, GtkWidget *proxy, + GtkMenuPositionFunc func) { GtkWidget *menu, *item; @@ -476,10 +477,20 @@ show_context_menu (EphyBookmarkAction *action, GtkWidget *proxy) g_signal_connect (item, "activate", G_CALLBACK (remove_activate_cb), proxy); - gtk_menu_popup (GTK_MENU (menu), NULL, NULL, NULL, NULL, 3, + gtk_menu_popup (GTK_MENU (menu), NULL, NULL, func, proxy, 3, gtk_get_current_event_time ()); } +static void +popup_menu_cb (GtkWidget *widget, EphyBookmarkAction *action) +{ + if (gtk_widget_get_ancestor (widget, EPHY_TYPE_BOOKMARKSBAR)) + { + show_context_menu (action, widget, + ephy_gui_menu_position_under_widget); + } +} + static gboolean button_press_cb (GtkWidget *widget, GdkEventButton *event, @@ -488,7 +499,7 @@ button_press_cb (GtkWidget *widget, if (event->button == 3 && gtk_widget_get_ancestor (widget, EPHY_TYPE_BOOKMARKSBAR)) { - show_context_menu (action, widget); + show_context_menu (action, widget, NULL); return TRUE; } else if (event->button == 2) @@ -549,6 +560,8 @@ connect_proxy (GtkAction *action, GtkWidget *proxy) { button = GTK_WIDGET (g_object_get_data (G_OBJECT (proxy), "button")); g_signal_connect (button, "clicked", G_CALLBACK (activate_cb), action); + g_signal_connect (button, "popup_menu", + G_CALLBACK (popup_menu_cb), action); g_signal_connect (button, "button-press-event", G_CALLBACK (button_press_cb), action); g_signal_connect (button, "button-release-event", diff --git a/src/bookmarks/ephy-topic-action.c b/src/bookmarks/ephy-topic-action.c index 436b1f5ca..013f54c6d 100644 --- a/src/bookmarks/ephy-topic-action.c +++ b/src/bookmarks/ephy-topic-action.c @@ -562,7 +562,8 @@ create_menu_item (GtkAction *action) } static void -show_context_menu (EphyTopicAction *action, GtkWidget *proxy) +show_context_menu (EphyTopicAction *action, GtkWidget *proxy, + GtkMenuPositionFunc func) { GtkWidget *menu, *item; @@ -580,10 +581,20 @@ show_context_menu (EphyTopicAction *action, GtkWidget *proxy) g_signal_connect (item, "activate", G_CALLBACK (remove_activate_cb), proxy); - gtk_menu_popup (GTK_MENU (menu), NULL, NULL, NULL, NULL, 3, + gtk_menu_popup (GTK_MENU (menu), NULL, NULL, func, proxy, 3, gtk_get_current_event_time ()); } +static void +popup_menu_cb (GtkWidget *widget, EphyTopicAction *action) +{ + if (gtk_widget_get_ancestor (widget, EPHY_TYPE_BOOKMARKSBAR)) + { + show_context_menu (action, widget, + ephy_gui_menu_position_under_widget); + } +} + static gboolean button_press_cb (GtkWidget *widget, GdkEventButton *event, @@ -592,7 +603,7 @@ button_press_cb (GtkWidget *widget, if (event->button == 3 && gtk_widget_get_ancestor (widget, EPHY_TYPE_BOOKMARKSBAR)) { - show_context_menu (action, widget); + show_context_menu (action, widget, NULL); return TRUE; } @@ -617,11 +628,10 @@ connect_proxy (GtkAction *action, GtkWidget *proxy) button = GTK_WIDGET (g_object_get_data (G_OBJECT (proxy), "button")); g_signal_connect (button, "toggled", G_CALLBACK (button_toggled_cb), action); - + g_signal_connect (button, "popup_menu", + G_CALLBACK (popup_menu_cb), action); g_signal_connect (button, "button-press-event", G_CALLBACK (button_press_cb), action); - - /* We want the menu to popup up on mouse down */ g_signal_connect (button, "pressed", G_CALLBACK (button_pressed_cb), action); } |