10import QtQuick.Controls as QQC2
11import QtQuick.Templates as T
12import org.kde.kirigami as Kirigami
42 readonly
property alias actions: layout.actions
49 property bool flat:
true
65 property int display: QQC2.Button.TextBesideIcon
81 property alias alignment: layout.alignment
94 property int position: parent instanceof T.ToolBar ? parent.position : QQC2.ToolBar.Header
106 readonly
property alias maximumContentWidth: layout.implicitWidth
116 property string overflowIconName:
"overflow-menu"
122 readonly
property alias visibleWidth: layout.visibleWidth
141 property alias heightMode: layout.heightMode
144 implicitHeight: layout.implicitHeight
145 implicitWidth: layout.implicitWidth
147 Layout.minimumWidth: layout.minimumWidth
148 Layout.preferredWidth: 0
149 Layout.fillWidth:
true
156 Accessible.role: Accessible.ToolBar
158 contentItem: Kirigami.ToolBarLayout {
160 spacing: Kirigami.Units.smallSpacing
161 layoutDirection: root.mirrored ?
Qt.RightToLeft :
Qt.LeftToRight
163 fullDelegate: P.PrivateActionToolButton {
165 display: root.display
166 action: Kirigami.ToolBarLayout.action
169 iconDelegate: P.PrivateActionToolButton {
171 display: QQC2.Button.IconOnly
172 action: Kirigami.ToolBarLayout.action
177 if (action.displayComponent) {
181 if (action instanceof Kirigami.Action) {
182 return action.children;
189 separatorDelegate: QQC2.ToolSeparator {}
191 moreButton: P.PrivateActionToolButton {
194 action: Kirigami.Action {
195 tooltip: qsTr(
"More Actions")
196 icon.name: root.overflowIconName
197 displayHint: Kirigami.DisplayHint.IconOnly | Kirigami.DisplayHint.HideChildIndicator
200 Accessible.name: action.tooltip
202 menuActions: root.actions
204 menuComponent: P.ActionsMenu {
205 submenuComponent: P.ActionsMenu {
209 value: layout.hiddenActions.includes(parentAction)
210 && (!(parentAction instanceof Kirigami.Action) || parentAction.visible)
211 restoreMode: Binding.RestoreBinding
215 itemDelegate: P.ActionMenuItem {
216 visible: layout.hiddenActions.includes(action)
217 && (!(action instanceof Kirigami.Action) || action.visible)
220 loaderDelegate: Loader {
221 property T.Action action
222 height: visible ? implicitHeight : 0
223 visible: layout.hiddenActions.includes(action)
224 && (!(action instanceof Kirigami.Action) || action.visible)
227 separatorDelegate: QQC2.MenuSeparator {
228 property T.Action action
229 visible: layout.hiddenActions.includes(action)
230 && (!(action instanceof Kirigami.Action) || action.visible)