Skip to content

Add new tool invocation action: Activate with Other Color

New tool invocation action: "Activate with Other Color". With the brush tool, shape tools and fill tools, this is the same as "Activate", but uses the secondary/background color instead of the primary/foreground color. For tools where this doesn't matter, it is the same as "Activate".

The basic functionality works with brush tools, many shape tools (those that do not require multiple clicks, e.g. polyline) and flood fill.

Rationale: this is important for many pixel artists and also for me. There is at least some interest for this, based on discussions like:

Draft issues:

  • Support color sampler
  • Support polyline and path tools; currently always uses the primary color
  • Documentation?

Implementation:

I thought the most straightforward way to implement this was to add a new flag into the canvas resources, which is also where the current color selections live. However, there may be a better solution that I am not aware of, so feedback is welcome.

Test Plan

  1. Settings > Configure Krita... > Canvas Input Settings
  2. Remove e.g. the right mouse button from its default binding to the popup palette
  3. Bind this under Tool Invocation to the new "Activate with Other Color"
  4. Save settings
  5. Select a distinct foreground and background color
  6. Select a drawing tool
  7. Try to use the drawing tool, including with the new binding

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.

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.

Edited by ziplantil ..

Merge request reports