Commit cace0a19 authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann
Browse files

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.
parent c9cac47f
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);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment