[Cuttlefish] Use the same actions in all menus
ClosedPublic

Authored by davidre on Dec 10 2019, 2:20 PM.

Details

Summary

Defines the actions in one place and uses them for the context menus and
buttons in the two preview panes. This reduces code duplication, adds
actions to the context menu which couldn't be triggered from there before
and makes it easier to add new features with only needing to touch one place
instead of potentially three. Furthermore this also reduces the risk of bugs
caused by copy-pasting, for example the screenshot actions didn't work before
in responsive mode.
The actionsMenu component is based on the one from Kirigami with the same name.

Test Plan

Everything works

Diff Detail

Repository
R118 Plasma SDK
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
davidre created this revision.Dec 10 2019, 2:20 PM
Restricted Application added a project: Plasma. · View Herald TranscriptDec 10 2019, 2:20 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
davidre requested review of this revision.Dec 10 2019, 2:20 PM

Nice, a very good refactor.

cuttlefish/package/contents/ui/Menu.qml
25–26

unrelated

47

Do we need to care about those? Plasma's minimum Qt version is 5.12 right now.

davidre updated this revision to Diff 71255.Dec 11 2019, 10:01 AM
davidre marked 2 inline comments as done.

Comments

davidre added inline comments.Dec 11 2019, 10:02 AM
cuttlefish/package/contents/ui/Menu.qml
25–26

Sorry that came from the copy-pasting from Kirigami

47

Dito

ngraham accepted this revision.Dec 11 2019, 10:42 AM
This revision is now accepted and ready to land.Dec 11 2019, 10:42 AM
This revision was automatically updated to reflect the committed changes.