[gtk+/refactor: 140/145] Added _gtk_range_set_round_digits() insternal function



commit 8bf2e457531eb3e315272572a515cd1962628271
Author: Javier Jardón <jjardon gnome org>
Date:   Fri Aug 13 01:50:09 2010 +0200

    Added _gtk_range_set_round_digits() insternal function
    
    It's needed by gtkscale

 gtk/gtkrange.c |    7 +++++++
 gtk/gtkrange.h |    2 ++
 gtk/gtkscale.c |   10 +++++-----
 3 files changed, 14 insertions(+), 5 deletions(-)
---
diff --git a/gtk/gtkrange.c b/gtk/gtkrange.c
index b698b34..44728e3 100644
--- a/gtk/gtkrange.c
+++ b/gtk/gtkrange.c
@@ -3997,3 +3997,10 @@ _gtk_range_get_stop_positions (GtkRange  *range,
 
   return range->layout->n_marks;
 }
+
+void
+_gtk_range_set_round_digits (GtkRange *range,
+                             gint     round_digits)
+{
+  range->round_digits = round_digits;
+}
diff --git a/gtk/gtkrange.h b/gtk/gtkrange.h
index 52de231..d4ed7ef 100644
--- a/gtk/gtkrange.h
+++ b/gtk/gtkrange.h
@@ -201,6 +201,8 @@ void               _gtk_range_set_stop_values              (GtkRange      *range
                                                             gint           n_values);
 gint               _gtk_range_get_stop_positions           (GtkRange      *range,
                                                             gint         **values);          
+void               _gtk_range_set_round_digits             (GtkRange      *range,
+                                                            gint           round_digits);
 
 
 G_END_DECLS
diff --git a/gtk/gtkscale.c b/gtk/gtkscale.c
index d1ff870..45fa751 100644
--- a/gtk/gtkscale.c
+++ b/gtk/gtkscale.c
@@ -408,7 +408,7 @@ gtk_scale_init (GtkScale *scale)
   priv->draw_value = TRUE;
   priv->value_pos = GTK_POS_TOP;
   priv->digits = 1;
-  range->round_digits = priv->digits;
+  _gtk_range_set_round_digits (range, priv->digits);
 
   gtk_scale_orientation_notify (range, NULL);
   g_signal_connect (scale, "notify::orientation",
@@ -575,8 +575,8 @@ gtk_scale_set_digits (GtkScale *scale,
     {
       priv->digits = digits;
       if (priv->draw_value)
-	range->round_digits = digits;
-      
+        _gtk_range_set_round_digits (range, digits);
+
       _gtk_scale_clear_layout (scale);
       gtk_widget_queue_resize (GTK_WIDGET (scale));
 
@@ -624,9 +624,9 @@ gtk_scale_set_draw_value (GtkScale *scale,
     {
       priv->draw_value = draw_value;
       if (draw_value)
-	GTK_RANGE (scale)->round_digits = priv->digits;
+        _gtk_range_set_round_digits (GTK_RANGE (scale), priv->digits);
       else
-	GTK_RANGE (scale)->round_digits = -1;
+        _gtk_range_set_round_digits (GTK_RANGE (scale), -1);
 
       _gtk_scale_clear_layout (scale);
 



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