Author: Goedson Teixeira Paixao <goedson@debian.org>
Description: Fix foreground/background color selection
Fixes the foreground/background color selection by checking the GtkColorButton
color when the user chooses the color.
Bug-Ubuntu: https://bugs.edge.launchpad.net/ubuntu/+source/gpaint/+bug/344237
Forwarded: https://savannah.gnu.org/patch/index.php?7028
diff --git a/src/callbacks.h b/src/callbacks.h
index 985dddf..5485329 100644
--- a/src/callbacks.h
+++ b/src/callbacks.h
@@ -359,18 +359,10 @@ on_fontpicker_font_set (GtkFontButton *gnomefontpicker,
void
on_foreground_color_picker_color_set (GtkColorButton *gnomecolorpicker,
- guint arg1,
- guint arg2,
- guint arg3,
- guint arg4,
gpointer user_data);
void
on_background_color_picker_color_set (GtkColorButton *gnomecolorpicker,
- guint arg1,
- guint arg2,
- guint arg3,
- guint arg4,
gpointer user_data);
void
diff --git a/src/color_palette.c b/src/color_palette.c
index 9502acc..8c259e7 100644
--- a/src/color_palette.c
+++ b/src/color_palette.c
@@ -338,7 +338,7 @@ change_color(gpaint_color_swatch *swatch, gpaint_color_mode mode)
g_assert(swatch);
canvas = canvas_lookup(swatch->widget);
gdk_gc_get_values(swatch->gc, &gcvalues);
-
+
if (mode==FOREGROUND)
{
change_foreground_color(canvas, &(gcvalues.foreground));
@@ -362,15 +362,12 @@ change_color(gpaint_color_swatch *swatch, gpaint_color_mode mode)
*/
void
on_foreground_color_picker_color_set (GtkColorButton *gnomecolorpicker,
- guint arg1,
- guint arg2,
- guint arg3,
- guint arg4,
gpointer user_data)
{
- GdkColor color = {0, arg1, arg2, arg3};
+ GdkColor color;
gpaint_canvas *canvas = canvas_lookup(GTK_WIDGET(gnomecolorpicker));
+ gtk_color_button_get_color(gnomecolorpicker, &color);
gdk_color_alloc(gdk_colormap_get_system(), &color);
change_foreground_color(canvas, &color);
}
@@ -380,15 +377,12 @@ on_foreground_color_picker_color_set (GtkColorButton *gnomecolorpicker,
*/
void
on_background_color_picker_color_set (GtkColorButton *gnomecolorpicker,
- guint arg1,
- guint arg2,
- guint arg3,
- guint arg4,
gpointer user_data)
{
- GdkColor color = {0, arg1, arg2, arg3};
+ GdkColor color;
gpaint_canvas *canvas = canvas_lookup(GTK_WIDGET(gnomecolorpicker));
+ gtk_color_button_get_color(gnomecolorpicker, &color);
gdk_color_alloc(gdk_colormap_get_system(), &color);
change_background_color(canvas, &color);
}