]> git.sur5r.net Git - glabels/commitdiff
2005-04-02 Jim Evins <evins@snaught.com>
authorJim Evins <evins@snaught.com>
Sun, 3 Apr 2005 01:44:51 +0000 (01:44 +0000)
committerJim Evins <evins@snaught.com>
Sun, 3 Apr 2005 01:44:51 +0000 (01:44 +0000)
* 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

glabels2/ChangeLog
glabels2/src/mygal/color-palette.c
glabels2/src/mygal/color-palette.h

index 9e6139a278ed3f84b3be652f4e9676366157e614..a5d67ed40458bfb1f82c0d12c3179997a96ef49d 100644 (file)
@@ -1,3 +1,10 @@
+2005-04-02  Jim Evins <evins@snaught.com>
+
+       * 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 <evins@snaught.com>
 
        * docs/libglabels/libglabels-sections.txt:
index 063b7ba04861e7e35ee2eee432df742e591492b9..49d477951d6180ee061d8eb47d63146636885059 100644 (file)
@@ -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;
 }
index 8075e2a3a2a0179a37cc974993317bf87bc31fb2..b2b281c78c363b4055d51ef0b84a939cf14757f9 100644 (file)
@@ -36,8 +36,8 @@
 #include <gtk/gtktooltips.h>
 #include <gtk/gtkvbox.h>
 #include <gtk/gtkwidget.h>
+#include <gtk/gtkcolorbutton.h>
 #include <libgnomecanvas/gnome-canvas.h>
-#include <libgnomeui/gnome-color-picker.h>
 #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
         */