[gimp] plug-ins: set GimpColorConfig on some color buttons, more to do...



commit 8b685016228229f25fb044413c6854763e81f98b
Author: Michael Natterer <mitch gimp org>
Date:   Sun Dec 31 13:57:41 2017 +0100

    plug-ins: set GimpColorConfig on some color buttons, more to do...

 plug-ins/common/film.c |   35 +++++++++++++++++++++--------------
 plug-ins/common/grid.c |   44 ++++++++++++++++++++++++++++----------------
 2 files changed, 49 insertions(+), 30 deletions(-)
---
diff --git a/plug-ins/common/film.c b/plug-ins/common/film.c
index 352b53f..a0c0eaf 100644
--- a/plug-ins/common/film.c
+++ b/plug-ins/common/film.c
@@ -946,20 +946,21 @@ static void
 create_selection_tab (GtkWidget *notebook,
                       gint32     image_ID)
 {
-  GtkSizeGroup  *group;
-  GtkWidget     *vbox;
-  GtkWidget     *vbox2;
-  GtkWidget     *hbox;
-  GtkWidget     *table;
-  GtkWidget     *label;
-  GtkWidget     *frame;
-  GtkWidget     *toggle;
-  GtkWidget     *spinbutton;
-  GtkAdjustment *adj;
-  GtkWidget     *button;
-  GtkWidget     *font_button;
-  gint32        *image_id_list;
-  gint           nimages, j;
+  GimpColorConfig *config;
+  GtkSizeGroup    *group;
+  GtkWidget       *vbox;
+  GtkWidget       *vbox2;
+  GtkWidget       *hbox;
+  GtkWidget       *table;
+  GtkWidget       *label;
+  GtkWidget       *frame;
+  GtkWidget       *toggle;
+  GtkWidget       *spinbutton;
+  GtkAdjustment   *adj;
+  GtkWidget       *button;
+  GtkWidget       *font_button;
+  gint32          *image_id_list;
+  gint             nimages, j;
 
   hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
   gtk_container_set_border_width (GTK_CONTAINER (hbox), 12);
@@ -1038,6 +1039,9 @@ create_selection_tab (GtkWidget *notebook,
                     G_CALLBACK (gimp_color_button_get_color),
                     &filmvals.film_color);
 
+  config = gimp_get_color_configuration ();
+  gimp_color_button_set_color_config (GIMP_COLOR_BUTTON (button), config);
+
   /* Film numbering: Startindex/Font/color */
   frame = gimp_frame_new (_("Numbering"));
   gtk_box_pack_start (GTK_BOX (vbox2), frame, TRUE, TRUE, 0);
@@ -1091,6 +1095,9 @@ create_selection_tab (GtkWidget *notebook,
                     G_CALLBACK (gimp_color_button_get_color),
                     &filmvals.number_color);
 
+  gimp_color_button_set_color_config (GIMP_COLOR_BUTTON (button), config);
+  g_object_unref (config);
+
   for (j = 0; j < 2; j++)
     {
       toggle = gtk_check_button_new_with_mnemonic (j ? _("At _bottom")
diff --git a/plug-ins/common/grid.c b/plug-ins/common/grid.c
index 4579ae7..1b935d4 100644
--- a/plug-ins/common/grid.c
+++ b/plug-ins/common/grid.c
@@ -618,22 +618,23 @@ static gint
 dialog (gint32        image_ID,
         GimpDrawable *drawable)
 {
-  GtkWidget    *dlg;
-  GtkWidget    *main_vbox;
-  GtkWidget    *vbox;
-  GtkSizeGroup *group;
-  GtkWidget    *label;
-  GtkWidget    *preview;
-  GtkWidget    *button;
-  GtkWidget    *width;
-  GtkWidget    *space;
-  GtkWidget    *offset;
-  GtkWidget    *chain_button;
-  GtkWidget    *table;
-  GimpUnit      unit;
-  gdouble       xres;
-  gdouble       yres;
-  gboolean      run;
+  GimpColorConfig *config;
+  GtkWidget       *dlg;
+  GtkWidget       *main_vbox;
+  GtkWidget       *vbox;
+  GtkSizeGroup    *group;
+  GtkWidget       *label;
+  GtkWidget       *preview;
+  GtkWidget       *button;
+  GtkWidget      *width;
+  GtkWidget      *space;
+  GtkWidget      *offset;
+  GtkWidget      *chain_button;
+  GtkWidget      *table;
+  GimpUnit        unit;
+  gdouble         xres;
+  gdouble         yres;
+  gboolean        run;
 
   g_return_val_if_fail (main_dialog == NULL, FALSE);
 
@@ -909,6 +910,10 @@ dialog (gint32        image_ID,
   gtk_table_attach_defaults (GTK_TABLE (table), hcolor_button, 0, 1, 1, 2);
   gtk_widget_show (hcolor_button);
 
+  config = gimp_get_color_configuration ();
+  gimp_color_button_set_color_config (GIMP_COLOR_BUTTON (hcolor_button),
+                                      config);
+
   g_signal_connect (hcolor_button, "color-changed",
                     G_CALLBACK (gimp_color_button_get_color),
                     &grid_cfg.hcolor);
@@ -927,6 +932,9 @@ dialog (gint32        image_ID,
   gtk_table_attach_defaults (GTK_TABLE (table), vcolor_button, 1, 2, 1, 2);
   gtk_widget_show (vcolor_button);
 
+  gimp_color_button_set_color_config (GIMP_COLOR_BUTTON (vcolor_button),
+                                      config);
+
   g_signal_connect (vcolor_button, "color-changed",
                     G_CALLBACK (gimp_color_button_get_color),
                     &grid_cfg.vcolor);
@@ -945,6 +953,10 @@ dialog (gint32        image_ID,
   gtk_table_attach_defaults (GTK_TABLE (table), button, 2, 3, 1, 2);
   gtk_widget_show (button);
 
+  gimp_color_button_set_color_config (GIMP_COLOR_BUTTON (button),
+                                      config);
+  g_object_unref (config);
+
   g_signal_connect (button, "color-changed",
                     G_CALLBACK (gimp_color_button_get_color),
                     &grid_cfg.icolor);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]