Commit 61025c60 authored by Michael Natterer's avatar Michael Natterer 😴

Bug 624824 - use gtk-image-menu-item-set-always-show-image on some menu items

Always show icons for:

- Fill FG/BG/Pattern
- Rotate
- Recently opened
- Open images
parent 9ec725c2
......@@ -149,6 +149,15 @@ drawable_actions_setup (GimpActionGroup *group)
drawable_rotate_actions,
G_N_ELEMENTS (drawable_rotate_actions),
G_CALLBACK (drawable_rotate_cmd_callback));
#define SET_ALWAYS_SHOW_IMAGE(action,show) \
gimp_action_group_set_action_always_show_image (group, action, show)
SET_ALWAYS_SHOW_IMAGE ("drawable-rotate-90", TRUE);
SET_ALWAYS_SHOW_IMAGE ("drawable-rotate-180", TRUE);
SET_ALWAYS_SHOW_IMAGE ("drawable-rotate-270", TRUE);
#undef SET_ALWAYS_SHOW_IMAGE
}
void
......
......@@ -252,6 +252,15 @@ edit_actions_setup (GimpActionGroup *group)
pattern = gimp_context_get_pattern (context);
edit_actions_pattern_changed (context, pattern, group);
#define SET_ALWAYS_SHOW_IMAGE(action,show) \
gimp_action_group_set_action_always_show_image (group, action, show)
SET_ALWAYS_SHOW_IMAGE ("edit-fill-fg", TRUE);
SET_ALWAYS_SHOW_IMAGE ("edit-fill-bg", TRUE);
SET_ALWAYS_SHOW_IMAGE ("edit-fill-pattern", TRUE);
#undef SET_ALWAYS_SHOW_IMAGE
}
void
......
......@@ -207,6 +207,8 @@ file_actions_setup (GimpActionGroup *group)
GtkAction *action;
gimp_action_group_set_action_visible (group, entries[i].name, FALSE);
gimp_action_group_set_action_always_show_image (group, entries[i].name,
TRUE);
action = gtk_action_group_get_action (GTK_ACTION_GROUP (group),
entries[i].name);
......
......@@ -213,6 +213,15 @@ image_actions_setup (GimpActionGroup *group)
image_rotate_actions,
G_N_ELEMENTS (image_rotate_actions),
G_CALLBACK (image_rotate_cmd_callback));
#define SET_ALWAYS_SHOW_IMAGE(action,show) \
gimp_action_group_set_action_always_show_image (group, action, show)
SET_ALWAYS_SHOW_IMAGE ("image-rotate-90", TRUE);
SET_ALWAYS_SHOW_IMAGE ("image-rotate-180", TRUE);
SET_ALWAYS_SHOW_IMAGE ("image-rotate-270", TRUE);
#undef SET_ALWAYS_SHOW_IMAGE
}
void
......
......@@ -270,6 +270,9 @@ windows_actions_image_notify (GimpDisplay *display,
gimp_action_group_add_actions (group, NULL, &entry, 1);
gimp_action_group_set_action_always_show_image (group, action_name,
TRUE);
action = gtk_action_group_get_action (GTK_ACTION_GROUP (group),
action_name);
......
......@@ -925,3 +925,26 @@ gimp_action_group_set_action_hide_empty (GimpActionGroup *group,
g_object_set (action, "hide-if-empty", hide_empty ? TRUE : FALSE, NULL);
}
void
gimp_action_group_set_action_always_show_image (GimpActionGroup *group,
const gchar *action_name,
gboolean always_show_image)
{
GtkAction *action;
g_return_if_fail (GIMP_IS_ACTION_GROUP (group));
g_return_if_fail (action_name != NULL);
action = gtk_action_group_get_action (GTK_ACTION_GROUP (group), action_name);
if (! action)
{
g_warning ("%s: Unable to set \"always-show-image\" of action "
"which doesn't exist: %s",
G_STRFUNC, action_name);
return;
}
gtk_action_set_always_show_image (action, always_show_image);
}
......@@ -200,6 +200,9 @@ void gimp_action_group_set_action_viewable (GimpActionGroup *group,
void gimp_action_group_set_action_hide_empty (GimpActionGroup *group,
const gchar *action_name,
gboolean hide_empty);
void gimp_action_group_set_action_always_show_image (GimpActionGroup *group,
const gchar *action_name,
gboolean always_show_image);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment