]> Pileus Git - ~andy/gtk/commitdiff
Revert the last changes to make the number of digits only effect drawing,
authorOwen Taylor <otaylor@redhat.com>
Wed, 30 Jan 2002 01:47:27 +0000 (01:47 +0000)
committerOwen Taylor <otaylor@src.gnome.org>
Wed, 30 Jan 2002 01:47:27 +0000 (01:47 +0000)
Tue Jan 29 20:38:04 2002  Owen Taylor  <otaylor@redhat.com>

        * gtk/gtkscale.[ch]: Revert the last changes to make the
        number of digits only effect drawing, instead, don't
        round unless we are in the 'draw_value' mode -- this
        is the behavior of GTK+-1.2, and keeps the behavior that
        if the user sees a displayed value, it is the correct value.

ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtkscale.c
gtk/gtkscale.h

index fbf6159a98fd002784a8c514ab9348abbea22ece..9998d108703f26a9367bb77d2b194ab9aab36444 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+Tue Jan 29 20:38:04 2002  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkscale.[ch]: Revert the last changes to make the
+       number of digits only effect drawing, instead, don't
+       round unless we are in the 'draw_value' mode -- this
+       is the behavior of GTK+-1.2, and keeps the behavior that
+       if the user sees a displayed value, it is the correct value.
+
 Tue Jan 29 19:51:05 2002  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkenums.h: Deprecate GtkPreviewType,
@@ -413,7 +421,7 @@ Wed Jan 23 15:12:16 2002  Owen Taylor  <otaylor@redhat.com>
 
 Wed Jan 23 14:44:12 2002  Owen Taylor  <otaylor@redhat.com>
 
-       * gtk/gtkspinbutton.c (EPSILON): Decreate value since
+       * gtk/gtkspinbutton.c (EPSILON): Decrease value since
        we now use doubles.
 
 Tue Jan 22 16:58:37 2002  Jonathan Blandford  <jrb@redhat.com>
index fbf6159a98fd002784a8c514ab9348abbea22ece..9998d108703f26a9367bb77d2b194ab9aab36444 100644 (file)
@@ -1,3 +1,11 @@
+Tue Jan 29 20:38:04 2002  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkscale.[ch]: Revert the last changes to make the
+       number of digits only effect drawing, instead, don't
+       round unless we are in the 'draw_value' mode -- this
+       is the behavior of GTK+-1.2, and keeps the behavior that
+       if the user sees a displayed value, it is the correct value.
+
 Tue Jan 29 19:51:05 2002  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkenums.h: Deprecate GtkPreviewType,
@@ -413,7 +421,7 @@ Wed Jan 23 15:12:16 2002  Owen Taylor  <otaylor@redhat.com>
 
 Wed Jan 23 14:44:12 2002  Owen Taylor  <otaylor@redhat.com>
 
-       * gtk/gtkspinbutton.c (EPSILON): Decreate value since
+       * gtk/gtkspinbutton.c (EPSILON): Decrease value since
        we now use doubles.
 
 Tue Jan 22 16:58:37 2002  Jonathan Blandford  <jrb@redhat.com>
index fbf6159a98fd002784a8c514ab9348abbea22ece..9998d108703f26a9367bb77d2b194ab9aab36444 100644 (file)
@@ -1,3 +1,11 @@
+Tue Jan 29 20:38:04 2002  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkscale.[ch]: Revert the last changes to make the
+       number of digits only effect drawing, instead, don't
+       round unless we are in the 'draw_value' mode -- this
+       is the behavior of GTK+-1.2, and keeps the behavior that
+       if the user sees a displayed value, it is the correct value.
+
 Tue Jan 29 19:51:05 2002  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkenums.h: Deprecate GtkPreviewType,
@@ -413,7 +421,7 @@ Wed Jan 23 15:12:16 2002  Owen Taylor  <otaylor@redhat.com>
 
 Wed Jan 23 14:44:12 2002  Owen Taylor  <otaylor@redhat.com>
 
