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 "propgui-types.h"
|
||||||
|
|
||||||
#include "widgets/gimpwidgets-utils.h"
|
|
||||||
|
|
||||||
#include "gimppropgui-utils.h"
|
#include "gimppropgui-utils.h"
|
||||||
|
|
||||||
#include "gimp-intl.h"
|
#include "gimp-intl.h"
|
||||||
|
@ -37,11 +35,6 @@
|
||||||
|
|
||||||
/* local function prototypes */
|
/* 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,
|
static gboolean gimp_prop_kelvin_presets_button_press (GtkWidget *widget,
|
||||||
GdkEventButton *bevent,
|
GdkEventButton *bevent,
|
||||||
GtkMenu *menu);
|
GtkMenu *menu);
|
||||||
|
@ -168,16 +161,6 @@ gimp_prop_random_seed_new (GObject *config,
|
||||||
|
|
||||||
/* private functions */
|
/* 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
|
static gboolean
|
||||||
gimp_prop_kelvin_presets_button_press (GtkWidget *widget,
|
gimp_prop_kelvin_presets_button_press (GtkWidget *widget,
|
||||||
GdkEventButton *bevent,
|
GdkEventButton *bevent,
|
||||||
|
@ -185,10 +168,10 @@ gimp_prop_kelvin_presets_button_press (GtkWidget *widget,
|
||||||
{
|
{
|
||||||
if (bevent->type == GDK_BUTTON_PRESS)
|
if (bevent->type == GDK_BUTTON_PRESS)
|
||||||
{
|
{
|
||||||
gtk_menu_popup (menu,
|
gtk_menu_popup_at_widget (menu, widget,
|
||||||
NULL, NULL,
|
GDK_GRAVITY_WEST,
|
||||||
gimp_prop_kelvin_presets_menu_position, widget,
|
GDK_GRAVITY_NORTH_EAST,
|
||||||
bevent->button, bevent->time);
|
(GdkEvent *) bevent);
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
|
@ -50,7 +50,6 @@
|
||||||
#include "gimpmeter.h"
|
#include "gimpmeter.h"
|
||||||
#include "gimpsessioninfo-aux.h"
|
#include "gimpsessioninfo-aux.h"
|
||||||
#include "gimpuimanager.h"
|
#include "gimpuimanager.h"
|
||||||
#include "gimpwidgets-utils.h"
|
|
||||||
#include "gimpwindowstrategy.h"
|
#include "gimpwindowstrategy.h"
|
||||||
|
|
||||||
#include "gimp-intl.h"
|
#include "gimp-intl.h"
|
||||||
|
@ -301,12 +300,6 @@ static void gimp_dashboard_sample_object (GimpDashboard
|
||||||
static void gimp_dashboard_container_remove (GtkWidget *widget,
|
static void gimp_dashboard_container_remove (GtkWidget *widget,
|
||||||
GtkContainer *container);
|
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_groups (GimpDashboard *dashboard);
|
||||||
static void gimp_dashboard_update_group (GimpDashboard *dashboard,
|
static void gimp_dashboard_update_group (GimpDashboard *dashboard,
|
||||||
Group group);
|
Group group);
|
||||||
|
@ -1256,11 +1249,11 @@ gimp_dashboard_group_expander_button_press (GimpDashboard *dashboard,
|
||||||
bevent->y >= allocation.y &&
|
bevent->y >= allocation.y &&
|
||||||
bevent->y < allocation.y + allocation.height)
|
bevent->y < allocation.y + allocation.height)
|
||||||
{
|
{
|
||||||
gtk_menu_popup (group_data->menu,
|
gtk_menu_popup_at_widget (group_data->menu,
|
||||||
NULL, NULL,
|
GTK_WIDGET (group_data->menu_button),
|
||||||
gimp_dashboard_group_menu_position,
|
GDK_GRAVITY_WEST,
|
||||||
group_data->menu_button,
|
GDK_GRAVITY_NORTH_EAST,
|
||||||
bevent->button, bevent->time);
|
(GdkEvent *) bevent);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@ -1900,16 +1893,6 @@ gimp_dashboard_container_remove (GtkWidget *widget,
|
||||||
gtk_container_remove (container, 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
|
static void
|
||||||
gimp_dashboard_update_groups (GimpDashboard *dashboard)
|
gimp_dashboard_update_groups (GimpDashboard *dashboard)
|
||||||
{
|
{
|
||||||
|
|
|
@ -39,7 +39,6 @@
|
||||||
#include "gimpcontainerview.h"
|
#include "gimpcontainerview.h"
|
||||||
#include "gimpsettingsbox.h"
|
#include "gimpsettingsbox.h"
|
||||||
#include "gimpsettingseditor.h"
|
#include "gimpsettingseditor.h"
|
||||||
#include "gimpwidgets-utils.h"
|
|
||||||
|
|
||||||
#include "gimp-intl.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
|
static gboolean
|
||||||
gimp_settings_box_menu_press (GtkWidget *widget,
|
gimp_settings_box_menu_press (GtkWidget *widget,
|
||||||
GdkEventButton *bevent,
|
GdkEventButton *bevent,
|
||||||
|
@ -594,10 +583,10 @@ gimp_settings_box_menu_press (GtkWidget *widget,
|
||||||
|
|
||||||
if (bevent->type == GDK_BUTTON_PRESS)
|
if (bevent->type == GDK_BUTTON_PRESS)
|
||||||
{
|
{
|
||||||
gtk_menu_popup (GTK_MENU (private->menu),
|
gtk_menu_popup_at_widget (GTK_MENU (private->menu), widget,
|
||||||
NULL, NULL,
|
GDK_GRAVITY_WEST,
|
||||||
gimp_settings_box_menu_position, widget,
|
GDK_GRAVITY_NORTH_EAST,
|
||||||
bevent->button, bevent->time);
|
(GdkEvent *) bevent);
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
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_set_screen (GTK_MENU (menu), gtk_widget_get_screen (widget));
|
||||||
|
|
||||||
gtk_menu_popup (GTK_MENU (menu),
|
gtk_menu_popup_at_pointer (GTK_MENU (menu), (GdkEvent *) bevent);
|
||||||
NULL, NULL, NULL, NULL,
|
|
||||||
bevent->button, bevent->time);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return GTK_WIDGET_CLASS (parent_class)->button_press_event (widget, 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),
|
gtk_menu_shell_append (GTK_MENU_SHELL (menu),
|
||||||
gimp_preview_area_menu_new (area, "check-size"));
|
gimp_preview_area_menu_new (area, "check-size"));
|
||||||
|
|
||||||
if (event)
|
gtk_menu_popup_at_pointer (GTK_MENU (menu), (GdkEvent *) 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 ());
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -305,10 +305,7 @@ popup_menu (GtkWidget *widget,
|
||||||
GtkWidget *menu = gtk_ui_manager_get_widget (ui_manager, "/anim-play-popup");
|
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_set_screen (GTK_MENU (menu), gtk_widget_get_screen (widget));
|
||||||
gtk_menu_popup (GTK_MENU (menu),
|
gtk_menu_popup_at_pointer (GTK_MENU (menu), (GdkEvent *) event);
|
||||||
NULL, NULL, NULL, NULL,
|
|
||||||
event ? event->button : 0,
|
|
||||||
event ? event->time : gtk_get_current_event_time ());
|
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -557,10 +557,7 @@ remap_popup_menu (GtkWidget *widget,
|
||||||
GtkWidget *menu = gtk_ui_manager_get_widget (remap_ui, "/remap-popup");
|
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_set_screen (GTK_MENU (menu), gtk_widget_get_screen (widget));
|
||||||
gtk_menu_popup (GTK_MENU (menu),
|
gtk_menu_popup_at_pointer (GTK_MENU (menu), (GdkEvent *) event);
|
||||||
NULL, NULL, NULL, NULL,
|
|
||||||
event ? event->button : 0,
|
|
||||||
event ? event->time : gtk_get_current_event_time ());
|
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1058,10 +1058,7 @@ view_popup_menu (GtkWidget *widget,
|
||||||
menu = gtk_ui_manager_get_widget (ui_manager, path);
|
menu = gtk_ui_manager_get_widget (ui_manager, path);
|
||||||
|
|
||||||
gtk_menu_set_screen (GTK_MENU (menu), gtk_widget_get_screen (widget));
|
gtk_menu_set_screen (GTK_MENU (menu), gtk_widget_get_screen (widget));
|
||||||
gtk_menu_popup (GTK_MENU (menu),
|
gtk_menu_popup_at_pointer (GTK_MENU (menu), (GdkEvent *) event);
|
||||||
NULL, NULL, NULL, NULL,
|
|
||||||
event ? event->button : 0,
|
|
||||||
event ? event->time : gtk_get_current_event_time ());
|
|
||||||
|
|
||||||
return TRUE;
|
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_set_screen (GTK_MENU (menu), gtk_widget_get_screen (widget));
|
||||||
|
|
||||||
gtk_menu_popup (GTK_MENU (menu),
|
gtk_menu_popup_at_pointer (GTK_MENU (menu), (GdkEvent *) event);
|
||||||
NULL, NULL, NULL, NULL,
|
|
||||||
event->button, event->time);
|
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -493,8 +493,8 @@ void
|
||||||
do_main_popup_menu(GdkEventButton *event)
|
do_main_popup_menu(GdkEventButton *event)
|
||||||
{
|
{
|
||||||
GtkWidget *popup = gtk_ui_manager_get_widget (ui_manager, "/PopupMenu");
|
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
|
void
|
||||||
|
|
|
@ -42,8 +42,7 @@ object_handle_popup(ObjectPopup_t *popup, Object_t *obj, GdkEventButton *event)
|
||||||
(position < g_list_length(obj->list->list))
|
(position < g_list_length(obj->list->list))
|
||||||
? TRUE : FALSE);
|
? TRUE : FALSE);
|
||||||
#endif
|
#endif
|
||||||
gtk_menu_popup(GTK_MENU(popup->menu), NULL, NULL, NULL, NULL,
|
gtk_menu_popup_at_pointer (GTK_MENU (popup->menu), (GdkEvent *) event);
|
||||||
event->button, event->time);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -719,8 +719,7 @@ polygon_handle_popup (GdkEventButton *event, gboolean near_sash,
|
||||||
gtk_widget_set_sensitive (delete, near_sash);
|
gtk_widget_set_sensitive (delete, near_sash);
|
||||||
gtk_widget_set_sensitive (insert, near_edge);
|
gtk_widget_set_sensitive (insert, near_edge);
|
||||||
|
|
||||||
gtk_menu_popup(GTK_MENU(popup), NULL, NULL, NULL, NULL,
|
gtk_menu_popup_at_pointer (GTK_MENU (popup), (GdkEvent *) event);
|
||||||
event->button, event->time);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
Loading…
Reference in New Issue