diff --git a/app/actions/filters-commands.c b/app/actions/filters-commands.c index 7337e0bcab..6635154bac 100644 --- a/app/actions/filters-commands.c +++ b/app/actions/filters-commands.c @@ -86,7 +86,8 @@ filters_filter_cmd_callback (GtkAction *action, } gimp_operation_tool_set_operation (GIMP_OPERATION_TOOL (active_tool), - operation, label); + operation, label, + gtk_action_get_icon_name (action)); tool_manager_initialize_active (image->gimp, display); g_free (label); diff --git a/app/tools/gimpgegltool.c b/app/tools/gimpgegltool.c index b732ea493c..fb131c4c89 100644 --- a/app/tools/gimpgegltool.c +++ b/app/tools/gimpgegltool.c @@ -421,7 +421,7 @@ gimp_gegl_tool_operation_changed (GtkWidget *widget, } gimp_operation_tool_set_operation (GIMP_OPERATION_TOOL (tool), - operation, NULL); + operation, NULL, NULL); g_free (operation); } } diff --git a/app/tools/gimpoperationtool.c b/app/tools/gimpoperationtool.c index 15f200534b..d531b903c8 100644 --- a/app/tools/gimpoperationtool.c +++ b/app/tools/gimpoperationtool.c @@ -163,6 +163,12 @@ gimp_operation_tool_finalize (GObject *object) tool->undo_desc = NULL; } + if (tool->icon_name) + { + g_free (tool->icon_name); + tool->icon_name = NULL; + } + if (tool->config) { g_object_unref (tool->config); @@ -285,6 +291,10 @@ gimp_operation_tool_dialog (GimpImageMapTool *image_map_tool) if (tool->undo_desc) gimp_tool_gui_set_description (GIMP_IMAGE_MAP_TOOL (tool)->gui, tool->undo_desc); + + if (tool->icon_name) + gimp_tool_gui_set_icon_name (GIMP_IMAGE_MAP_TOOL (tool)->gui, + tool->icon_name); } static void @@ -559,7 +569,8 @@ gimp_operation_tool_aux_notify (GimpPickableButton *button, void gimp_operation_tool_set_operation (GimpOperationTool *tool, const gchar *operation, - const gchar *undo_desc) + const gchar *undo_desc, + const gchar *icon_name) { GimpImageMapTool *im_tool; @@ -574,8 +585,12 @@ gimp_operation_tool_set_operation (GimpOperationTool *tool, if (tool->undo_desc) g_free (tool->undo_desc); + if (tool->icon_name) + g_free (tool->icon_name); + tool->operation = g_strdup (operation); tool->undo_desc = g_strdup (undo_desc); + tool->icon_name = g_strdup (icon_name); if (tool->config) g_object_unref (tool->config); @@ -674,8 +689,14 @@ gimp_operation_tool_set_operation (GimpOperationTool *tool, } } - if (undo_desc && im_tool->gui) - gimp_tool_gui_set_description (im_tool->gui, undo_desc); + if (im_tool->gui) + { + if (undo_desc) + gimp_tool_gui_set_description (im_tool->gui, undo_desc); + + if (icon_name) + gimp_tool_gui_set_icon_name (im_tool->gui, icon_name); + } if (GIMP_TOOL (tool)->drawable) { diff --git a/app/tools/gimpoperationtool.h b/app/tools/gimpoperationtool.h index d4eb60912d..608cd6c8ed 100644 --- a/app/tools/gimpoperationtool.h +++ b/app/tools/gimpoperationtool.h @@ -39,6 +39,7 @@ struct _GimpOperationTool gchar *operation; gchar *undo_desc; + gchar *icon_name; GimpObject *config; GeglNode *aux_input; @@ -62,7 +63,8 @@ GType gimp_operation_tool_get_type (void) G_GNUC_CONST; void gimp_operation_tool_set_operation (GimpOperationTool *tool, const gchar *operation, - const gchar *undo_desc); + const gchar *undo_desc, + const gchar *icon_name); #endif /* __GIMP_OPERATION_TOOL_H__ */