From: Jim Evins Date: Sun, 3 Apr 2005 01:44:51 +0000 (+0000) Subject: 2005-04-02 Jim Evins X-Git-Tag: glabels-2_3_0~435 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=27bba0435e5a44ee0a63086c01872eaf070ce3d0;p=glabels 2005-04-02 Jim Evins * src/mygal/color-palette.c: (color_palette_change_custom_color), (cust_color_set), (color_palette_setup): * src/mygal/color-palette.h: Replaced deprecated GnomeColorPicker with GtkColorButton. git-svn-id: https://glabels.svn.sourceforge.net/svnroot/glabels/trunk@512 f5e0f49d-192f-0410-a22d-a8d8700d0965 --- diff --git a/glabels2/ChangeLog b/glabels2/ChangeLog index 9e6139a2..a5d67ed4 100644 --- a/glabels2/ChangeLog +++ b/glabels2/ChangeLog @@ -1,3 +1,10 @@ +2005-04-02 Jim Evins + + * src/mygal/color-palette.c: (color_palette_change_custom_color), + (cust_color_set), (color_palette_setup): + * src/mygal/color-palette.h: + Replaced deprecated GnomeColorPicker with GtkColorButton. + 2005-04-02 Jim Evins * docs/libglabels/libglabels-sections.txt: diff --git a/glabels2/src/mygal/color-palette.c b/glabels2/src/mygal/color-palette.c index 063b7ba0..49d47795 100644 --- a/glabels2/src/mygal/color-palette.c +++ b/glabels2/src/mygal/color-palette.c @@ -149,7 +149,7 @@ emit_color_changed (ColorPalette *P, GdkColor *color, * Add the new custom color as the first custom color in the custom color rows * and shift all of the others 'one step down' * - * Also take care of setting up the GnomeColorPicker 'display' + * Also take care of setting up the GtkColorButton 'display' */ static void color_palette_change_custom_color (ColorPalette *P, GdkColor const * const new) @@ -188,11 +188,7 @@ color_palette_change_custom_color (ColorPalette *P, GdkColor const * const new) "fill_color_gdk", new, "outline_color_gdk", new, NULL); - gnome_color_picker_set_i16 (P->picker, - new->red, - new->green, - new->blue, - 0); + gtk_color_button_set_color (P->picker, new); } /* @@ -200,14 +196,11 @@ color_palette_change_custom_color (ColorPalette *P, GdkColor const * const new) * And add it to the custom color row */ static void -cust_color_set (GtkWidget *color_picker, guint r, guint g, guint b, guint a, - ColorPalette *P) +cust_color_set (GtkWidget *color_picker, ColorPalette *P) { GdkColor c_color; - c_color.red = (gushort)r; - c_color.green = (gushort)g; - c_color.blue = (gushort)b; + gtk_color_button_get_color (GTK_COLOR_BUTTON (color_picker), &c_color); e_color_alloc_gdk (NULL, &c_color); emit_color_changed (P, &c_color, TRUE, TRUE, FALSE); @@ -434,19 +427,19 @@ color_palette_setup (ColorPalette *P, P->total = total; - /* "Custom" color - we'll pop up a GnomeColorPicker */ + /* "Custom" color - we'll pop up a GtkColorButton */ cust_label = gtk_label_new (_("Custom Color:")); gtk_table_attach (GTK_TABLE (table), cust_label, 0, ncols - 3 , row + 1, row + 2, GTK_FILL | GTK_EXPAND, 0, 0, 0); /* - Keep a poier to the picker so that we can update it's color + Keep a pointer to the picker so that we can update it's color to keep it in synch with that of other members of the group */ - P->picker = GNOME_COLOR_PICKER (gnome_color_picker_new ()); - gnome_color_picker_set_title (P->picker, _("Choose Custom Color")); + P->picker = GTK_COLOR_BUTTON (gtk_color_button_new ()); + gtk_color_button_set_title (P->picker, _("Choose Custom Color")); gtk_table_attach (GTK_TABLE (table), GTK_WIDGET (P->picker), ncols - 3, ncols, row + 1, row + 2, GTK_FILL | GTK_EXPAND, 0, 0, 0); - g_signal_connect (P->picker, "color_set", + g_signal_connect (P->picker, "color-set", G_CALLBACK (cust_color_set), P); return table; } diff --git a/glabels2/src/mygal/color-palette.h b/glabels2/src/mygal/color-palette.h index 8075e2a3..b2b281c7 100644 --- a/glabels2/src/mygal/color-palette.h +++ b/glabels2/src/mygal/color-palette.h @@ -36,8 +36,8 @@ #include #include #include +#include #include -#include #include "color-group.h" G_BEGIN_DECLS @@ -47,7 +47,7 @@ typedef struct _ColorNamePair ColorNamePair; typedef struct _ColorPalette { GtkVBox vbox; GtkTooltips *tool_tip; - GnomeColorPicker *picker; + GtkColorButton *picker; /* * Array of colors */