[gimp] libgimpwidgets: set the color config on the "GIMP" page of color selectors



commit bd38b7b9fdc83b924765a936ea1ebcba1e21adf9
Author: Michael Natterer <mitch gimp org>
Date:   Thu May 26 22:23:29 2016 +0200

    libgimpwidgets: set the color config on the "GIMP" page of color selectors

 libgimpwidgets/gimpcolorselect.c |   22 ++++++++++++++++++++++
 1 files changed, 22 insertions(+), 0 deletions(-)
---
diff --git a/libgimpwidgets/gimpcolorselect.c b/libgimpwidgets/gimpcolorselect.c
index 3eb8581..df1c9a2 100644
--- a/libgimpwidgets/gimpcolorselect.c
+++ b/libgimpwidgets/gimpcolorselect.c
@@ -154,6 +154,8 @@ static void   gimp_color_select_set_color       (GimpColorSelector  *selector,
                                                  const GimpHSV      *hsv);
 static void   gimp_color_select_set_channel     (GimpColorSelector  *selector,
                                                  GimpColorSelectorChannel  channel);
+static void   gimp_color_select_set_config      (GimpColorSelector  *selector,
+                                                 GimpColorConfig    *config);
 
 static void   gimp_color_select_channel_toggled (GtkWidget          *widget,
                                                  GimpColorSelect    *select);
@@ -243,6 +245,7 @@ gimp_color_select_class_init (GimpColorSelectClass *klass)
   selector_class->set_toggles_sensitive = gimp_color_select_togg_sensitive;
   selector_class->set_color             = gimp_color_select_set_color;
   selector_class->set_channel           = gimp_color_select_set_channel;
+  selector_class->set_config            = gimp_color_select_set_config;
 }
 
 static void
@@ -266,6 +269,8 @@ gimp_color_select_init (GimpColorSelect *select)
   gtk_widget_show (frame);
 
   select->xy_color = gimp_preview_area_new ();
+  g_object_add_weak_pointer (G_OBJECT (select->xy_color),
+                             (gpointer) &select->xy_color);
   gtk_widget_set_size_request (select->xy_color,
                                GIMP_COLOR_SELECTOR_SIZE,
                                GIMP_COLOR_SELECTOR_SIZE);
@@ -295,6 +300,8 @@ gimp_color_select_init (GimpColorSelect *select)
   gtk_widget_show (frame);
 
   select->z_color = gimp_preview_area_new ();
+  g_object_add_weak_pointer (G_OBJECT (select->z_color),
+                             (gpointer) &select->z_color);
   gtk_widget_set_size_request (select->z_color,
                                GIMP_COLOR_SELECTOR_BAR_SIZE, -1);
   gtk_widget_set_events (select->z_color, COLOR_AREA_EVENT_MASK);
@@ -433,6 +440,21 @@ gimp_color_select_set_channel (GimpColorSelector        *selector,
 }
 
 static void
+gimp_color_select_set_config (GimpColorSelector *selector,
+                              GimpColorConfig   *config)
+{
+  GimpColorSelect *select = GIMP_COLOR_SELECT (selector);
+
+  if (select->xy_color)
+    gimp_preview_area_set_color_config (GIMP_PREVIEW_AREA (select->xy_color),
+                                        config);
+
+  if (select->z_color)
+    gimp_preview_area_set_color_config (GIMP_PREVIEW_AREA (select->z_color),
+                                        config);
+}
+
+static void
 gimp_color_select_channel_toggled (GtkWidget       *widget,
                                    GimpColorSelect *select)
 {


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