From federico@nuclecu.unam.mx Wed Apr 30 16:56:23 1997 Date: Wed, 30 Apr 1997 15:19:22 -0500 From: Federico Mena To: gimp-developer@scam.xcf.berkeley.edu Subject: [gimp-devel]PATCH: gtkcolorsel.c Hello, all This patch fixes the bug in GtkColorSelection which caused the sliders/entries not to be updated properly. You'll definitely want to apply it. Quartic --- gtkcolorsel.dist.c Sat Apr 26 23:05:10 1997 +++ gtkcolorsel.c Wed Apr 30 14:01:55 1997 @@ -44,8 +44,9 @@ enum { - RGB_INPUTS = 1 << 0, - HSV_INPUTS = 1 << 1 + RGB_INPUTS = 1 << 0, + HSV_INPUTS = 1 << 1, + OPACITY_INPUTS = 1 << 2 }; enum @@ -425,12 +426,13 @@ RGB_TO_HSV (); + gtk_color_selection_update_inputs (colorsel, RGB_INPUTS | HSV_INPUTS | OPACITY_INPUTS, BOTH); + if (GTK_WIDGET_DRAWABLE (GTK_WIDGET (colorsel))) { gtk_color_selection_draw_value_bar (colorsel, FALSE); gtk_color_selection_draw_sample (colorsel, FALSE); gtk_color_selection_draw_wheel_marker (colorsel); - gtk_color_selection_update_inputs (colorsel, RGB_INPUTS | HSV_INPUTS, BOTH); } } @@ -521,6 +523,9 @@ for (n = HUE; n <= VALUE; n++) gtk_color_selection_update_input (colorsel->scales[n], NULL, colorsel->values[n]); + if ((inputs & OPACITY_INPUTS) != 0) + gtk_color_selection_update_input(colorsel->scales[OPACITY], NULL, + colorsel->values[OPACITY]); break; case ENTRY: if ((inputs & RGB_INPUTS) != 0) @@ -529,6 +534,8 @@ if ((inputs & HSV_INPUTS) != 0) for (n = HUE; n <= VALUE; n++) gtk_color_selection_update_input (NULL, colorsel->entries[n], colorsel->values[n]); + if ((inputs & OPACITY_INPUTS) != 0) + gtk_color_selection_update_input(NULL, colorsel->entries[OPACITY], colorsel->values[OPACITY]); break; default: if ((inputs & RGB_INPUTS) != 0) @@ -539,6 +546,9 @@ for (n = HUE; n <= VALUE; n++) gtk_color_selection_update_input (colorsel->scales[n], colorsel->entries[n], colorsel->values[n]); + if ((inputs & OPACITY_INPUTS) != 0) + gtk_color_selection_update_input(colorsel->scales[OPACITY], colorsel->entries[OPACITY], + colorsel->values[OPACITY]); break; } }