Add hotkey to toggle between the two most recently selected layers (T1734)
ClosedPublic

Authored by nicholasl on Dec 20 2016, 2:25 AM.

Details

Summary

This patch adds a hotkey that will swap between the two most recently selected layers. This would complete task T1734.

Although it generally seems to work fine, I have noticed two minor problems that I'm not sure how to solve:

  • Using the hotkey after reordering layers will cause the wrong layer to be selected. This is because activateNodeImpl() gets called when a layer is moved around in the stack.
  • Bug 373741 ("Drawing while switching between layers with PgUp/PgDown results in a layer acting like it's in a locked group") applies and is easier to reproduce (at step 2, hold the hotkey instead of alternating page-up and page-down).

Additionally, I'm uncertain about previouslyActiveNode. Is KisNodeWSP the type I should be using? Also, am I doing the right thing to check if it's valid inside of switchToPreviouslyActiveNode()?

Diff Detail

Repository
R37 Krita
Lint
Lint Skipped
Unit
Unit Tests Skipped
nicholasl updated this revision to Diff 9201.Dec 20 2016, 2:25 AM
nicholasl retitled this revision from to Add hotkey to toggle between the two most recently selected layers (T1734).
nicholasl updated this object.
nicholasl edited the test plan for this revision. (Show Details)
nicholasl added a reviewer: Krita: Next Features.
nicholasl set the repository for this revision to R37 Krita.
rempt accepted this revision.Dec 20 2016, 10:34 AM
rempt added a reviewer: rempt.
rempt added a subscriber: rempt.

Thanks for this patch! The bug you mention is something we should ask Dmitry to look into, once he emerges from his focus on the vector tools again.

This revision is now accepted and ready to land.Dec 20 2016, 10:34 AM
nicholasl closed this revision.Dec 20 2016, 9:13 PM

(I think this should have been automatically closed by R37:aa3e7b214ac6749f18ab80115a510ac33923ddf8, but it wasn't.)