-       * gtk/gtkspinbutton.c (EPSILON): Decreate value since
+       * gtk/gtkspinbutton.c (EPSILON): Decrease value since
        we now use doubles.
 
 Tue Jan 22 16:58:37 2002  Jonathan Blandford  <jrb@redhat.com>
index fbf6159a98fd002784a8c514ab9348abbea22ece..9998d108703f26a9367bb77d2b194ab9aab36444 100644 (file)
@@ -1,3 +1,11 @@
+Tue Jan 29 20:38:04 2002  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkscale.[ch]: Revert the last changes to make the
+       number of digits only effect drawing, instead, don't
+       round unless we are in the 'draw_value' mode -- this
+       is the behavior of GTK+-1.2, and keeps the behavior that
+       if the user sees a displayed value, it is the correct value.
+
 Tue Jan 29 19:51:05 2002  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkenums.h: Deprecate GtkPreviewType,
@@ -413,7 +421,7 @@ Wed Jan 23 15:12:16 2002  Owen Taylor  <otaylor@redhat.com>
 
 Wed Jan 23 14:44:12 2002  Owen Taylor  <otaylor@redhat.com>
 
-       * gtk/gtkspinbutton.c (EPSILON): Decreate value since
+       * gtk/gtkspinbutton.c (EPSILON): Decrease value since
        we now use doubles.
 
 Tue Jan 22 16:58:37 2002  Jonathan Blandford  <jrb@redhat.com>
index fbf6159a98fd002784a8c514ab9348abbea22ece..9998d108703f26a9367bb77d2b194ab9aab36444 100644 (file)
@@ -1,3 +1,11 @@
+Tue Jan 29 20:38:04 2002  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkscale.[ch]: Revert the last changes to make the
+       number of digits only effect drawing, instead, don't
+       round unless we are in the 'draw_value' mode -- this
+       is the behavior of GTK+-1.2, and keeps the behavior that
+       if the user sees a displayed value, it is the correct value.
+
 Tue Jan 29 19:51:05 2002  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkenums.h: Deprecate GtkPreviewType,
@@ -413,7 +421,7 @@ Wed Jan 23 15:12:16 2002  Owen Taylor  <otaylor@redhat.com>
 
 Wed Jan 23 14:44:12 2002  Owen Taylor  <otaylor@redhat.com>
 
-       * gtk/gtkspinbutton.c (EPSILON): Decreate value since
+       * gtk/gtkspinbutton.c (EPSILON): Decrease value since
        we now use doubles.
 
 Tue Jan 22 16:58:37 2002  Jonathan Blandford  <jrb@redhat.com>
index fbf6159a98fd002784a8c514ab9348abbea22ece..9998d108703f26a9367bb77d2b194ab9aab36444 100644 (file)
@@ -1,3 +1,11 @@
+Tue Jan 29 20:38:04 2002  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkscale.[ch]: Revert the last changes to make the
+       number of digits only effect drawing, instead, don't
+       round unless we are in the 'draw_value' mode -- this
+       is the behavior of GTK+-1.2, and keeps the behavior that
+       if the user sees a displayed value, it is the correct value.
+
 Tue Jan 29 19:51:05 2002  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkenums.h: Deprecate GtkPreviewType,
@@ -413,7 +421,7 @@ Wed Jan 23 15:12:16 2002  Owen Taylor  <otaylor@redhat.com>
 
 Wed Jan 23 14:44:12 2002  Owen Taylor  <otaylor@redhat.com>
 
-       * gtk/gtkspinbutton.c (EPSILON): Decreate value since
+       * gtk/gtkspinbutton.c (EPSILON): Decrease value since
        we now use doubles.
 
 Tue Jan 22 16:58:37 2002  Jonathan Blandford  <jrb@redhat.com>
