diff options
author | raveit65 <[email protected]> | 2018-05-09 13:08:34 +0200 |
---|---|---|
committer | raveit65 <[email protected]> | 2018-05-13 22:03:02 +0200 |
commit | f3bc78de1cc21c5d10c8e06acf4c3879343db938 (patch) | |
tree | 7cc7964d3661a7bc4aec4216fce3911be3b3cf6f /src | |
parent | 620071bfb08e1c6646dbde0e8eca990ac6ec33db (diff) | |
download | eom-f3bc78de1cc21c5d10c8e06acf4c3879343db938.tar.bz2 eom-f3bc78de1cc21c5d10c8e06acf4c3879343db938.tar.xz |
sidebar: replace deprecated gtk_menu_popup
Diffstat (limited to 'src')
-rw-r--r-- | src/eom-sidebar.c | 40 |
1 files changed, 10 insertions, 30 deletions
diff --git a/src/eom-sidebar.c b/src/eom-sidebar.c index 197eba8..744029d 100644 --- a/src/eom-sidebar.c +++ b/src/eom-sidebar.c @@ -222,30 +222,6 @@ eom_sidebar_class_init (EomSidebarClass *eom_sidebar_class) GTK_TYPE_WIDGET); } -static void -eom_sidebar_menu_position_under (GtkMenu *menu, - gint *x, - gint *y, - gboolean *push_in, - gpointer user_data) -{ - GtkWidget *widget; - GtkAllocation allocation; - - g_return_if_fail (GTK_IS_BUTTON (user_data)); - g_return_if_fail (!gtk_widget_get_has_window (user_data)); - - widget = GTK_WIDGET (user_data); - gtk_widget_get_allocation (widget, &allocation); - - gdk_window_get_origin (gtk_widget_get_window (widget), x, y); - - *x += allocation.x; - *y += allocation.y + allocation.height; - - *push_in = FALSE; -} - static gboolean eom_sidebar_select_button_press_cb (GtkWidget *widget, GdkEventButton *event, @@ -269,9 +245,11 @@ eom_sidebar_select_button_press_cb (GtkWidget *widget, gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), TRUE); - gtk_menu_popup (GTK_MENU (eom_sidebar->priv->menu), - NULL, NULL, eom_sidebar_menu_position_under, widget, - event->button, event->time); + gtk_menu_popup_at_widget (GTK_MENU (eom_sidebar->priv->menu), + widget, + GDK_GRAVITY_SOUTH_WEST, + GDK_GRAVITY_NORTH_WEST, + (const GdkEvent*) event); return TRUE; } @@ -292,9 +270,11 @@ eom_sidebar_select_button_key_press_cb (GtkWidget *widget, event->keyval == GDK_KEY_KP_Enter) { gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), TRUE); - gtk_menu_popup (GTK_MENU (eom_sidebar->priv->menu), - NULL, NULL, eom_sidebar_menu_position_under, widget, - 1, event->time); + gtk_menu_popup_at_widget (GTK_MENU (eom_sidebar->priv->menu), + widget, + GDK_GRAVITY_SOUTH_WEST, + GDK_GRAVITY_NORTH_WEST, + (const GdkEvent*) event); return TRUE; } |