Skip to content

Add Toggle Eraser Preset action

This action emulates switching between a pen tip and pen eraser, which switches between stored brush presets.

Test Plan

  1. Set a hotkey for "Toggle Eraser Preset" (for example, Shift+E) for triggering the action.
  2. Add the action to the toolbar for a visual indicator of whether it's checked.
  3. Select "brush" presets with the action unchecked and "eraser" presets with it checked, and check that triggering the action switches between them.
  4. Use a tablet pen with an eraser and check that it also behaves correctly, checking and unchecking the action when switching ends.
  5. Use a pen with an eraser and the hotkey interchangeably and check that it behaves correctly, without inconsistent presets or state.
  6. Restart Krita to see that the brush presets were stored and remembered correctly.

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.

Merge request reports

Loading