index fbf6159a98fd002784a8c514ab9348abbea22ece..9998d108703f26a9367bb77d2b194ab9aab36444 100644 (file)
@@ -1,3 +1,11 @@
+Tue Jan 29 20:38:04 2002  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkscale.[ch]: Revert the last changes to make the
+       number of digits only effect drawing, instead, don't
+       round unless we are in the 'draw_value' mode -- this
+       is the behavior of GTK+-1.2, and keeps the behavior that
+       if the user sees a displayed value, it is the correct value.
+
 Tue Jan 29 19:51:05 2002  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkenums.h: Deprecate GtkPreviewType,
@@ -413,7 +421,7 @@ Wed Jan 23 15:12:16 2002  Owen Taylor  <otaylor@redhat.com>
 
 Wed Jan 23 14:44:12 2002  Owen Taylor  <otaylor@redhat.com>
 
-       * gtk/gtkspinbutton.c (EPSILON): Decreate value since
+       * gtk/gtkspinbutton.c (EPSILON): Decrease value since
        we now use doubles.
 
 Tue Jan 22 16:58:37 2002  Jonathan Blandford  <jrb@redhat.com>
index d971a80d9ec82c1df086137909cfb82726d3d21b..252a5dc5096d8517491191eea0d34aeae0d7cd60 100644 (file)
@@ -353,7 +353,7 @@ gtk_scale_get_property (GObject      *object,
   switch (prop_id)
     {
     case PROP_DIGITS:
-      g_value_set_int (value, scale->draw_digits);
+      g_value_set_int (value, scale->digits);
       break;
     case PROP_DRAW_VALUE:
       g_value_set_boolean (value, scale->draw_value);
@@ -381,10 +381,11 @@ gtk_scale_init (GtkScale *scale)
   range->has_stepper_b = FALSE;
   range->has_stepper_c = FALSE;
   range->has_stepper_d = FALSE;
-
-  scale->draw_digits = 1;
+  
   scale->draw_value = TRUE;
   scale->value_pos = GTK_POS_TOP;
+  scale->digits = 1;
+  range->round_digits = scale->digits;
 }
 
 void
@@ -397,11 +398,13 @@ gtk_scale_set_digits (GtkScale *scale,
 
   range = GTK_RANGE (scale);
   
-  digits = CLAMP (digits, -1, MAX_DIGITS);
+  digits = CLAMP (digits, -1, 16);
 
-  if (scale->draw_digits != digits)
+  if (scale->digits != digits)
     {
-      scale->draw_digits = digits;
+      scale->digits = digits;
+      if (scale->draw_value)
+       range->round_digits = digits;
       
       gtk_widget_queue_resize (GTK_WIDGET (scale));
 
@@ -414,7 +417,7 @@ gtk_scale_get_digits (GtkScale *scale)
 {
   g_return_val_if_fail (GTK_IS_SCALE (scale), -1);
 
-  return scale->draw_digits;
+  return scale->digits;
 }
 
 void
@@ -428,6 +431,10 @@ gtk_scale_set_draw_value (GtkScale *scale,
   if (scale->draw_value != draw_value)
     {
       scale->draw_value = draw_value;
+      if (draw_value)
+       GTK_RANGE (scale)->round_digits = scale->digits;
+      else
+       GTK_RANGE (scale)->round_digits = -1;
 
       gtk_widget_queue_resize (GTK_WIDGET (scale));
 
@@ -607,6 +614,6 @@ _gtk_scale_format_value (GtkScale *scale,
   if (fmt)
     return fmt;
   else
-    return g_strdup_printf ("%0.*f", scale->draw_digits,
+    return g_strdup_printf ("%0.*f", scale->digits,
                             value);
 }
index ecc028c60b93de385fc0685a744c9308c6f5d341..7bfca7d77e87ae41a607398579d9aaa6e8bfef19 100644 (file)
@@ -52,7 +52,7 @@ struct _GtkScale
 {
   GtkRange range;
 
-  gint  draw_digits;
+  gint digits;
   guint draw_value : 1;
   guint value_pos : 2;
 };