Add Keep Aspect Ratio action to Transform Tool context menu

Before this commit, the only way to set the keep aspect ratio setting (which is pretty important) without a keyboard was by switching to Scale options, then scrolling down and sometimes scrolling sideways to get to the aspect ratio button. This commit adds an action in the context menu (right-click) that does the same thing.

This commit is related to MR !2123 (merged). It doesn't completely fix the issue of Keep Aspect Ratio on Android, but it does make it slightly easier to access. For full fix, a new design is required. It should be an option easily available in the options widget, but where? And it might or might not be either always on by default (on every tool activation) OR it should be saved from the last use of the transform tool.

Test Plan

  1. Draw something. Preferably thin in one dimension.
  2. Start the Transform Tool. Make sure the area selected around it is correct.
  3. Play with it. Then right-click and check Keep Aspect Ratio.
  4. Play with it. It should keep aspect ratio.
  5. Select Scale, and see the Keep Aspect Ratio button. It should be on.
  6. Uncheck and check the Keep Aspect Ratio checkbox in the context menu. The Keep Aspect Ratio button should have the same state.
  7. Play with the picture again. Then uncheck and check the Keep Aspect Ratio button in the options widget. If you open the context menu, the checkbox should have the same state.

Formalities Checklist

  • I confirmed this builds.
  • I confirmed Krita ran and the relevant functions work.
  • I tested the relevant unit tests and can confirm they are not broken. (If not possible, don't hesitate to ask for help!)
  • I made sure my commits build individually and have good descriptions as per KDE guidelines.
  • I made sure my code conforms to the standards set in the HACKING file.
  • I can confirm the code is licensed and attributed appropriately, and that unattributed code is mine, as per KDE Licensing Policy.
  • [Z] Does the patch add a user-visible feature? If yes, is there a documentation MR ready for it at Krita Documentation Repository?

Reminder: the reviewer is responsible for merging the patch, this is to ensure at the least two people can build the patch. In case a patch breaks the build, both the author and the reviewer should be contacted to fix the build. If this is not possible, the commits shall be reverted, and a notification with the reasoning and any relevant logs shall be sent to the mailing list, kimageshop@kde.org.

Merge request reports

Loading