mirror of https://github.com/GNOME/gimp.git
app/actions/qmask-commands.c just some cleanup.
2004-09-18 Sven Neumann <sven@gimp.org> * app/actions/qmask-commands.c * libgimpcolor/gimprgb.c (gimp_rgba_distance): just some cleanup. * app/core/gimpimage-qmask.c (gimp_image_set_qmask_color): always set gimage->qmask_color regardless of the qmask state. * libgimpwidgets/gimpcolorbutton.c (gimp_color_button_new): set the type before setting the color.
This commit is contained in:
parent
c9cac47fbe
commit
cace0a19a0
11
ChangeLog
11
ChangeLog
|
@ -1,3 +1,14 @@
|
|||
2004-09-18 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* app/actions/qmask-commands.c
|
||||
* libgimpcolor/gimprgb.c (gimp_rgba_distance): just some cleanup.
|
||||
|
||||
* app/core/gimpimage-qmask.c (gimp_image_set_qmask_color): always
|
||||
set gimage->qmask_color regardless of the qmask state.
|
||||
|
||||
* libgimpwidgets/gimpcolorbutton.c (gimp_color_button_new): set
|
||||
the type before setting the color.
|
||||
|
||||
2004-09-17 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
* app/widgets/gimpcomponenteditor.c
|
||||
|
|
|
@ -62,9 +62,9 @@ static void qmask_query_response (GtkWidget *widget,
|
|||
gint response_id,
|
||||
EditQmaskOptions *options);
|
||||
static void qmask_query_scale_update (GtkAdjustment *adjustment,
|
||||
gpointer data);
|
||||
GtkWidget *panel);
|
||||
static void qmask_query_color_changed (GimpColorButton *button,
|
||||
gpointer data);
|
||||
GtkAdjustment *adj);
|
||||
|
||||
|
||||
/* public functionss */
|
||||
|
@ -237,21 +237,20 @@ qmask_query_response (GtkWidget *widget,
|
|||
|
||||
static void
|
||||
qmask_query_scale_update (GtkAdjustment *adjustment,
|
||||
gpointer data)
|
||||
GtkWidget *panel)
|
||||
{
|
||||
GimpRGB color;
|
||||
GimpRGB color;
|
||||
|
||||
gimp_color_button_get_color (GIMP_COLOR_BUTTON (data), &color);
|
||||
gimp_color_button_get_color (GIMP_COLOR_BUTTON (panel), &color);
|
||||
gimp_rgb_set_alpha (&color, adjustment->value / 100.0);
|
||||
gimp_color_button_set_color (GIMP_COLOR_BUTTON (data), &color);
|
||||
gimp_color_button_set_color (GIMP_COLOR_BUTTON (panel), &color);
|
||||
}
|
||||
|
||||
static void
|
||||
qmask_query_color_changed (GimpColorButton *button,
|
||||
gpointer data)
|
||||
GtkAdjustment *adj)
|
||||
{
|
||||
GtkAdjustment *adj = GTK_ADJUSTMENT (data);
|
||||
GimpRGB color;
|
||||
GimpRGB color;
|
||||
|
||||
gimp_color_button_get_color (button, &color);
|
||||
gtk_adjustment_set_value (adj, color.a * 100.0);
|
||||
|
|
|
@ -62,9 +62,9 @@ static void qmask_query_response (GtkWidget *widget,
|
|||
gint response_id,
|
||||
EditQmaskOptions *options);
|
||||
static void qmask_query_scale_update (GtkAdjustment *adjustment,
|
||||
gpointer data);
|
||||
GtkWidget *panel);
|
||||
static void qmask_query_color_changed (GimpColorButton *button,
|
||||
gpointer data);
|
||||
GtkAdjustment *adj);
|
||||
|
||||
|
||||
/* public functionss */
|
||||
|
@ -237,21 +237,20 @@ qmask_query_response (GtkWidget *widget,
|
|||
|
||||
static void
|
||||
qmask_query_scale_update (GtkAdjustment *adjustment,
|
||||
gpointer data)
|
||||
GtkWidget *panel)
|
||||
{
|
||||
GimpRGB color;
|
||||
GimpRGB color;
|
||||
|
||||
gimp_color_button_get_color (GIMP_COLOR_BUTTON (data), &color);
|
||||
gimp_color_button_get_color (GIMP_COLOR_BUTTON (panel), &color);
|
||||
gimp_rgb_set_alpha (&color, adjustment->value / 100.0);
|
||||
gimp_color_button_set_color (GIMP_COLOR_BUTTON (data), &color);
|
||||
gimp_color_button_set_color (GIMP_COLOR_BUTTON (panel), &color);
|
||||
}
|
||||
|
||||
static void
|
||||
qmask_query_color_changed (GimpColorButton *button,
|
||||
gpointer data)
|
||||
GtkAdjustment *adj)
|
||||
{
|
||||
GtkAdjustment *adj = GTK_ADJUSTMENT (data);
|
||||
GimpRGB color;
|
||||
GimpRGB color;
|
||||
|
||||
gimp_color_button_get_color (button, &color);
|
||||
gtk_adjustment_set_value (adj, color.a * 100.0);
|
||||
|
|
|
@ -149,12 +149,11 @@ gimp_image_set_qmask_color (GimpImage *gimage,
|
|||
g_return_if_fail (GIMP_IS_IMAGE (gimage));
|
||||
g_return_if_fail (color != NULL);
|
||||
|
||||
qmask = gimp_image_get_qmask (gimage);
|
||||
gimage->qmask_color = *color;
|
||||
|
||||
qmask = gimp_image_get_qmask (gimage);
|
||||
if (qmask)
|
||||
gimp_channel_set_color (qmask, color, TRUE);
|
||||
else
|
||||
gimage->qmask_color = *color;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -149,12 +149,11 @@ gimp_image_set_qmask_color (GimpImage *gimage,
|
|||
g_return_if_fail (GIMP_IS_IMAGE (gimage));
|
||||
g_return_if_fail (color != NULL);
|
||||
|
||||
qmask = gimp_image_get_qmask (gimage);
|
||||
gimage->qmask_color = *color;
|
||||
|
||||
qmask = gimp_image_get_qmask (gimage);
|
||||
if (qmask)
|
||||
gimp_channel_set_color (qmask, color, TRUE);
|
||||
else
|
||||
gimage->qmask_color = *color;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -408,6 +408,8 @@ gimp_rgba_distance (const GimpRGB *rgba1,
|
|||
g_return_val_if_fail (rgba1 != NULL, 0.0);
|
||||
g_return_val_if_fail (rgba2 != NULL, 0.0);
|
||||
|
||||
return (fabs (rgba1->r - rgba2->r) + fabs (rgba1->g - rgba2->g) +
|
||||
fabs (rgba1->b - rgba2->b) + fabs (rgba1->a - rgba2->a));
|
||||
return (fabs (rgba1->r - rgba2->r) +
|
||||
fabs (rgba1->g - rgba2->g) +
|
||||
fabs (rgba1->b - rgba2->b) +
|
||||
fabs (rgba1->a - rgba2->a));
|
||||
}
|
||||
|
|
|
@ -291,8 +291,8 @@ gimp_color_button_new (const gchar *title,
|
|||
|
||||
gtk_widget_set_size_request (GTK_WIDGET (button->color_area), width, height);
|
||||
|
||||
gimp_color_area_set_color (GIMP_COLOR_AREA (button->color_area), color);
|
||||
gimp_color_area_set_type (GIMP_COLOR_AREA (button->color_area), type);
|
||||
gimp_color_area_set_color (GIMP_COLOR_AREA (button->color_area), color);
|
||||
|
||||
return GTK_WIDGET (button);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue