[gimp] app: update the GimpFgBgEditor when image colormap is updated.
- From: Jehan <jehanp src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] app: update the GimpFgBgEditor when image colormap is updated.
- Date: Wed, 6 Mar 2019 23:02:20 +0000 (UTC)
commit 8e8b4e82c14071d4d84a8350b07dc0968e747fb4
Author: Jehan <jehan girinstud io>
Date: Wed Mar 6 23:51:23 2019 +0100
app: update the GimpFgBgEditor when image colormap is updated.
app/widgets/gimpfgbgeditor.c | 27 ++++++++++++++++++++++++---
1 file changed, 24 insertions(+), 3 deletions(-)
---
diff --git a/app/widgets/gimpfgbgeditor.c b/app/widgets/gimpfgbgeditor.c
index bb56a17d11..be9468eecf 100644
--- a/app/widgets/gimpfgbgeditor.c
+++ b/app/widgets/gimpfgbgeditor.c
@@ -882,9 +882,20 @@ gimp_fg_bg_editor_image_changed (GimpFgBgEditor *editor,
gtk_widget_queue_draw (GTK_WIDGET (editor));
if (editor->active_image)
- g_signal_handlers_disconnect_by_func (editor->active_image,
- G_CALLBACK (gtk_widget_queue_draw),
- editor);
+ {
+ g_signal_handlers_disconnect_by_func (editor->active_image,
+ G_CALLBACK (gtk_widget_queue_draw),
+ editor);
+ if (gimp_image_get_base_type (editor->active_image) == GIMP_INDEXED)
+ {
+ GimpPalette *palette;
+
+ palette = gimp_image_get_colormap_palette (editor->active_image);
+ g_signal_handlers_disconnect_by_func (palette,
+ G_CALLBACK (gtk_widget_queue_draw),
+ editor);
+ }
+ }
editor->active_image = image;
if (image)
{
@@ -894,5 +905,15 @@ gimp_fg_bg_editor_image_changed (GimpFgBgEditor *editor,
g_signal_connect_swapped (image, "colormap-changed",
G_CALLBACK (gtk_widget_queue_draw),
editor);
+
+ if (gimp_image_get_base_type (image) == GIMP_INDEXED)
+ {
+ GimpPalette *palette;
+
+ palette = gimp_image_get_colormap_palette (editor->active_image);
+ g_signal_connect_swapped (palette, "dirty",
+ G_CALLBACK (gtk_widget_queue_draw),
+ editor);
+ }
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]