[gimp] Bug 760362 - gimp-swap-colors not changed 'on the fly' when icon-theme changes



commit 0c2797c22ec88782f1c683e8b5031532bf7a345c
Author: Michael Natterer <mitch gimp org>
Date:   Mon Jan 11 02:09:55 2016 +0100

    Bug 760362 - gimp-swap-colors not changed 'on the fly' when icon-theme changes
    
    GimpFgBgEditor: free the cached icons in GtkWidget::style_set().

 app/widgets/gimpfgbgeditor.c |   24 ++++++++++++++++++++++++
 1 files changed, 24 insertions(+), 0 deletions(-)
---
diff --git a/app/widgets/gimpfgbgeditor.c b/app/widgets/gimpfgbgeditor.c
index a1d68bf..101cc4f 100644
--- a/app/widgets/gimpfgbgeditor.c
+++ b/app/widgets/gimpfgbgeditor.c
@@ -71,6 +71,8 @@ static void     gimp_fg_bg_editor_get_property    (GObject        *object,
                                                    GValue         *value,
                                                    GParamSpec     *pspec);
 
+static void     gimp_fg_bg_editor_style_set       (GtkWidget      *widget,
+                                                   GtkStyle       *prev_style);
 static gboolean gimp_fg_bg_editor_expose          (GtkWidget      *widget,
                                                    GdkEventExpose *eevent);
 static gboolean gimp_fg_bg_editor_button_press    (GtkWidget      *widget,
@@ -120,6 +122,7 @@ gimp_fg_bg_editor_class_init (GimpFgBgEditorClass *klass)
   object_class->set_property         = gimp_fg_bg_editor_set_property;
   object_class->get_property         = gimp_fg_bg_editor_get_property;
 
+  widget_class->style_set            = gimp_fg_bg_editor_style_set;
   widget_class->expose_event         = gimp_fg_bg_editor_expose;
   widget_class->button_press_event   = gimp_fg_bg_editor_button_press;
   widget_class->button_release_event = gimp_fg_bg_editor_button_release;
@@ -222,6 +225,27 @@ gimp_fg_bg_editor_get_property (GObject    *object,
     }
 }
 
+static void
+gimp_fg_bg_editor_style_set (GtkWidget *widget,
+                             GtkStyle  *prev_style)
+{
+  GimpFgBgEditor *editor = GIMP_FG_BG_EDITOR (widget);
+
+  GTK_WIDGET_CLASS (parent_class)->style_set (widget, prev_style);
+
+  if (editor->default_icon)
+    {
+      g_object_unref (editor->default_icon);
+      editor->default_icon = NULL;
+    }
+
+  if (editor->swap_icon)
+    {
+      g_object_unref (editor->swap_icon);
+      editor->swap_icon = NULL;
+    }
+}
+
 static gboolean
 gimp_fg_bg_editor_expose (GtkWidget      *widget,
                           GdkEventExpose *eevent)


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