[gtk+/gtk-3-22] spinbutton: Fix some gadget handling issues
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-3-22] spinbutton: Fix some gadget handling issues
- Date: Thu, 10 Nov 2016 19:48:05 +0000 (UTC)
commit f8900e5ac46463a6149a94babb328b6c0073bb21
Author: Matthias Clasen <mclasen redhat com>
Date: Thu Nov 10 14:46:21 2016 -0500
spinbutton: Fix some gadget handling issues
We were not adding the down_button gadget to the parent,
and we were not unreffing the button gadgets.
https://bugzilla.gnome.org/show_bug.cgi?id=774046
gtk/gtkspinbutton.c | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/gtk/gtkspinbutton.c b/gtk/gtkspinbutton.c
index 9e5e4c7..277fa2b 100644
--- a/gtk/gtkspinbutton.c
+++ b/gtk/gtkspinbutton.c
@@ -813,7 +813,7 @@ gtk_spin_button_init (GtkSpinButton *spin_button)
gtk_css_gadget_add_class (priv->down_button, "down");
gtk_css_node_set_parent (gtk_css_gadget_get_node (priv->down_button), widget_node);
gtk_css_node_set_state (gtk_css_gadget_get_node (priv->down_button), gtk_css_node_get_state (widget_node));
- gtk_box_gadget_insert_gadget (GTK_BOX_GADGET (priv->gadget),
+ gtk_box_gadget_insert_gadget (GTK_BOX_GADGET (priv->gadget),
-1, priv->down_button,
FALSE, GTK_ALIGN_FILL);
@@ -822,9 +822,9 @@ gtk_spin_button_init (GtkSpinButton *spin_button)
_gtk_icon_helper_set_use_fallback (GTK_ICON_HELPER (priv->up_button), TRUE);
_gtk_icon_helper_set_icon_name (GTK_ICON_HELPER (priv->up_button), "list-add-symbolic",
GTK_ICON_SIZE_MENU);
gtk_css_gadget_add_class (priv->up_button, "up");
- gtk_css_node_set_parent (gtk_css_gadget_get_node (priv->down_button), widget_node);
- gtk_css_node_set_state (gtk_css_gadget_get_node (priv->down_button), gtk_css_node_get_state (widget_node));
- gtk_box_gadget_insert_gadget (GTK_BOX_GADGET (priv->gadget),
+ gtk_css_node_set_parent (gtk_css_gadget_get_node (priv->up_button), widget_node);
+ gtk_css_node_set_state (gtk_css_gadget_get_node (priv->up_button), gtk_css_node_get_state (widget_node));
+ gtk_box_gadget_insert_gadget (GTK_BOX_GADGET (priv->gadget),
-1, priv->up_button,
FALSE, GTK_ALIGN_FILL);
@@ -853,6 +853,8 @@ gtk_spin_button_finalize (GObject *object)
gtk_spin_button_unset_adjustment (spin_button);
g_clear_object (&priv->gadget);
+ g_clear_object (&priv->down_button);
+ g_clear_object (&priv->up_button);
g_object_unref (priv->swipe_gesture);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]