~ubuntu-branches/debian/stretch/gpaint/stretch

« back to all changes in this revision

Viewing changes to debian/patches/25_fix_color_selection.diff

  • Committer: Bazaar Package Importer
  • Author(s): Goedson Teixeira Paixao
  • Date: 2009-12-29 23:04:23 UTC
  • Revision ID: james.westby@ubuntu.com-20091229230423-x1foh5o43h0xxztj
Tags: 0.3.3-6
* debian/patches/26_fix_toolbar.diff: don't set the style for the toolbar,
  allowing gpaint to follow the user's preferences (Closes: #497488)
  (LP: #127296)
* debian/patches/21_fix_crash_on_fill_button_click.dpatch: fixed the check
  for null drawing_area.
* debian/patches/*.dpatch: renamed to *.diff since we're not using dpatch
  anymore
* debian/control: added ${misc:Depends} to the binary package Depends
* debian/patches/*.diff: Added meta information tags compliant with DEP-3
  recommendations.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Author: Goedson Teixeira Paixao <goedson@debian.org>
 
2
Description: Fix foreground/background color selection
 
3
 Fixes the foreground/background color selection by checking the GtkColorButton
 
4
 color when the user chooses the color.
 
5
Bug-Ubuntu: https://bugs.edge.launchpad.net/ubuntu/+source/gpaint/+bug/344237
 
6
Forwarded: https://savannah.gnu.org/patch/index.php?7028
 
7
 
 
8
diff --git a/src/callbacks.h b/src/callbacks.h
 
9
index 985dddf..5485329 100644
 
10
--- a/src/callbacks.h
 
11
+++ b/src/callbacks.h
 
12
@@ -359,18 +359,10 @@ on_fontpicker_font_set                 (GtkFontButton *gnomefontpicker,
 
13
 
 
14
 void
 
15
 on_foreground_color_picker_color_set   (GtkColorButton *gnomecolorpicker,
 
16
-                                        guint            arg1,
 
17
-                                        guint            arg2,
 
18
-                                        guint            arg3,
 
19
-                                        guint            arg4,
 
20
                                         gpointer         user_data);
 
21
 
 
22
 void
 
23
 on_background_color_picker_color_set   (GtkColorButton *gnomecolorpicker,
 
24
-                                        guint            arg1,
 
25
-                                        guint            arg2,
 
26
-                                        guint            arg3,
 
27
-                                        guint            arg4,
 
28
                                         gpointer         user_data);
 
29
 
 
30
 void
 
31
diff --git a/src/color_palette.c b/src/color_palette.c
 
32
index 9502acc..8c259e7 100644
 
33
--- a/src/color_palette.c
 
34
+++ b/src/color_palette.c
 
35
@@ -338,7 +338,7 @@ change_color(gpaint_color_swatch *swatch, gpaint_color_mode mode)
 
36
     g_assert(swatch);
 
37
     canvas = canvas_lookup(swatch->widget);
 
38
     gdk_gc_get_values(swatch->gc, &gcvalues);
 
39
-    
 
40
+
 
41
     if (mode==FOREGROUND)
 
42
     {
 
43
         change_foreground_color(canvas, &(gcvalues.foreground));
 
44
@@ -362,15 +362,12 @@ change_color(gpaint_color_swatch *swatch, gpaint_color_mode mode)
 
45
  */
 
46
 void
 
47
 on_foreground_color_picker_color_set   (GtkColorButton *gnomecolorpicker,
 
48
-                                        guint            arg1,
 
49
-                                        guint            arg2,
 
50
-                                        guint            arg3,
 
51
-                                        guint            arg4,
 
52
                                         gpointer         user_data)
 
53
 {
 
54
-    GdkColor color = {0, arg1, arg2, arg3};
 
55
+    GdkColor color;
 
56
     gpaint_canvas *canvas = canvas_lookup(GTK_WIDGET(gnomecolorpicker));
 
57
     
 
58
+    gtk_color_button_get_color(gnomecolorpicker, &color);
 
59
     gdk_color_alloc(gdk_colormap_get_system(), &color);
 
60
     change_foreground_color(canvas, &color);
 
61
 }
 
62
@@ -380,15 +377,12 @@ on_foreground_color_picker_color_set   (GtkColorButton *gnomecolorpicker,
 
63
  */
 
64
 void
 
65
 on_background_color_picker_color_set   (GtkColorButton *gnomecolorpicker,
 
66
-                                        guint            arg1,
 
67
-                                        guint            arg2,
 
68
-                                        guint            arg3,
 
69
-                                        guint            arg4,
 
70
                                         gpointer         user_data)
 
71
 {
 
72
-    GdkColor color = {0, arg1, arg2, arg3};
 
73
+    GdkColor color;
 
74
     gpaint_canvas *canvas = canvas_lookup(GTK_WIDGET(gnomecolorpicker));
 
75
 
 
76
+    gtk_color_button_get_color(gnomecolorpicker, &color);
 
77
     gdk_color_alloc(gdk_colormap_get_system(), &color);
 
78
     change_background_color(canvas, &color);
 
79
 }