[gimp] app, menus: add "Image -> Transform -> Arbitrary Rotation..." action



commit 8bff415f59560ff933ad0a627be678d6fb3f9dd1
Author: Ell <ell_se yahoo com>
Date:   Sun Aug 11 00:04:39 2019 +0300

    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).

 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 11b1604f92..6b8b6de956 100644
--- a/menus/image-menu.xml.in
+++ b/menus/image-menu.xml.in
@@ -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>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]