[gtk+] scale: Always be flippable



commit 79712f843cfe337a32ecb2bf7974ef16bb70bb7e
Author: Benjamin Otte <otte redhat com>
Date:   Fri Nov 21 07:26:19 2014 +0100

    scale: Always be flippable
    
    GtkRange only flips horizontal ranges, so there's no need to unset it
    for vertical scales.
    
    Also, set_flippable() is a cute name.

 gtk/gtkscale.c |   13 ++-----------
 1 files changed, 2 insertions(+), 11 deletions(-)
---
diff --git a/gtk/gtkscale.c b/gtk/gtkscale.c
index 75bf4d2..8bef41c 100644
--- a/gtk/gtkscale.c
+++ b/gtk/gtkscale.c
@@ -185,15 +185,7 @@ static void
 gtk_scale_notify (GObject    *object,
                   GParamSpec *pspec)
 {
-  if (strcmp (pspec->name, "orientation") == 0)
-    {
-      GtkOrientation orientation;
-
-      orientation = gtk_orientable_get_orientation (GTK_ORIENTABLE (object));
-      gtk_range_set_flippable (GTK_RANGE (object),
-                               orientation == GTK_ORIENTATION_HORIZONTAL);
-    }
-  else if (strcmp (pspec->name, "inverted") == 0)
+  if (strcmp (pspec->name, "inverted") == 0)
     {
       GtkScale *scale = GTK_SCALE (object);
       GtkScaleMark *mark;
@@ -494,8 +486,7 @@ gtk_scale_init (GtkScale *scale)
   priv->digits = 1;
   gtk_range_set_round_digits (range, priv->digits);
 
-  gtk_range_set_flippable (range,
-                           gtk_orientable_get_orientation (GTK_ORIENTABLE (range)) == 
GTK_ORIENTATION_HORIZONTAL);
+  gtk_range_set_flippable (range, TRUE);
 
   context = gtk_widget_get_style_context (GTK_WIDGET (scale));
   gtk_style_context_add_class (context, GTK_STYLE_CLASS_SCALE);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]