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

GimpFgBgEditor: free the cached icons in GtkWidget::style_set().
This commit is contained in:
Michael Natterer 2016-01-11 02:09:55 +01:00
parent 2560ad60fa
commit 0c2797c22e
1 changed files with 24 additions and 0 deletions

View File

@ -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)