9import QtQuick.Controls as QQC2
10import QtQuick.Templates as T
12import org.kde.kirigami as Kirigami
17 required property T.Action tAction
19 readonly property Kirigami.Action kAction: tAction instanceof Kirigami.Action ? tAction : null
21 readonly property bool isSeparator: kAction?.separator ?? false
22 readonly property bool isExpandable: kAction?.expandible ?? false
24 checked: tAction.checked || (actionsMenu && actionsMenu.visible)
26 icon.name: tAction.icon.name
28 text: tAction.text ? tAction.text : tAction.tooltip
29 hoverEnabled: (!isExpandable || root.collapsed) && !Kirigami.Settings.tabletMode && !isSeparator
30 font.pointSize: Kirigami.Theme.defaultFont.pointSize * (isExpandable ? 1.30 : 1)
32 enabled: !isExpandable && tAction.enabled
33 visible: kAction?.visible ?? true
34 opacity: enabled || isExpandable ? 1.0 : 0.6
36 Accessible.onPressAction: listItem.clicked()
41 visible: listItem.isSeparator
42 Layout.fillWidth: true
47 y: Kirigami.Settings.isMobile ? -height : listItem.height
48 actions: kAction?.children ?? []
49 submenuComponent: ActionsMenu {}
53 Layout.fillWidth: true
54 Layout.fillHeight: true
55 sourceComponent: kAction?.displayComponent ?? null
57 for (const child of parent.children) {
59 child.visible = status === Loader.Ready;
62 child.visible =
status !== Loader.Ready;
66 Component.onCompleted: statusChanged()
70 if (kAction && kAction.children.length > 0) {
75 if (!kAction || kAction.children.length === 0) {
76 root.drawerOpen =
false;
Q_SCRIPTABLE CaptureState status()