[gtk+] Fix scale length



commit f8bc35b9a62fdaa0b16d0552e7d7771f2b338d47
Author: Matthias Clasen <mclasen redhat com>
Date:   Tue May 10 15:41:03 2016 -0400

    Fix scale length
    
    The vertical scales should really be of the same length, so
    add an empty value to be drawn by the other scale.

 demos/widget-factory/widget-factory.c  |    7 +++++++
 demos/widget-factory/widget-factory.ui |    3 ++-
 2 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/demos/widget-factory/widget-factory.c b/demos/widget-factory/widget-factory.c
index 087c34e..d4b88a5 100644
--- a/demos/widget-factory/widget-factory.c
+++ b/demos/widget-factory/widget-factory.c
@@ -1625,6 +1625,12 @@ reset_icon_size (GtkWidget *iv)
   gtk_widget_queue_resize (iv);
 }
 
+static gchar *
+scale_format_value (GtkScale *scale, gdouble value)
+{
+  return g_strdup (" ");
+}
+
 static void
 activate (GApplication *app)
 {
@@ -1690,6 +1696,7 @@ activate (GApplication *app)
   gtk_builder_add_callback_symbol (builder, "increase_icon_size", (GCallback)increase_icon_size);
   gtk_builder_add_callback_symbol (builder, "decrease_icon_size", (GCallback)decrease_icon_size);
   gtk_builder_add_callback_symbol (builder, "reset_icon_size", (GCallback)reset_icon_size);
+  gtk_builder_add_callback_symbol (builder, "scale_format_value", (GCallback)scale_format_value);
 
   gtk_builder_connect_signals (builder, NULL);
 
diff --git a/demos/widget-factory/widget-factory.ui b/demos/widget-factory/widget-factory.ui
index f211c5f..eae3a8c 100644
--- a/demos/widget-factory/widget-factory.ui
+++ b/demos/widget-factory/widget-factory.ui
@@ -1254,7 +1254,8 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
                                     <property name="adjustment">adjustment1</property>
                                     <property name="restrict_to_fill_level">0</property>
                                     <property name="fill_level">75</property>
-                                    <property name="draw_value">0</property>
+                                    <property name="draw_value">1</property>
+                                    <signal name="format-value" handler="scale_format_value"/>
                                   </object>
                                   <packing>
                                     <property name="position">1</property>


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