[gimp/gimp-2-10] app: update fg/bg colors when committing a colormap change.



commit 628960ed22662e19045fafe840df900c8358fdd3
Author: Jehan <jehan girinstud io>
Date:   Fri Mar 8 16:32:53 2019 +0100

    app: update fg/bg colors when committing a colormap change.
    
    Since the color being currently edited is the selected one, it makes
    sense that the fg/bg color should be updated appropriately.

 app/widgets/gimpcolormapeditor.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
---
diff --git a/app/widgets/gimpcolormapeditor.c b/app/widgets/gimpcolormapeditor.c
index 0b27511582..6ff67be003 100644
--- a/app/widgets/gimpcolormapeditor.c
+++ b/app/widgets/gimpcolormapeditor.c
@@ -770,7 +770,8 @@ gimp_colormap_editor_edit_color_update (GimpColorDialog      *dialog,
                                         GimpColorDialogState  state,
                                         GimpColormapEditor   *editor)
 {
-  GimpImage *image = GIMP_IMAGE_EDITOR (editor)->image;
+  GimpImageEditor *image_editor = GIMP_IMAGE_EDITOR (editor);
+  GimpImage       *image        = image_editor->image;
 
   if (image)
     {
@@ -781,6 +782,11 @@ gimp_colormap_editor_edit_color_update (GimpColorDialog      *dialog,
   switch (state)
     {
     case GIMP_COLOR_DIALOG_OK:
+      if (state & gimp_get_toggle_behavior_mask ())
+        gimp_context_set_background (image_editor->context, color);
+      else
+        gimp_context_set_foreground (image_editor->context, color);
+      /* Pass through */
     case GIMP_COLOR_DIALOG_CANCEL:
       gtk_widget_hide (editor->color_dialog);
       break;


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