Skip to content

Toggle the canvas-only mode with four-finger tap

On Android, there is usually no keyboard for shortcuts and toggling the canvas-only mode through the popup palette is rather tedious. To streamline the workflow, I have implemented an input action to toggle the canvas-only mode and hooked it to a four-finger tap gesture.

A have marked the MR as WIP, as I am unsure about several things:

  1. What should priority be set to in KisCanvasOnlyAction::priority()?
  2. Is the way the action is added to KisInputManager::Private::addTouchShortcut correct?
  3. Is four-finger tap the right gesture for this? I have chosen it merely because three-finger (though the code said 3-10 touchpoints) gesture was already used for panning. Also, three-finger drag is easier to do while holding the stylus, so it might be better reserved for panning. Other software seems not to be consistent in this (namely, Autodesk Sketchbook uses three fingers, while Procreate uses four).
  4. Is there a way to force reloading the input profile when it changes in the source (with a version number or something similar)? When I just updated the APK on the Android device, the gesture was not set up. I solved it by deleting Krita's data and let it recreate it on next startup.

Test Plan

  1. Test the four-finger tap gesture.
    A.
    Given a document is open and Krita is in normal mode
    When the user taps the canvas with four fingers
    Then Krita switches to the canvas-only mode

    B.
    Given a document is open and Krita is in canvas-only mode
    When the user taps the canvas with four fingers
    Then Krita switches to the normal mode\

  2. Test that other gestures remain unaffected: zoom and rotate (two-finger drag), pan (three-finger drag).

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.
Edited by Anna Medonosová

Merge request reports