From: Matthias Clasen Date: Fri, 27 Dec 2019 03:41:19 +0000 (-0500) Subject: menutoolbutton: Stop supporting menus X-Git-Tag: archive/raspbian/4.4.1+ds1-2+rpi1^2~18^2~20^2~486^2~23 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=4c9b0d82af46aaea2188a3e3703d2d1455b5093c;p=gtk4.git menutoolbutton: Stop supporting menus --- diff --git a/docs/reference/gtk/gtk4-sections.txt b/docs/reference/gtk/gtk4-sections.txt index 0c9fa7dc4e..8e6e957667 100644 --- a/docs/reference/gtk/gtk4-sections.txt +++ b/docs/reference/gtk/gtk4-sections.txt @@ -3353,8 +3353,8 @@ GtkToolButtonPrivate GtkMenuToolButton GtkMenuToolButton gtk_menu_tool_button_new -gtk_menu_tool_button_set_menu -gtk_menu_tool_button_get_menu +gtk_menu_tool_button_set_popover +gtk_menu_tool_button_get_popover gtk_menu_tool_button_set_arrow_tooltip_text gtk_menu_tool_button_set_arrow_tooltip_markup diff --git a/gtk/gtkmenutoolbutton.c b/gtk/gtkmenutoolbutton.c index efbc6288b2..0f7cd35cb9 100644 --- a/gtk/gtkmenutoolbutton.c +++ b/gtk/gtkmenutoolbutton.c @@ -51,16 +51,8 @@ * # GtkMenuToolButton as GtkBuildable * * The GtkMenuToolButton implementation of the GtkBuildable interface - * supports adding a menu by specifying “menu” as the “type” attribute + * supports adding a popover by specifying “popover” as the “type” attribute * of a element. - * - * An example for a UI definition fragment with menus: - * |[ - * - * - * - * - * * ]| */ @@ -104,7 +96,6 @@ enum enum { PROP_0, - PROP_MENU, PROP_POPOVER }; @@ -208,10 +199,6 @@ gtk_menu_tool_button_set_property (GObject *object, switch (prop_id) { - case PROP_MENU: - gtk_menu_tool_button_set_menu (button, g_value_get_object (value)); - break; - case PROP_POPOVER: gtk_menu_tool_button_set_popover (button, g_value_get_object (value)); break; @@ -232,10 +219,6 @@ gtk_menu_tool_button_get_property (GObject *object, switch (prop_id) { - case PROP_MENU: - g_value_set_object (value, gtk_menu_button_get_popup (GTK_MENU_BUTTON (button->priv->arrow_button))); - break; - case PROP_POPOVER: g_value_set_object (value, gtk_menu_button_get_popover (GTK_MENU_BUTTON (button->priv->arrow_button))); break; @@ -282,13 +265,6 @@ gtk_menu_tool_button_class_init (GtkMenuToolButtonClass *klass) NULL, G_TYPE_NONE, 0); - g_object_class_install_property (object_class, - PROP_MENU, - g_param_spec_object ("menu", - P_("Menu"), - P_("The dropdown menu"), - GTK_TYPE_MENU, - GTK_PARAM_READWRITE)); g_object_class_install_property (object_class, PROP_POPOVER, g_param_spec_object ("popover", @@ -335,10 +311,7 @@ gtk_menu_tool_button_buildable_add_child (GtkBuildable *buildable, GObject *child, const gchar *type) { - if (type && strcmp (type, "menu") == 0) - gtk_menu_tool_button_set_menu (GTK_MENU_TOOL_BUTTON (buildable), - GTK_WIDGET (child)); - else if (type && strcmp (type, "popover") == 0) + if (type && strcmp (type, "popover") == 0) gtk_menu_tool_button_set_popover (GTK_MENU_TOOL_BUTTON (buildable), GTK_WIDGET (child)); else @@ -387,55 +360,6 @@ _show_menu_emit (GtkMenuButton *menu_button, g_signal_emit (button, signals[SHOW_MENU], 0); } -/** - * gtk_menu_tool_button_set_menu: - * @button: a #GtkMenuToolButton - * @menu: the #GtkMenu associated with #GtkMenuToolButton - * - * Sets the #GtkMenu that is popped up when the user clicks on the arrow. - * If @menu is NULL, the arrow button becomes insensitive. - **/ -void -gtk_menu_tool_button_set_menu (GtkMenuToolButton *button, - GtkWidget *menu) -{ - GtkMenuToolButtonPrivate *priv; - - g_return_if_fail (GTK_IS_MENU_TOOL_BUTTON (button)); - g_return_if_fail (GTK_IS_MENU (menu) || menu == NULL); - - priv = button->priv; - - gtk_menu_button_set_popup (GTK_MENU_BUTTON (priv->arrow_button), menu); - gtk_menu_button_set_create_popup_func (GTK_MENU_BUTTON (priv->arrow_button), - _show_menu_emit, NULL, NULL); - - g_object_notify (G_OBJECT (button), "menu"); -} - -/** - * gtk_menu_tool_button_get_menu: - * @button: a #GtkMenuToolButton - * - * Gets the #GtkMenu associated with #GtkMenuToolButton. - * - * Returns: (transfer none): the #GtkMenu associated - * with #GtkMenuToolButton - **/ -GtkWidget * -gtk_menu_tool_button_get_menu (GtkMenuToolButton *button) -{ - GtkMenu *ret; - - g_return_val_if_fail (GTK_IS_MENU_TOOL_BUTTON (button), NULL); - - ret = gtk_menu_button_get_popup (GTK_MENU_BUTTON (button->priv->arrow_button)); - if (!ret) - return NULL; - - return GTK_WIDGET (ret); -} - void gtk_menu_tool_button_set_popover (GtkMenuToolButton *button, GtkWidget *popover) diff --git a/gtk/gtkmenutoolbutton.h b/gtk/gtkmenutoolbutton.h index 3bfdc0ada1..4d3db71995 100644 --- a/gtk/gtkmenutoolbutton.h +++ b/gtk/gtkmenutoolbutton.h @@ -40,11 +40,6 @@ GDK_AVAILABLE_IN_ALL GtkToolItem *gtk_menu_tool_button_new (GtkWidget *icon_widget, const gchar *label); -GDK_AVAILABLE_IN_ALL -void gtk_menu_tool_button_set_menu (GtkMenuToolButton *button, - GtkWidget *menu); -GDK_AVAILABLE_IN_ALL -GtkWidget *gtk_menu_tool_button_get_menu (GtkMenuToolButton *button); GDK_AVAILABLE_IN_ALL void gtk_menu_tool_button_set_popover (GtkMenuToolButton *button, GtkWidget *popover);