Change the ranges for Saturation and Value to be 0-100 instead of 0-255,

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)
This commit is contained in:
Matthias Clasen 2003-11-05 20:05:47 +00:00 committed by Matthias Clasen
parent c6e019fbe3
commit 0a80b63b06
6 changed files with 48 additions and 3 deletions

View 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

View 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

View 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

View 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

View 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

View 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));