summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimm Bäder <mail@baedert.org>2018-12-26 08:26:41 +0100
committerTimm Bäder <mail@baedert.org>2019-01-03 09:02:57 +0100
commit7fdd26210a4daa1831716856ef202c966a666e46 (patch)
treea0898cbe604d93f2c28264a33264547dc66fd046
parent8588481407e706a51cbdcae076fda0c6032eae37 (diff)
downloadgtk+-7fdd26210a4daa1831716856ef202c966a666e46.tar.gz
scalebutton: Stop relying on GtkBox's pack-type child prop
-rw-r--r--gtk/gtkscalebutton.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/gtk/gtkscalebutton.c b/gtk/gtkscalebutton.c
index 116ccef306..9102b333c1 100644
--- a/gtk/gtkscalebutton.c
+++ b/gtk/gtkscalebutton.c
@@ -724,18 +724,20 @@ apply_orientation (GtkScaleButton *button,
{
priv->applied_orientation = orientation;
gtk_orientable_set_orientation (GTK_ORIENTABLE (priv->box), orientation);
- gtk_container_child_set (GTK_CONTAINER (priv->box),
- priv->plus_button,
- "pack-type",
- orientation == GTK_ORIENTATION_VERTICAL ?
- GTK_PACK_START : GTK_PACK_END,
- NULL);
- gtk_container_child_set (GTK_CONTAINER (priv->box),
- priv->minus_button,
- "pack-type",
- orientation == GTK_ORIENTATION_VERTICAL ?
- GTK_PACK_END : GTK_PACK_START,
- NULL);
+
+ if (orientation == GTK_ORIENTATION_HORIZONTAL)
+ {
+ gtk_box_reorder_child (GTK_BOX (priv->box), priv->scale, 0);
+ gtk_box_reorder_child (GTK_BOX (priv->box), priv->minus_button, 1);
+ gtk_box_reorder_child (GTK_BOX (priv->box), priv->plus_button, 2);
+ }
+ else
+ {
+ gtk_box_reorder_child (GTK_BOX (priv->box), priv->scale, 1);
+ gtk_box_reorder_child (GTK_BOX (priv->box), priv->minus_button, 2);
+ gtk_box_reorder_child (GTK_BOX (priv->box), priv->plus_button, 0);
+
+ }
gtk_orientable_set_orientation (GTK_ORIENTABLE (priv->scale), orientation);