Replace the custom overflow button with PrivateActionToolButton in ActionToolBar
ClosedPublic

Authored by ahiemstra on Aug 27 2019, 5:07 PM.

Details

Summary

With the fixes done to PrivateActionToolBar it now behaves a lot nicer
and we should try to make sure all other places that use a similar
button style use the same component.

Test Plan

Start Kirigami Gallery, go to the Cards Layout page, the overflow buttons there
should now properly open and close the menus and not get stuck in a checked
state.

Diff Detail

Repository
R169 Kirigami
Branch
actionbutton_overflow
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 15705
Build 15723: arc lint + arc unit
ahiemstra created this revision.Aug 27 2019, 5:07 PM
Restricted Application added a project: Kirigami. · View Herald TranscriptAug 27 2019, 5:07 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
ahiemstra requested review of this revision.Aug 27 2019, 5:07 PM
apol added a subscriber: apol.Aug 28 2019, 12:12 AM
apol added inline comments.
src/controls/ActionToolBar.qml
183

it could be children: [].concat(root.actions).concat(hiddenActions); no?

207

since it's boolean, you can do:
visible: !actionsLayout.isActionVisible(ourAction) && (ourAction.visible === undefined || ourAction.visible)

ahiemstra added inline comments.Aug 28 2019, 9:28 AM
src/controls/ActionToolBar.qml
183

Ah, I didn't know about concat(). I actually looked for something like that but seem to have missed it.

ahiemstra updated this revision to Diff 64810.Aug 28 2019, 10:01 AM
  • Address review comments
ahiemstra marked 2 inline comments as done.Aug 28 2019, 10:02 AM
ahiemstra added inline comments.
src/controls/ActionToolBar.qml
183

Of course, things weren't as simple as that since root.actions and hiddenActions are list properties not normal JS arrays. But I found a solution.

mart accepted this revision.Sep 3 2019, 10:22 AM
This revision is now accepted and ready to land.Sep 3 2019, 10:22 AM
This revision was automatically updated to reflect the committed changes.