B376086 Shift + Clicking a layer eye icon does not hide other layers

Authored by vanyossi on Apr 16 2019, 1:22 AM.



1st Shift click hides all but the clicked layer.
2nd Restore previous state.

The feature is intended to only restore state when the shift click was done but there are some questions.

  • What should happen after 1st click if user changes the visibility of many layers? should we save a different state? or recover the previous one?

Diff Detail

R37 Krita
Lint Skipped
Unit Tests Skipped
vanyossi created this revision.Apr 16 2019, 1:22 AM
Restricted Application added a reviewer: Krita. · View Herald TranscriptApr 16 2019, 1:22 AM
vanyossi requested review of this revision.Apr 16 2019, 1:22 AM
rempt added a subscriber: rempt.Apr 16 2019, 7:49 AM

If layer visibility is changed manually, the state should go back to stage 1: shift-click will hide everything but the selected layer.

Ooooooh... we have a feature like that. I guess we still have leftovers of it in KisBaseNode::Property::stateInStasis. The feature never worked as expected by the users and gave us a lot of pain. E.g.

  1. What happens if the user presses Shift+eye on one layer, then changes visibility of the hidden layer, then shift+eye again?
  2. What happens if the user presses Shift+eye on one layer, then Shift+clicks on another layer (not hidden by the previous click)? Is the old sate lost?
  3. What happens if the user does it in two different main windows/views?
  4. What happens if the user removes/adds a layer between two clicks?

I guess we still have this feature assigned to Alt+click... unless we removed it finally. I'm not sure we should recover it :(

No, alt+click is for 'isolate layer', but I suspect it has many of the same design concerns. (Though I suspect a little different when switching layers)

vanyossi updated this revision to Diff 56489.Apr 18 2019, 5:30 AM

This patch fixes shift + Click using isInStasis property for nodes, allowing to keep a state for each image on same instance different window / tab, or different instances. It keeps control off nodes from the root of each individual tree.

  • Replaces former toggleProperty.

Adds two shift functions when clicking eye:
Shift + Click: Hide all but clicked layer.

  • Clicking a group will make all layers in that group to go visible, a second shift click returns to previous state.

Shift + Control + Click: Hide all but clicked layer in context (hiding only affects siblings)

  • Clicking a group will hide all siblings and leave childs intact for review.


  1. Any normal click on another eye, or current eye, looses the state. This is by design. It is assumed that editing the visibility manually means they want to alter the state of the document.
  2. Shift + Click is a toggle, second shift + click on any layer restores previous state.
  3. Each document, on each window tab or instance, retains their state independently
  4. This depends.
    • Adding new layers reset state: this is because the mangle with the state of the tree, And could potentially set the node in a confused view state. So after new layer, we create new state.
    • Deleteing a layer preserves state. This coulb be useful to review and remove layers or groups.

This is different tha isolate layer as it work on groups and contextualized isolation. (Shift + Control)

Are the shortcuts selected ok?

Hi, @vanyossi!

Perhaps, you could highlight the eye icon somehow, when there is something in stasis? Or gray-out all hidden layers? Because right now the behavior looks really crazy. I couldn't understand how it works before I read the explanation at least three times.

That was the reason why I tried to get read of this feature long time ago. In contrast to isolated layer mode, it has no user-feedback about the presence of something in the stasis. If you manage to resolve this UIX issue somehow, I might change my opinion about the feature. Right now the feature looks better than before, but it is still hardly understandable.

Also, please close the phab revision if you're porting it to gitlab.

vanyossi abandoned this revision.Apr 26 2019, 5:07 PM

Revision moved to gitlab