mirror of https://github.com/GNOME/gimp.git
Replace lots of deprecated gtk_menu_popup(), only GimpUIManager left
This commit is contained in:
parent
251d2f494e
commit
6c8cf7876a
|
@ -28,8 +28,6 @@
|
|||
|
||||
#include "propgui-types.h"
|
||||
|
||||
#include "widgets/gimpwidgets-utils.h"
|
||||
|
||||
#include "gimppropgui-utils.h"
|
||||
|
||||
#include "gimp-intl.h"
|
||||
|
@ -37,18 +35,13 @@
|
|||
|
||||
/* local function prototypes */
|
||||
|
||||
static void gimp_prop_kelvin_presets_menu_position (GtkMenu *menu,
|
||||
gint *x,
|
||||
gint *y,
|
||||
gboolean *push_in,
|
||||
gpointer user_data);
|
||||
static gboolean gimp_prop_kelvin_presets_button_press (GtkWidget *widget,
|
||||
GdkEventButton *bevent,
|
||||
GtkMenu *menu);
|
||||
static void gimp_prop_kelvin_presets_activate (GtkWidget *widget,
|
||||
GObject *config);
|
||||
static void gimp_prop_random_seed_new_clicked (GtkButton *button,
|
||||
GtkAdjustment *adj);
|
||||
static gboolean gimp_prop_kelvin_presets_button_press (GtkWidget *widget,
|
||||
GdkEventButton *bevent,
|
||||
GtkMenu *menu);
|
||||
static void gimp_prop_kelvin_presets_activate (GtkWidget *widget,
|
||||
GObject *config);
|
||||
static void gimp_prop_random_seed_new_clicked (GtkButton *button,
|
||||
GtkAdjustment *adj);
|
||||
|
||||
|
||||
/* public functions */
|
||||
|
@ -168,16 +161,6 @@ gimp_prop_random_seed_new (GObject *config,
|
|||
|
||||
/* private functions */
|
||||
|
||||
static void
|
||||
gimp_prop_kelvin_presets_menu_position (GtkMenu *menu,
|
||||
gint *x,
|
||||
gint *y,
|
||||
gboolean *push_in,
|
||||
gpointer user_data)
|
||||
{
|
||||
gimp_button_menu_position (user_data, menu, GTK_POS_LEFT, x, y);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gimp_prop_kelvin_presets_button_press (GtkWidget *widget,
|
||||
GdkEventButton *bevent,
|
||||
|
@ -185,10 +168,10 @@ gimp_prop_kelvin_presets_button_press (GtkWidget *widget,
|
|||
{
|
||||
if (bevent->type == GDK_BUTTON_PRESS)
|
||||
{
|
||||
gtk_menu_popup (menu,
|
||||
NULL, NULL,
|
||||
gimp_prop_kelvin_presets_menu_position, widget,
|
||||
bevent->button, bevent->time);
|
||||
gtk_menu_popup_at_widget (menu, widget,
|
||||
GDK_GRAVITY_WEST,
|
||||
GDK_GRAVITY_NORTH_EAST,
|
||||
(GdkEvent *) bevent);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
|
|
|
@ -50,7 +50,6 @@
|
|||
#include "gimpmeter.h"
|
||||
#include "gimpsessioninfo-aux.h"
|
||||
#include "gimpuimanager.h"
|
||||
#include "gimpwidgets-utils.h"
|
||||
#include "gimpwindowstrategy.h"
|
||||
|
||||
#include "gimp-intl.h"
|
||||
|
@ -301,12 +300,6 @@ static void gimp_dashboard_sample_object (GimpDashboard
|
|||
static void gimp_dashboard_container_remove (GtkWidget *widget,
|
||||
GtkContainer *container);
|
||||
|
||||
static void gimp_dashboard_group_menu_position (GtkMenu *menu,
|
||||
gint *x,
|
||||
gint *y,
|
||||
gboolean *push_in,
|
||||
gpointer user_data);
|
||||
|
||||
static void gimp_dashboard_update_groups (GimpDashboard *dashboard);
|
||||
static void gimp_dashboard_update_group (GimpDashboard *dashboard,
|
||||
Group group);
|
||||
|
@ -1256,11 +1249,11 @@ gimp_dashboard_group_expander_button_press (GimpDashboard *dashboard,
|
|||
bevent->y >= allocation.y &&
|
||||
bevent->y < allocation.y + allocation.height)
|
||||
{
|
||||
gtk_menu_popup (group_data->menu,
|
||||
NULL, NULL,
|
||||
gimp_dashboard_group_menu_position,
|
||||
group_data->menu_button,
|
||||
bevent->button, bevent->time);
|
||||
gtk_menu_popup_at_widget (group_data->menu,
|
||||
GTK_WIDGET (group_data->menu_button),
|
||||
GDK_GRAVITY_WEST,
|
||||
GDK_GRAVITY_NORTH_EAST,
|
||||
(GdkEvent *) bevent);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -1900,16 +1893,6 @@ gimp_dashboard_container_remove (GtkWidget *widget,
|
|||
gtk_container_remove (container, widget);
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_dashboard_group_menu_position (GtkMenu *menu,
|
||||
gint *x,
|
||||
gint *y,
|
||||
gboolean *push_in,
|
||||
gpointer user_data)
|
||||
{
|
||||
gimp_button_menu_position (user_data, menu, GTK_POS_LEFT, x, y);
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_dashboard_update_groups (GimpDashboard *dashboard)
|
||||
{
|
||||
|
|
|
@ -39,7 +39,6 @@
|
|||
#include "gimpcontainerview.h"
|
||||
#include "gimpsettingsbox.h"
|
||||
#include "gimpsettingseditor.h"
|
||||
#include "gimpwidgets-utils.h"
|
||||
|
||||
#include "gimp-intl.h"
|
||||
|
||||
|
@ -575,16 +574,6 @@ gimp_settings_box_setting_selected (GimpContainerView *view,
|
|||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_settings_box_menu_position (GtkMenu *menu,
|
||||
gint *x,
|
||||
gint *y,
|
||||
gboolean *push_in,
|
||||
gpointer user_data)
|
||||
{
|
||||
gimp_button_menu_position (user_data, menu, GTK_POS_LEFT, x, y);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gimp_settings_box_menu_press (GtkWidget *widget,
|
||||
GdkEventButton *bevent,
|
||||
|
@ -594,10 +583,10 @@ gimp_settings_box_menu_press (GtkWidget *widget,
|
|||
|
||||
if (bevent->type == GDK_BUTTON_PRESS)
|
||||
{
|
||||
gtk_menu_popup (GTK_MENU (private->menu),
|
||||
NULL, NULL,
|
||||
gimp_settings_box_menu_position, widget,
|
||||
bevent->button, bevent->time);
|
||||
gtk_menu_popup_at_widget (GTK_MENU (private->menu), widget,
|
||||
GDK_GRAVITY_WEST,
|
||||
GDK_GRAVITY_NORTH_EAST,
|
||||
(GdkEvent *) bevent);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
|
|
|
@ -535,9 +535,7 @@ gimp_color_button_button_press (GtkWidget *widget,
|
|||
|
||||
gtk_menu_set_screen (GTK_MENU (menu), gtk_widget_get_screen (widget));
|
||||
|
||||
gtk_menu_popup (GTK_MENU (menu),
|
||||
NULL, NULL, NULL, NULL,
|
||||
bevent->button, bevent->time);
|
||||
gtk_menu_popup_at_pointer (GTK_MENU (menu), (GdkEvent *) bevent);
|
||||
}
|
||||
|
||||
return GTK_WIDGET_CLASS (parent_class)->button_press_event (widget, bevent);
|
||||
|
|
|
@ -1946,10 +1946,5 @@ gimp_preview_area_menu_popup (GimpPreviewArea *area,
|
|||
gtk_menu_shell_append (GTK_MENU_SHELL (menu),
|
||||
gimp_preview_area_menu_new (area, "check-size"));
|
||||
|
||||
if (event)
|
||||
gtk_menu_popup (GTK_MENU (menu),
|
||||
NULL, NULL, NULL, NULL, event->button, event->time);
|
||||
else
|
||||
gtk_menu_popup (GTK_MENU (menu),
|
||||
NULL, NULL, NULL, NULL, 0, gtk_get_current_event_time ());
|
||||
gtk_menu_popup_at_pointer (GTK_MENU (menu), (GdkEvent *) event);
|
||||
}
|
||||
|
|
|
@ -305,10 +305,7 @@ popup_menu (GtkWidget *widget,
|
|||
GtkWidget *menu = gtk_ui_manager_get_widget (ui_manager, "/anim-play-popup");
|
||||
|
||||
gtk_menu_set_screen (GTK_MENU (menu), gtk_widget_get_screen (widget));
|
||||
gtk_menu_popup (GTK_MENU (menu),
|
||||
NULL, NULL, NULL, NULL,
|
||||
event ? event->button : 0,
|
||||
event ? event->time : gtk_get_current_event_time ());
|
||||
gtk_menu_popup_at_pointer (GTK_MENU (menu), (GdkEvent *) event);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
|
|
@ -557,10 +557,7 @@ remap_popup_menu (GtkWidget *widget,
|
|||
GtkWidget *menu = gtk_ui_manager_get_widget (remap_ui, "/remap-popup");
|
||||
|
||||
gtk_menu_set_screen (GTK_MENU (menu), gtk_widget_get_screen (widget));
|
||||
gtk_menu_popup (GTK_MENU (menu),
|
||||
NULL, NULL, NULL, NULL,
|
||||
event ? event->button : 0,
|
||||
event ? event->time : gtk_get_current_event_time ());
|
||||
gtk_menu_popup_at_pointer (GTK_MENU (menu), (GdkEvent *) event);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
|
|
@ -1058,10 +1058,7 @@ view_popup_menu (GtkWidget *widget,
|
|||
menu = gtk_ui_manager_get_widget (ui_manager, path);
|
||||
|
||||
gtk_menu_set_screen (GTK_MENU (menu), gtk_widget_get_screen (widget));
|
||||
gtk_menu_popup (GTK_MENU (menu),
|
||||
NULL, NULL, NULL, NULL,
|
||||
event ? event->button : 0,
|
||||
event ? event->time : gtk_get_current_event_time ());
|
||||
gtk_menu_popup_at_pointer (GTK_MENU (menu), (GdkEvent *) event);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
|
|
@ -1593,9 +1593,7 @@ design_area_button_press (GtkWidget *widget,
|
|||
|
||||
gtk_menu_set_screen (GTK_MENU (menu), gtk_widget_get_screen (widget));
|
||||
|
||||
gtk_menu_popup (GTK_MENU (menu),
|
||||
NULL, NULL, NULL, NULL,
|
||||
event->button, event->time);
|
||||
gtk_menu_popup_at_pointer (GTK_MENU (menu), (GdkEvent *) event);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
|
|
@ -493,8 +493,8 @@ void
|
|||
do_main_popup_menu(GdkEventButton *event)
|
||||
{
|
||||
GtkWidget *popup = gtk_ui_manager_get_widget (ui_manager, "/PopupMenu");
|
||||
gtk_menu_popup (GTK_MENU (popup), NULL, NULL, NULL, NULL,
|
||||
event->button, event->time);
|
||||
|
||||
gtk_menu_popup_at_pointer (GTK_MENU (popup), (GdkEvent *) event);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -42,8 +42,7 @@ object_handle_popup(ObjectPopup_t *popup, Object_t *obj, GdkEventButton *event)
|
|||
(position < g_list_length(obj->list->list))
|
||||
? TRUE : FALSE);
|
||||
#endif
|
||||
gtk_menu_popup(GTK_MENU(popup->menu), NULL, NULL, NULL, NULL,
|
||||
event->button, event->time);
|
||||
gtk_menu_popup_at_pointer (GTK_MENU (popup->menu), (GdkEvent *) event);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -719,8 +719,7 @@ polygon_handle_popup (GdkEventButton *event, gboolean near_sash,
|
|||
gtk_widget_set_sensitive (delete, near_sash);
|
||||
gtk_widget_set_sensitive (insert, near_edge);
|
||||
|
||||
gtk_menu_popup(GTK_MENU(popup), NULL, NULL, NULL, NULL,
|
||||
event->button, event->time);
|
||||
gtk_menu_popup_at_pointer (GTK_MENU (popup), (GdkEvent *) event);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
Loading…
Reference in New Issue