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 contentItem: Kirigami.ToolBarLayout {
158 spacing: Kirigami.Units.smallSpacing
159 layoutDirection: root.mirrored ?
Qt.RightToLeft :
Qt.LeftToRight
161 fullDelegate: P.PrivateActionToolButton {
163 display: root.display
164 action: Kirigami.ToolBarLayout.action
167 iconDelegate: P.PrivateActionToolButton {
169 display: QQC2.Button.IconOnly
170 action: Kirigami.ToolBarLayout.action
175 if (action.displayComponent) {
179 if (action instanceof Kirigami.Action) {
180 return action.children;
187 separatorDelegate: QQC2.ToolSeparator {}
189 moreButton: P.PrivateActionToolButton {
192 action: Kirigami.Action {
193 tooltip: qsTr(
"More Actions")
194 icon.name: root.overflowIconName
195 displayHint: Kirigami.DisplayHint.IconOnly | Kirigami.DisplayHint.HideChildIndicator
198 Accessible.name: action.tooltip
200 menuActions: root.actions
202 menuComponent: P.ActionsMenu {
203 submenuComponent: P.ActionsMenu {
207 value: layout.hiddenActions.includes(parentAction)
208 && (!(parentAction instanceof Kirigami.Action) || parentAction.visible)
209 restoreMode: Binding.RestoreBinding
213 itemDelegate: P.ActionMenuItem {
214 visible: layout.hiddenActions.includes(action)
215 && (!(action instanceof Kirigami.Action) || action.visible)
218 loaderDelegate: Loader {
219 property T.Action action
220 height: visible ? implicitHeight : 0
221 visible: layout.hiddenActions.includes(action)
222 && (!(action instanceof Kirigami.Action) || action.visible)
225 separatorDelegate: QQC2.MenuSeparator {
226 property T.Action action
227 visible: layout.hiddenActions.includes(action)
228 && (!(action instanceof Kirigami.Action) || action.visible)