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).
This commit is contained in:
Ell 2019-08-11 00:04:39 +03:00
parent 52ad37a2aa
commit 8bff415f59
3 changed files with 16 additions and 1 deletions

View File

@ -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 }
};

View File

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

View File

@ -402,6 +402,7 @@
<menuitem action="image-rotate-90" />
<menuitem action="image-rotate-270" />
<menuitem action="image-rotate-180" />
<menuitem action="tools-rotate-image-arbitrary" />
</placeholder>
<separator />
</menu>