]> Pileus Git - ~andy/gtk/commitdiff
add static function gtk_scale_button_set_orientation_private() and use it
authorMichael Natterer <mitch@gimp.org>
Wed, 18 Mar 2009 21:19:07 +0000 (21:19 +0000)
committerMichael Natterer <mitch@src.gnome.org>
Wed, 18 Mar 2009 21:19:07 +0000 (21:19 +0000)
2009-03-18  Michael Natterer  <mitch@gimp.org>

* gtk/gtkscalebutton.c: add static function
gtk_scale_button_set_orientation_private() and use it instead of
the public but deprecated gtk_scale_button_set_orientation().

svn path=/trunk/; revision=22574

ChangeLog
gtk/gtkscalebutton.c

index aac290f2d94c5efc8fbd086c96990d808c92f21f..8b68178da29a2c4126dec1e56ed7ea6ac1bce3c9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2009-03-18  Michael Natterer  <mitch@gimp.org>
+
+       * gtk/gtkscalebutton.c: add static function
+       gtk_scale_button_set_orientation_private() and use it instead of
+       the public but deprecated gtk_scale_button_set_orientation().
+
 2009-03-17  Tor Lillqvist  <tml@novell.com>
 
        Bug 575700 - Crash when moving a GtkWindow
index f57c7fb70bc7acd1470a30274a10a2a9a5e8db5b..628121e4c4604b3f90ed7907be727d0f9b8f4e57 100644 (file)
@@ -119,6 +119,8 @@ static void gtk_scale_button_get_property   (GObject             *object,
                                                 guint                prop_id,
                                                 GValue              *value,
                                                 GParamSpec          *pspec);
+static void gtk_scale_button_set_orientation_private (GtkScaleButton *button,
+                                                      GtkOrientation  orientation);
 static gboolean        gtk_scale_button_scroll         (GtkWidget           *widget,
                                                 GdkEventScroll      *event);
 static void gtk_scale_button_screen_changed    (GtkWidget           *widget,
@@ -434,7 +436,7 @@ gtk_scale_button_set_property (GObject       *object,
   switch (prop_id)
     {
     case PROP_ORIENTATION:
-      gtk_scale_button_set_orientation (button, g_value_get_enum (value));
+      gtk_scale_button_set_orientation_private (button, g_value_get_enum (value));
       break;
     case PROP_VALUE:
       gtk_scale_button_set_value (button, g_value_get_double (value));
@@ -739,54 +741,9 @@ void
 gtk_scale_button_set_orientation (GtkScaleButton *button,
                                   GtkOrientation  orientation)
 {
-  GtkScaleButtonPrivate *priv;
-
   g_return_if_fail (GTK_IS_SCALE_BUTTON (button));
 
-  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),
-                               button->plus_button,
-                               "pack-type",
-                               orientation == GTK_ORIENTATION_VERTICAL ?
-                               GTK_PACK_START : GTK_PACK_END,
-                               NULL);
-      gtk_container_child_set (GTK_CONTAINER (priv->box),
-                               button->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");
-    }
+  gtk_scale_button_set_orientation_private (button, orientation);
 }
 
 /**
@@ -843,6 +800,56 @@ gtk_scale_button_get_popup (GtkScaleButton *button)
   return button->priv->dock;
 }
 
+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),
+                               button->plus_button,
+                               "pack-type",
+                               orientation == GTK_ORIENTATION_VERTICAL ?
+                               GTK_PACK_START : GTK_PACK_END,
+                               NULL);
+      gtk_container_child_set (GTK_CONTAINER (priv->box),
+                               button->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");
+    }
+}
+
 /*
  * button callbacks.
  */