[gimp] Bug 785240 - Naming the first color in a new palette is hard
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] Bug 785240 - Naming the first color in a new palette is hard
- Date: Tue, 25 Jul 2017 20:51:34 +0000 (UTC)
commit 2a7a53b384b89f06e7dd5bb083e48fd26d005403
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.
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 2119c7d..2eb0422 100644
--- a/app/actions/palette-editor-commands.c
+++ b/app/actions/palette-editor-commands.c
@@ -32,6 +32,7 @@
#include "widgets/gimpcolordialog.h"
#include "widgets/gimpdialogfactory.h"
#include "widgets/gimppaletteeditor.h"
+#include "widgets/gimppaletteview.h"
#include "palette-editor-commands.h"
@@ -105,15 +106,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]