]> Pileus Git - ~andy/gtk/commitdiff
Change the ranges for Saturation and Value to be 0-100 instead of 0-255,
authorMatthias Clasen <maclas@gmx.de>
Wed, 5 Nov 2003 20:05:47 +0000 (20:05 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Wed, 5 Nov 2003 20:05:47 +0000 (20:05 +0000)
Wed Nov  5 21:02:26 2003  Matthias Clasen  <maclas@gmx.de>

* gtk/gtkcolorsel.c (update_color):
(make_label_spinbutton):
(adjustment_changed): Change the ranges for Saturation and
Value to be 0-100 instead of 0-255, since these axes of HSV
are usually expressed in percent.  (#121519, Gregory Merchan)
Wed Nov  5 21:02:26 2003  Matthias Clasen  <maclas@gmx.de>

* gtk/gtkcolorsel.c (update_color):
(make_label_spinbutton):
(adjustment_changed): Change the ranges for Saturation and
Value to be 0-100 instead of 0-255, since these axes of HSV
are usually expressed in percent.  (#121519, Gregory Merchan)

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtkcolorsel.c

index af3167ab734b3f1ee752b8a7c76d5645dd968d66..8d52ab3c082f9faa36082f626d62a9efe36185f9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+Wed Nov  5 21:02:26 2003  Matthias Clasen  <maclas@gmx.de>
+
+       * gtk/gtkcolorsel.c (update_color): 
+       (make_label_spinbutton): 
+       (adjustment_changed): Change the ranges for Saturation and
+       Value to be 0-100 instead of 0-255, since these axes of HSV
+       are usually expressed in percent.  (#121519, Gregory Merchan)
+
 Wed Nov  5 08:51:48 GMT 2003  Tony Gale <gale@gtk.org>
 
        * docs/faq/gtk-faq.sgml: More 2.x updates
index af3167ab734b3f1ee752b8a7c76d5645dd968d66..8d52ab3c082f9faa36082f626d62a9efe36185f9 100644 (file)
@@ -1,3 +1,11 @@
+Wed Nov  5 21:02:26 2003  Matthias Clasen  <maclas@gmx.de>
+
+       * gtk/gtkcolorsel.c (update_color): 
+       (make_label_spinbutton): 
+       (adjustment_changed): Change the ranges for Saturation and
+       Value to be 0-100 instead of 0-255, since these axes of HSV
+       are usually expressed in percent.  (#121519, Gregory Merchan)
+
 Wed Nov  5 08:51:48 GMT 2003  Tony Gale <gale@gtk.org>
 
        * docs/faq/gtk-faq.sgml: More 2.x updates
index af3167ab734b3f1ee752b8a7c76d5645dd968d66..8d52ab3c082f9faa36082f626d62a9efe36185f9 100644 (file)
@@ -1,3 +1,11 @@
+Wed Nov  5 21:02:26 2003  Matthias Clasen  <maclas@gmx.de>
+
+       * gtk/gtkcolorsel.c (update_color): 
+       (make_label_spinbutton): 
+       (adjustment_changed): Change the ranges for Saturation and
+       Value to be 0-100 instead of 0-255, since these axes of HSV
+       are usually expressed in percent.  (#121519, Gregory Merchan)
+
 Wed Nov  5 08:51:48 GMT 2003  Tony Gale <gale@gtk.org>
 
        * docs/faq/gtk-faq.sgml: More 2.x updates
index af3167ab734b3f1ee752b8a7c76d5645dd968d66..8d52ab3c082f9faa36082f626d62a9efe36185f9 100644 (file)
@@ -1,3 +1,11 @@
+Wed Nov  5 21:02:26 2003  Matthias Clasen  <maclas@gmx.de>
+
+       * gtk/gtkcolorsel.c (update_color): 
+       (make_label_spinbutton): 
+       (adjustment_changed): Change the ranges for Saturation and
+       Value to be 0-100 instead of 0-255, since these axes of HSV
+       are usually expressed in percent.  (#121519, Gregory Merchan)
+
 Wed Nov  5 08:51:48 GMT 2003  Tony Gale <gale@gtk.org>
 
        * docs/faq/gtk-faq.sgml: More 2.x updates
index af3167ab734b3f1ee752b8a7c76d5645dd968d66..8d52ab3c082f9faa36082f626d62a9efe36185f9 100644 (file)
@@ -1,3 +1,11 @@
+Wed Nov  5 21:02:26 2003  Matthias Clasen  <maclas@gmx.de>
+
+       * gtk/gtkcolorsel.c (update_color): 
+       (make_label_spinbutton): 
+       (adjustment_changed): Change the ranges for Saturation and
+       Value to be 0-100 instead of 0-255, since these axes of HSV
+       are usually expressed in percent.  (#121519, Gregory Merchan)
+
 Wed Nov  5 08:51:48 GMT 2003  Tony Gale <gale@gtk.org>
 
        * docs/faq/gtk-faq.sgml: More 2.x updates
index e7a191a042b06fb1376154ce36646a4b87ef6296..e56824369910973c6eaa99108803d568a36ffc55 100644 (file)
@@ -1445,7 +1445,7 @@ adjustment_changed (GtkAdjustment *adjustment,
     {
     case COLORSEL_SATURATION:
     case COLORSEL_VALUE:
-      priv->color[GPOINTER_TO_INT (data)] = adjustment->value / 255;
+      priv->color[GPOINTER_TO_INT (data)] = adjustment->value / 100;
       gtk_hsv_to_rgb (priv->color[COLORSEL_HUE],
                      priv->color[COLORSEL_SATURATION],
                      priv->color[COLORSEL_VALUE],
@@ -1523,6 +1523,11 @@ make_label_spinbutton (GtkColorSelection *colorsel,
     {
       adjust = GTK_ADJUSTMENT (gtk_adjustment_new (0.0, 0.0, 360.0, 1.0, 1.0, 1.0));
     }
+  else if (channel_type == COLORSEL_SATURATION ||
+          channel_type == COLORSEL_VALUE)
+    {
+      adjust = GTK_ADJUSTMENT (gtk_adjustment_new (0.0, 0.0, 100.0, 1.0, 1.0, 1.0));
+    }
   else
     {
       adjust = GTK_ADJUSTMENT (gtk_adjustment_new (0.0, 0.0, 255.0, 1.0, 1.0, 1.0));
@@ -1599,10 +1604,10 @@ update_color (GtkColorSelection *colorsel)
                            scale_round (priv->color[COLORSEL_HUE], 360));
   gtk_adjustment_set_value (gtk_spin_button_get_adjustment
                            (GTK_SPIN_BUTTON (priv->sat_spinbutton)),
-                           scale_round (priv->color[COLORSEL_SATURATION], 255));
+                           scale_round (priv->color[COLORSEL_SATURATION], 100));
   gtk_adjustment_set_value (gtk_spin_button_get_adjustment
                            (GTK_SPIN_BUTTON (priv->val_spinbutton)),
-                           scale_round (priv->color[COLORSEL_VALUE], 255));
+                           scale_round (priv->color[COLORSEL_VALUE], 100));
   gtk_adjustment_set_value (gtk_spin_button_get_adjustment
                            (GTK_SPIN_BUTTON (priv->red_spinbutton)),
                            scale_round (priv->color[COLORSEL_RED], 255));