Generalized Temporary Invocations & Tool Stack
Open, Needs TriagePublic

Description

Proposal

In traditional and digital art alike, It's common for artists to want to quickly switch between two or more tools.
Krita currently allows for quick switching between specific tools, for example switching to the Color Picker tool and Line Tool while the Brush Tool is active.
This proposal is to replace these special cases with a global system of temporary tool invocations for Krita 5 through the creation of a "tool stack."
The tool stack would work like this:

  1. Just like now, each tool within Krita would be bound to a user-configurable hotkey.
  2. Also like now, a quick tap on any tool's hotkey would switch tools.
  3. However, holding any tool's hotkey would start a temporary invocation of that tool.
  4. When the hotkey is finally released, the user's original tool would be made active again.
  5. Finally, Krita's Tool Options Docker could be made to show a stack of options, corresponding to each tool in the stack OR simply show the options for the top tool in the stack. (Mmmaybe user configurable?)

Technical

The heart of this proposal is adding a stack of active tools to either KoToolManager or KoToolProxy.

When the input system detects a quick press of a tool hotkey, we invoke a tool change by popping the original tool off of the stack of active tools and pushing another tool on.
When the input system detects a held tool hotkey, we begin a temporary tool invocation by simply pushing another tool onto the top of the active tool stack.
When the button is released, we pop the tool off the stack. Switching back to whatever tool was previously active.
The tool that is actually active is the one at the top of the stack.
(I can imagine this being used mostly to switch between two tools, but I guess it shouldn't have any issue scaling to an arbitrary number if the artist wants to play keyboard twister.)

Because of the new system the Tool Options docker could now be changed to better reflect temporary tool invocations.
Either by stacking another set of options widgets above or below the previous tool, or by simply showing the options widgets for the active tool.

emmetoneill renamed this task from Tool Stack & Universal Temporary Invocations to Generalized Temporary Invocations & Tool Stack.Sep 25 2020, 2:13 AM
emmetoneill updated the task description. (Show Details)

Because of the new system the Tool Options docker could now be changed to better reflect temporary tool invocations.
Either by stacking another set of options widgets above or below the previous tool, or by simply showing the options widgets for the active tool.

I think the latter would be wisest, as stacking could take up a lot of space that small screens may not be able to afford.

Hi, @emmetoneill !

There is already a stack of temporary tools in KoToolManager::Private::switchTool. We do actually use it in 'V'shortcut for straight lines.