Add shortcut actions for each transform tool mode

This is an attempt to implement this feature request: https://krita-artists.org/t/transform-shortcuts/30784

I'm unsure if the action stuff is too hacky. It was meant to copy how activateTool in the factory superclass works, but maybe abuses tool actions by using the supported but otherwise unused "always_enabled" flag.

The mode is supplied to the transform tool before activation, avoiding the need to cancel the initial stroke which would otherwise clobber any mode changes with its transactionGenerated signal.

Test Plan

Bind the new actions found in Settings -> configure krita -> keyboard shortcuts -> Tools/Tool Shortcuts (I used ctrl+alt+shift+1,2,3,4,5,6 to test)

Test that the hotkeys change modes, and switch to the transform tool when necessary

Test that the hotkeys do not cause a segfault when no document is open :(

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!)
The following tests FAILED:
    255 - libs-kritaresources-TestTagModel (Failed)
    291 - plugins-impex-psd-kis_psd_test (Subprocess aborted)
  • 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.
  • Does the patch add a user-visible feature? If yes, is there a documentation MR ready for it at Krita Documentation Repository?

Sort of but it's very discoverable

Merge request reports

Loading