[gimp/gimp-2-8] Bug 785240 - Naming the first color in a new palette is hard



commit 15fe785ba3f256e6a8247c99853494edf6eaf9cb
Author: Michael Natterer <mitch gimp org>
Date:   Tue Jul 25 22:50:15 2017 +0200

    Bug 785240 - Naming the first color in a new palette is hard
    
    Use the proper API to select a newly added palette color, so all
    internal states are updated and the entry becomes editable.
    
    (cherry picked from commit 2a7a53b384b89f06e7dd5bb083e48fd26d005403)

 app/actions/palette-editor-commands.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/app/actions/palette-editor-commands.c b/app/actions/palette-editor-commands.c
index 43fe8c0..684c1b3 100644
--- a/app/actions/palette-editor-commands.c
+++ b/app/actions/palette-editor-commands.c
@@ -31,6 +31,7 @@
 #include "widgets/gimpcolordialog.h"
 #include "widgets/gimpdialogfactory.h"
 #include "widgets/gimppaletteeditor.h"
+#include "widgets/gimppaletteview.h"
 
 #include "palette-editor-commands.h"
 
@@ -104,15 +105,17 @@ palette_editor_new_color_cmd_callback (GtkAction *action,
 
   if (data_editor->data_editable)
     {
-      GimpPalette *palette = GIMP_PALETTE (data_editor->data);
-      GimpRGB      color;
+      GimpPalette      *palette = GIMP_PALETTE (data_editor->data);
+      GimpPaletteEntry *entry;
+      GimpRGB           color;
 
       if (value)
         gimp_context_get_background (data_editor->context, &color);
       else
         gimp_context_get_foreground (data_editor->context, &color);
 
-      editor->color = gimp_palette_add_entry (palette, -1, NULL, &color);
+      entry = gimp_palette_add_entry (palette, -1, NULL, &color);
+      gimp_palette_view_select_entry (GIMP_PALETTE_VIEW (editor->view), entry);
     }
 }
 


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