9import QtQuick.Controls as QQC2
10import QtQuick.Templates as T
11import org.kde.kirigami as Kirigami
48Kirigami.OverlayDrawer {
51 handleClosedIcon.source: null
52 handleOpenIcon.source: null
59 property string title: qsTr(
"Actions")
68 property list<T.Action> actions
79 property alias header: menu.header
86 property alias footer: menu.footer
89 function visibleActions() {
90 return actions.filter(
91 action => !(action instanceof Kirigami.Action) || action.visible
97 const pageStack = typeof applicationWindow !==
"undefined" ? applicationWindow().pageStack : null;
98 const itemExistsButStyleIsNotToolBar = item => item && item.globalToolBarStyle !== Kirigami.ApplicationHeaderStyle.ToolBar;
101 || !pageStack.globalToolBar
102 || (pageStack.layers.depth > 1
103 && itemExistsButStyleIsNotToolBar(pageStack.layers.currentItem))
104 || itemExistsButStyleIsNotToolBar(pageStack.trailingVisibleItem));
107 edge:
Qt.application.layoutDirection ===
Qt.RightToLeft ?
Qt.LeftEdge :
Qt.RightEdge
116 property bool handleVisible: {
117 if (typeof applicationWindow ===
"function") {
118 const w = applicationWindow();
120 return w.controlsVisible;
127 contentItem: QQC2.ScrollView {
129 Kirigami.Theme.inherit:
true
130 implicitWidth: Kirigami.Units.gridUnit * 20
133 interactive: contentHeight > height
135 model: root.visibleActions()
137 topMargin: root.handle.y > 0 ? menu.height - menu.contentHeight : 0
138 header: QQC2.ToolBar {
139 height: pageStack.globalToolBar.preferredHeight
144 elide: Text.ElideRight
148 verticalCenter: parent.verticalCenter
151 leftMargin: Kirigami.Units.largeSpacing
152 rightMargin: Kirigami.Units.largeSpacing
160 required
property T.Action modelData
164 KP.ContextDrawerActionItem {
165 tAction: delegate.modelData
170 model: delegate.modelData instanceof Kirigami.Action && delegate.modelData.expandible
171 ? delegate.modelData.children : null
173 delegate: KP.ContextDrawerActionItem {
175 leftPadding: Kirigami.Units.gridUnit
176 opacity: !root.collapsed
QTextStream & left(QTextStream &stream)
QTextStream & right(QTextStream &stream)