[gtk+] GtkScale: More work on mark spacing



commit 1ed21ad3d4d90076f74c2c2fe616938d0c7d6026
Author: Matthias Clasen <mclasen redhat com>
Date:   Tue Jun 23 09:33:30 2015 -0400

    GtkScale: More work on mark spacing
    
    Try harder not to push the scale out of balance by marks. With
    this change, the remaining difference in the drawing is down
    to asymmetric assets and margins coming out of the theme.
    To fully support such asymmetric rendering, we need implement
    baseline alignment for scales.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=749650

 gtk/gtkscale.c |   25 +++++++++++--------------
 1 files changed, 11 insertions(+), 14 deletions(-)
---
diff --git a/gtk/gtkscale.c b/gtk/gtkscale.c
index ee7f804..1853625 100644
--- a/gtk/gtkscale.c
+++ b/gtk/gtkscale.c
@@ -875,31 +875,28 @@ gtk_scale_get_range_border (GtkRange  *range,
 
   if (priv->marks)
     {
-      gint slider_width;
       gint value_spacing;
       gint n1, w1, h1, n2, w2, h2;
-  
-      gtk_widget_style_get (widget, 
-                            "slider-width", &slider_width,
-                            "value-spacing", &value_spacing, 
-                            NULL);
 
+      gtk_widget_style_get (widget,
+                            "value-spacing", &value_spacing,
+                            NULL);
 
       gtk_scale_get_mark_label_size (scale, GTK_POS_TOP, &n1, &w1, &h1, &n2, &w2, &h2);
 
       if (gtk_orientable_get_orientation (GTK_ORIENTABLE (scale)) == GTK_ORIENTATION_HORIZONTAL)
         {
-          if (n1 > 0)
-            border->top += h1 + value_spacing + slider_width / 4;
-          if (n2 > 0)
-            border->bottom += h2 + value_spacing + slider_width / 4;
+          if (h1 > 0)
+            border->top += h1 + value_spacing;
+          if (h2 > 0)
+            border->bottom += h2 + value_spacing;
         }
       else
         {
-          if (n1 > 0)
-            border->left += w1 + value_spacing + slider_width / 4;
-          if (n2 > 0)
-            border->right += w2 + value_spacing + slider_width / 4;
+          if (w1 > 0)
+            border->left += w1 + value_spacing;
+          if (w2 > 0)
+            border->right += w2 + value_spacing;
         }
     }
 }


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