5pragma ComponentBehavior: Bound
8import QtQuick.Controls as QQC2
9import QtQuick.Controls as T
11import Qt.labs.qmlmodels
13import org.kde.kirigami as Kirigami
14import org.kde.kirigamiaddons.components as KirigamiComponents
15import org.kde.kirigamiaddons.formcard as FormCard
20 required property list<T.Action> actions
21 required
property T.StackView stackView
22 required
property KirigamiComponents.BottomDrawer drawer
25 Layout.fillWidth:
true
27 property Component itemDelegate:
FormCard.FormButtonDelegate {
30 required
property T.Action modelData
33 visible: modelData.visible === undefined || modelData.visible
37 visible: modelData.checkable
42 focusPolicy:
Qt.NoFocus
43 visible: !(modelData instanceof
Kirigami.Action) || !modelData.autoExclusive
55 Accessible.ignored: true
62 visible: modelData instanceof
Kirigami.
Action && modelData.autoExclusive
74 Accessible.ignored: true
79 when: !(modelData instanceof
Kirigami.
Action) || modelData.children.length === 0
80 target: button.trailingLogo
86 if (modelData instanceof
Kirigami.Action && modelData.children.length > 0) {
87 root.stackView.push(Qt.resolvedUrl(
'./ContextMenuPage.qml'), {
88 stackView: root.stackView,
89 actions: modelData.children,
90 title: modelData.text,
98 property Component separatorDelegate:
FormCard.FormDelegateSeparator {
99 property T.Action action
100 visible: !(action instanceof
Kirigami.Action) || action.visible
102 property Component loaderDelegate: Loader {
103 property T.Action action
104 Layout.fillWidth: item?.Layout.fillWidth ??
true
108 id: actionsInstantiator
114 required
property T.Action modelData
115 readonly
property T.Action action: modelData
117 property QtObject item: null
118 property bool isSubMenu:
false
120 Component.onCompleted: {
121 const isKirigamiAction = delegate.action instanceof
Kirigami.Action;
122 if (isKirigamiAction && delegate.action.separator) {
123 item = root.separatorDelegate.createObject(null, { action: delegate.action });
124 }
else if (delegate.action.displayComponent) {
125 item = root.loaderDelegate.createObject(null, {
126 actions: delegate.action,
127 sourceComponent: action.displayComponent,
130 item = root.itemDelegate.createObject(null, { modelData: delegate.action });
132 columnLayout.children.push(item);
140 width: root.availableWidth