Add support for layers to PagePoolAction.
ClosedPublic

Authored by masonm on Apr 29 2020, 10:58 PM.

Details

Summary

Currently PagePoolAction only supports pushing to a pageStack, but often it makes sense to use layers to push modal/contextual pages (outside of the primary pageStack flow). This change introduces support for a "useLayers" property that can be set on PagePoolAction, allowing it use the pageStack.layers StackView (if it exists). It also includes a unit test and a couple fixes uncovered by the test.

Test Plan

See the tst_layers unit test included.

Diff Detail

Repository
R169 Kirigami
Branch
add-pagepool-layer-support (branched from master)
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 26119
Build 26137: arc lint + arc unit
masonm requested review of this revision.Apr 29 2020, 10:58 PM
masonm created this revision.
masonm updated this revision to Diff 81588.Apr 30 2020, 2:23 PM

Honor checkable state of Action

masonm updated this revision to Diff 81606.Apr 30 2020, 4:48 PM

Handle checked status with exclusive groups

cblack added a subscriber: cblack.Apr 30 2020, 5:02 PM
cblack added inline comments.
autotests/pagepool/tst_layers.qml
20–26

You want to use when: windowShown

28

Unused.

src/controls/PagePoolAction.qml
63
@since 5.70
@since org.kde.kirigami 2.12
159

this isn't how you do private objects, drop property QtObject _private and access by ID

masonm updated this revision to Diff 81610.Apr 30 2020, 5:16 PM

Code review changes 1

masonm marked 4 inline comments as done.Apr 30 2020, 5:18 PM
masonm marked an inline comment as not done.Apr 30 2020, 6:26 PM
masonm added inline comments.
src/controls/PagePoolAction.qml
159

Actually I realized why I did this now: the Action type does not allow assignment to default property so it is required to create a property here. I will put a comment on this but I need to add that back into the code, unless there is another pattern for this. If I were to create another "default" property, it would still be exposed to the public. It will likely have to be one of those things people just don't touch unless they want to break something.

masonm updated this revision to Diff 81619.Apr 30 2020, 6:31 PM
masonm marked an inline comment as not done.

Add _private QtObject back and comment why

masonm updated this revision to Diff 81640.Apr 30 2020, 11:45 PM

Fix preventing layer from pushing itself

mart accepted this revision.May 4 2020, 6:56 PM
This revision is now accepted and ready to land.May 4 2020, 6:56 PM
This revision was automatically updated to reflect the committed changes.