[gtk/kill-tree-menu: 19/39] menutoolbutton: Stop supporting menus



commit b02f9c2500ede15c2b1a991311acd82a3c7dc75c
Author: Matthias Clasen <mclasen redhat com>
Date:   Thu Dec 26 22:41:19 2019 -0500

    menutoolbutton: Stop supporting menus

 docs/reference/gtk/gtk4-sections.txt |  4 +-
 gtk/gtkmenutoolbutton.c              | 80 +-----------------------------------
 gtk/gtkmenutoolbutton.h              |  5 ---
 3 files changed, 4 insertions(+), 85 deletions(-)
---
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
 <TITLE>GtkMenuToolButton</TITLE>
 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 <child> element.
- *
- * An example for a UI definition fragment with menus:
- * |[
- * <object class="GtkMenuToolButton">
- *   <child type="menu">
- *     <object class="GtkMenu"/>
- *   </child>
- * </object>
  * ]|
  */
 
@@ -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);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]