From fd29ee19970ad1bc1a2cf1e1cb36b35c6ae8d729 Mon Sep 17 00:00:00 2001 From: Ell Date: Sun, 11 Aug 2019 00:04:39 +0300 Subject: [PATCH] app, menus: add "Image -> Transform -> Arbitrary Rotation..." action Add a gimp-rotate-image-arbitrary action, and a corresponding "Image -> Transform -> Arbitrary Rotation..." menu entry, which activates the rotate tool in image mode (similarly to the corresponding action for layers). (cherry picked from commit 8bff415f59560ff933ad0a627be678d6fb3f9dd1) --- app/actions/tools-actions.c | 6 ++++++ app/actions/tools-commands.c | 10 +++++++++- menus/image-menu.xml.in | 1 + 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/app/actions/tools-actions.c b/app/actions/tools-actions.c index ef4fe50bd6..4758dcb6f2 100644 --- a/app/actions/tools-actions.c +++ b/app/actions/tools-actions.c @@ -63,6 +63,12 @@ static const GimpStringActionEntry tools_alternative_actions[] = NC_("tools-action", "_Arbitrary Rotation..."), "", NC_("tools-action", "Rotate by an arbitrary angle"), "gimp-rotate-layer", + GIMP_HELP_TOOL_ROTATE }, + + { "tools-rotate-image-arbitrary", GIMP_ICON_TOOL_ROTATE, + NC_("tools-action", "_Arbitrary Rotation..."), "", + NC_("tools-action", "Rotate by an arbitrary angle"), + "gimp-rotate-image", GIMP_HELP_TOOL_ROTATE } }; diff --git a/app/actions/tools-commands.c b/app/actions/tools-commands.c index 6b4e7ffc7e..f5bd9986de 100644 --- a/app/actions/tools-commands.c +++ b/app/actions/tools-commands.c @@ -80,13 +80,21 @@ tools_select_cmd_callback (GimpAction *action, tool_name = g_variant_get_string (value, NULL); - /* special case gimp-rotate-tool being called from the Layer menu */ + /* special case gimp-rotate-tool being called from the Image or Layer + * menus + */ if (strcmp (tool_name, "gimp-rotate-layer") == 0) { tool_name = "gimp-rotate-tool"; set_transform_type = TRUE; transform_type = GIMP_TRANSFORM_TYPE_LAYER; } + else if (strcmp (tool_name, "gimp-rotate-image") == 0) + { + tool_name = "gimp-rotate-tool"; + set_transform_type = TRUE; + transform_type = GIMP_TRANSFORM_TYPE_IMAGE; + } tool_info = gimp_get_tool_info (gimp, tool_name); diff --git a/menus/image-menu.xml.in b/menus/image-menu.xml.in index f72306e6db..22d353e0f7 100644 --- a/menus/image-menu.xml.in +++ b/menus/image-menu.xml.in @@ -398,6 +398,7 @@ +