Skip to content

Add and use eraser cursors for non-brush paint tools

R. B. requested to merge tomtomtom/krita:tomtomtom/erasercursors into master

A common source of confusion is that there is no obvious indicator of when paint tools like gradient tool, line tool, etc. are in eraser mode. Consequently, a user might attempt to use these tools on empty content and might not realize they're in eraser mode, or that eraser mode even applies to non-brush paint tools.

https://krita-artists.org/t/beta-5-1-feature-request-erase-cursor-not-just-for-brush-tool/43500

This MR adds and uses cursors with added eraser indicators for such tools (Line, Rectangle, Ellipse, Fill, Gradient). They're basically just the standard tool icon cursors but with added eraser icons. I don't think I'd make it configurable since this workflow is a bit specific.

TODO:

  • Add and use eraser cursors for Polygon, Polyline, Bezier Curve, Freehand Path, and maybe Enclose-and-fill.
  • Slightly tweak the freehand brush eraser cursor to make the eraser indicator a bit less detached from the main cursor, and maybe a bit smaller.

Test Plan

  • Test that the eraser indicators are properly shown/hidden when toggling eraser mode, when switching tools, and when switching brushes with shortcuts.
  • Test that the relevant tools don't show eraser indicators on vector layers (Line, Rectangle, Ellipse).

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 R. B.

Merge request reports