mirror of https://github.com/GNOME/gimp.git
app: add gimp_tool_gui_set_icon_name()
This commit is contained in:
parent
7d89de708e
commit
453882c81e
|
@ -63,6 +63,7 @@ struct _GimpToolGuiPrivate
|
|||
{
|
||||
GimpToolInfo *tool_info;
|
||||
gchar *description;
|
||||
gchar *icon_name;
|
||||
GList *response_entries;
|
||||
gint default_response;
|
||||
gboolean focus_on_map;
|
||||
|
@ -186,6 +187,12 @@ gimp_tool_gui_finalize (GObject *object)
|
|||
private->description = NULL;
|
||||
}
|
||||
|
||||
if (private->icon_name)
|
||||
{
|
||||
g_free (private->icon_name);
|
||||
private->icon_name = NULL;
|
||||
}
|
||||
|
||||
if (private->response_entries)
|
||||
{
|
||||
g_list_free_full (private->response_entries,
|
||||
|
@ -282,6 +289,35 @@ gimp_tool_gui_set_description (GimpToolGui *gui,
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
gimp_tool_gui_set_icon_name (GimpToolGui *gui,
|
||||
const gchar *icon_name)
|
||||
{
|
||||
GimpToolGuiPrivate *private;
|
||||
|
||||
g_return_if_fail (GIMP_IS_TOOL_GUI (gui));
|
||||
|
||||
private = GET_PRIVATE (gui);
|
||||
|
||||
if (icon_name == private->icon_name)
|
||||
return;
|
||||
|
||||
g_free (private->icon_name);
|
||||
private->icon_name = g_strdup (icon_name);
|
||||
|
||||
if (! icon_name)
|
||||
icon_name = gimp_viewable_get_icon_name (GIMP_VIEWABLE (private->tool_info));
|
||||
|
||||
if (private->overlay)
|
||||
{
|
||||
/* TODO */
|
||||
}
|
||||
else
|
||||
{
|
||||
g_object_set (private->dialog, "icon-name", icon_name, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
gimp_tool_gui_set_shell (GimpToolGui *gui,
|
||||
GimpDisplayShell *shell)
|
||||
|
|
|
@ -61,6 +61,8 @@ GimpToolGui * gimp_tool_gui_new (GimpToolInfo *tool_info,
|
|||
|
||||
void gimp_tool_gui_set_description (GimpToolGui *gui,
|
||||
const gchar *description);
|
||||
void gimp_tool_gui_set_icon_name (GimpToolGui *gui,
|
||||
const gchar *icon_name);
|
||||
|
||||
void gimp_tool_gui_set_shell (GimpToolGui *gui,
|
||||
GimpDisplayShell *shell);
|
||||
|
|
Loading…
Reference in New Issue