[gimp] app: set a color config on color areas created from menu actions



commit ef78897c677076d0aaecea39ce2efdb6bd6e279b
Author: Michael Natterer <mitch gimp org>
Date:   Sat May 28 03:01:37 2016 +0200

    app: set a color config on color areas created from menu actions
    
    and set a GimpContext on the actions so they can find the config.

 app/actions/edit-actions.c |    8 ++++++++
 app/widgets/gimpaction.c   |    7 +++++++
 2 files changed, 15 insertions(+), 0 deletions(-)
---
diff --git a/app/actions/edit-actions.c b/app/actions/edit-actions.c
index a9b2ec5..ec42d0d 100644
--- a/app/actions/edit-actions.c
+++ b/app/actions/edit-actions.c
@@ -233,6 +233,14 @@ edit_actions_setup (GimpActionGroup *group)
   gtk_action_set_accel_path (action, "<Actions>/edit/edit-paste-as-new");
 
   action = gtk_action_group_get_action (GTK_ACTION_GROUP (group),
+                                        "edit-fill-fg");
+  g_object_set (action, "context", context, NULL);
+
+  action = gtk_action_group_get_action (GTK_ACTION_GROUP (group),
+                                        "edit-fill-bg");
+  g_object_set (action, "context", context, NULL);
+
+  action = gtk_action_group_get_action (GTK_ACTION_GROUP (group),
                                         "edit-fill-pattern");
   g_object_set (action, "context", context, NULL);
 
diff --git a/app/widgets/gimpaction.c b/app/widgets/gimpaction.c
index 7e0f325..5d50fef 100644
--- a/app/widgets/gimpaction.c
+++ b/app/widgets/gimpaction.c
@@ -31,6 +31,9 @@
 
 #include "widgets-types.h"
 
+#include "config/gimpcoreconfig.h"
+
+#include "core/gimp.h"
 #include "core/gimpcontext.h"
 #include "core/gimpmarshal.h"
 #include "core/gimpimagefile.h"  /* eek */
@@ -389,6 +392,10 @@ gimp_action_set_proxy (GimpAction *action,
                                       GIMP_COLOR_AREA_SMALL_CHECKS, 0);
           gimp_color_area_set_draw_border (GIMP_COLOR_AREA (area), TRUE);
 
+          if (action->context)
+            gimp_color_area_set_color_config (GIMP_COLOR_AREA (area),
+                                              action->context->gimp->config->color_management);
+
           gtk_icon_size_lookup_for_settings (gtk_widget_get_settings (proxy),
                                              GTK_ICON_SIZE_MENU,
                                              &width, &height);


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