I started working on "bug 373060 - allow to easily switch to last used tool"
and ran into design problems, so am I taking this here. I already have a
strong idea on what the feature should be

At first, i tried to implement the feature like the swap_color feature
inside app/core/gimpcontext.[ch], but on GimpTool.
I've made a first patch implementing that straight GimpTool swapping and
posted it on bugzilla (see comment #12), but I'm really not satisfied with
this : it does only creates a redundant keyboard shortcut, which I really
find useless.

So I crafted a new user scenario :

As a gimp user, I know existing shortcuts, I may even have rearranged them
to fit better to my workflow, be more accessible on my kb layout and so on.
When I want to switch to the last used tool, I really mean the last tool I
found useful and actually used. Not the selection tool I switched on in the
meantime to restrict the area I'm painting on, but this red grunge textured
paintbrush I used before switching to a corrective tiny round with erase
blending mode.

Hope you follow my thoughts.

The Idea is :
- switching to last actual GimpTool is not enough, it's not that useful
(wasting a key) and cannot track changes on the same tool's options, that is
the part where you tweak your current options to make the tiniest changes,
and cannot revert back to your previous options because you did not use
another tool.
+ So, let's make a snapshot of what the user actually uses - tool, colors,
brush, pattern, gradient, dynamics, tool options, ... - and keep it
somewhere to restore it later.

- Then it keeps track of every tool, every tiniest changes if possible to
track them, not the useful ones.
In a real painting area, that would mean switching back to your glass of
fresh diet coke instead of that big blue oiled brush, or switching to the
brush you are using with a more orthogonal tilt instead of the red one you
just used before. Stupid.
+ So we don't want to track every changes, we want to allow the user to
decide that this tool he is using right now is really useful, and that he
wants to restore it exactly as it is.

For users who owns a tablet with a stylus+eraser, this feature would just do
the same as turning your pen upside down to use the other tool.

I quickly described a possible user interaction in comment #13 on bugzilla :

I think this feature should backup and restore a snapshot of the entire
GimpContext, not only the GimpTool.

User Interaction :
- Keyboard shortcut : <shift>X
- On first use, the active context is backed up but remains active.
- On next uses, the active context is backed up, and previously saved
is restored.

This would allow a more complete user-defined tool swapping instead of just
swapping different GimpTools back and forth.

Now I wonder how and where to implement it. The context systems seems more
spread and complex than just swapping GimpTools as I did on my first

Furthermore, Mitch pointed out that gimp has had that kind of feature ages
ago, and I dug up a related commit from ChangeLog.pre-2-0 :
2003-02-25  Sven Neumann  <s...@gimp.org>
    * app/gui/tools-commands.[ch]: removed "Swap Contexts" functionality.
Sven, may you remember what was the reason of this removal ? (7 years ago)

Wise people, please advise me.

Gimp-developer mailing list

Reply via email to