summaryrefslogtreecommitdiff
path: root/gtk/gtkmenubutton.c
diff options
context:
space:
mode:
authorFlorian Müllner <fmuellner@gnome.org>2020-07-24 13:39:38 +0200
committerFlorian Müllner <fmuellner@gnome.org>2020-07-24 13:55:06 +0200
commitb146c48e2368fdd1d9d8692fbf42721c81548428 (patch)
tree0cc09ef1deaea61496443442e2e4890745745db4 /gtk/gtkmenubutton.c
parent3176d690091ec60d2df2eee4578c74d8d08e41b6 (diff)
downloadgtk+-b146c48e2368fdd1d9d8692fbf42721c81548428.tar.gz
menubutton: Remove align-widget property
The property has been unused since commit 8701e34f749. That was four years ago, so it's safe to say that nobody has been missing it terribly.
Diffstat (limited to 'gtk/gtkmenubutton.c')
-rw-r--r--gtk/gtkmenubutton.c80
1 files changed, 0 insertions, 80 deletions
diff --git a/gtk/gtkmenubutton.c b/gtk/gtkmenubutton.c
index b4e842f0b5..9a8b854437 100644
--- a/gtk/gtkmenubutton.c
+++ b/gtk/gtkmenubutton.c
@@ -146,7 +146,6 @@ struct _GtkMenuButton
GDestroyNotify create_popup_destroy_notify;
GtkWidget *label_widget;
- GtkWidget *align_widget;
GtkWidget *arrow_widget;
GtkArrowType arrow_type;
};
@@ -160,7 +159,6 @@ enum
{
PROP_0,
PROP_MENU_MODEL,
- PROP_ALIGN_WIDGET,
PROP_DIRECTION,
PROP_POPOVER,
PROP_ICON_NAME,
@@ -189,9 +187,6 @@ gtk_menu_button_set_property (GObject *object,
case PROP_MENU_MODEL:
gtk_menu_button_set_menu_model (self, g_value_get_object (value));
break;
- case PROP_ALIGN_WIDGET:
- gtk_menu_button_set_align_widget (self, g_value_get_object (value));
- break;
case PROP_DIRECTION:
gtk_menu_button_set_direction (self, g_value_get_enum (value));
break;
@@ -228,9 +223,6 @@ gtk_menu_button_get_property (GObject *object,
case PROP_MENU_MODEL:
g_value_set_object (value, self->model);
break;
- case PROP_ALIGN_WIDGET:
- g_value_set_object (value, self->align_widget);
- break;
case PROP_DIRECTION:
g_value_set_enum (value, self->arrow_type);
break;
@@ -373,18 +365,6 @@ gtk_menu_button_class_init (GtkMenuButtonClass *klass)
GTK_PARAM_READWRITE);
/**
- * GtkMenuButton:align-widget:
- *
- * The #GtkWidget to use to align the menu with.
- */
- menu_button_props[PROP_ALIGN_WIDGET] =
- g_param_spec_object ("align-widget",
- P_("Align with"),
- P_("The parent widget which the menu should align with."),
- GTK_TYPE_WIDGET,
- GTK_PARAM_READWRITE);
-
- /**
* GtkMenuButton:direction:
*
* The #GtkArrowType representing the direction in which the
@@ -589,64 +569,6 @@ gtk_menu_button_get_menu_model (GtkMenuButton *menu_button)
}
static void
-set_align_widget_pointer (GtkMenuButton *self,
- GtkWidget *align_widget)
-{
- if (self->align_widget)
- g_object_remove_weak_pointer (G_OBJECT (self->align_widget), (gpointer *) &self->align_widget);
-
- self->align_widget = align_widget;
-
- if (self->align_widget)
- g_object_add_weak_pointer (G_OBJECT (self->align_widget), (gpointer *) &self->align_widget);
-}
-
-/**
- * gtk_menu_button_set_align_widget:
- * @menu_button: a #GtkMenuButton
- * @align_widget: (allow-none): a #GtkWidget
- *
- * Sets the #GtkWidget to use to line the menu with when popped up.
- * Note that the @align_widget must contain the #GtkMenuButton itself.
- *
- * Setting it to %NULL means that the menu will be aligned with the
- * button itself.
- *
- * Note that this property is only used with menus currently,
- * and not for popovers.
- */
-void
-gtk_menu_button_set_align_widget (GtkMenuButton *menu_button,
- GtkWidget *align_widget)
-{
- g_return_if_fail (GTK_IS_MENU_BUTTON (menu_button));
- g_return_if_fail (align_widget == NULL || gtk_widget_is_ancestor (GTK_WIDGET (menu_button), align_widget));
-
- if (menu_button->align_widget == align_widget)
- return;
-
- set_align_widget_pointer (menu_button, align_widget);
-
- g_object_notify_by_pspec (G_OBJECT (menu_button), menu_button_props[PROP_ALIGN_WIDGET]);
-}
-
-/**
- * gtk_menu_button_get_align_widget:
- * @menu_button: a #GtkMenuButton
- *
- * Returns the parent #GtkWidget to use to line up with menu.
- *
- * Returns: (nullable) (transfer none): a #GtkWidget value or %NULL
- */
-GtkWidget *
-gtk_menu_button_get_align_widget (GtkMenuButton *menu_button)
-{
- g_return_val_if_fail (GTK_IS_MENU_BUTTON (menu_button), NULL);
-
- return menu_button->align_widget;
-}
-
-static void
update_popover_direction (GtkMenuButton *self)
{
if (!self->popover)
@@ -746,8 +668,6 @@ gtk_menu_button_dispose (GObject *object)
self->popover = NULL;
}
- set_align_widget_pointer (GTK_MENU_BUTTON (object), NULL);
-
g_clear_object (&self->model);
g_clear_pointer (&self->button, gtk_widget_unparent);