+static void
+gtk_scale_button_set_orientation_private (GtkScaleButton *button,
+ GtkOrientation orientation)
+{
+ GtkScaleButtonPrivate *priv = button->priv;
+
+ if (orientation != priv->orientation)
+ {
+ priv->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);
+
+ gtk_orientable_set_orientation (GTK_ORIENTABLE (priv->scale),
+ orientation);
+
+ if (orientation == GTK_ORIENTATION_VERTICAL)
+ {
+ gtk_widget_set_size_request (GTK_WIDGET (priv->scale),
+ -1, SCALE_SIZE);
+ gtk_range_set_inverted (GTK_RANGE (priv->scale), TRUE);
+ }
+ else
+ {
+ gtk_widget_set_size_request (GTK_WIDGET (priv->scale),
+ SCALE_SIZE, -1);
+ gtk_range_set_inverted (GTK_RANGE (priv->scale), FALSE);
+ }
+
+ /* FIXME: without this, the popup window appears as a square
+ * after changing the orientation
+ */
+ gtk_window_resize (GTK_WINDOW (priv->dock), 1, 1);
+
+ g_object_notify (G_OBJECT (button), "orientation");
+ }
+}
+