21 import QtQuick.Controls 1.4 as Controls
22 import QtQuick.Layouts 1.2
23 import QtGraphicalEffects 1.0
24 import org.kde.kirigami 1.0
74 property alias title: heading.text
81 property alias titleIcon: headingIcon.source
89 property alias bannerImageSource: bannerImage.source
127 property list<QtObject> actions
152 default property alias content: mainContent.data
176 property alias topContent: topContent.data
184 property bool resetMenuOnTriggered:
true
191 readonly
property Action currentSubMenu: stackView.currentItem ? stackView.currentItem.current: null
196 signal bannerClicked()
201 function resetMenu() {
202 stackView.pop(stackView.initialItem);
208 contentItem: Controls.ScrollView {
211 implicitWidth: Math.min (
Units.
gridUnit * 20, root.parent.width * 0.8)
212 horizontalScrollBarPolicy: Qt.ScrollBarAlwaysOff
216 contentHeight: mainColumn.Layout.minimumHeight
219 width: mainFlickable.width
221 height: Math.max(root.height, Layout.minimumHeight)
226 Layout.fillWidth:
true
228 Layout.preferredWidth: title.implicitWidth
229 Layout.preferredHeight: bannerImageSource !=
"" ? Math.max(title.implicitHeight, Math.floor(width / (sourceSize.width/sourceSize.height))) : title.implicitHeight
230 Layout.minimumHeight: Math.max(headingIcon.height, heading.height) +
Units.
smallSpacing * 2
234 onClicked: root.bannerClicked()
237 fillMode: Image.PreserveAspectCrop
248 visible: bannerImageSource !=
""
261 visible: bannerImageSource !=
""
262 height: title.height * 1.3
263 start: Qt.point(0, 0)
264 end: Qt.point(0, height)
268 color: Qt.rgba(0, 0, 0, 0.8)
287 Layout.minimumHeight: width
291 Layout.fillWidth:
true
292 Layout.rightMargin: heading.height
294 color: bannerImageSource !=
"" ?
"white" :
Theme.textColor
295 elide: Text.ElideRight
303 Layout.alignment: Qt.AlignHCenter
304 Layout.leftMargin: root.leftPadding
305 Layout.rightMargin: root.rightPadding
307 Layout.topMargin: root.topPadding
308 Layout.fillWidth:
true
309 Layout.fillHeight:
true
312 Layout.minimumWidth: parent.width - root.leftPadding - root.rightPadding
313 visible: children.length > 0 && childrenRect.height > 0
318 Layout.fillWidth:
true
319 Layout.minimumHeight: currentItem ? currentItem.implicitHeight : 0
320 Layout.maximumHeight: Layout.minimumHeight
321 initialItem: menuComponent
324 Layout.fillWidth:
true
325 Layout.fillHeight:
true
331 Layout.alignment: Qt.AlignHCenter
332 Layout.leftMargin: root.leftPadding
333 Layout.rightMargin: root.rightPadding
334 Layout.fillWidth:
true
335 Layout.fillHeight:
true
338 Layout.minimumWidth: parent.width - root.leftPadding - root.rightPadding
339 visible: children.length > 0
343 Layout.minimumHeight: root.bottomPadding
350 property alias model: actionsRepeater.model
353 property int level: 0
354 Layout.maximumHeight: Layout.minimumHeight
359 supportsMouseEvents:
true
362 separatorVisible: false
363 onClicked: stackView.pop()
371 supportsMouseEvents:
true
373 icon: modelData.iconName
374 label: modelData.text
375 separatorVisible:
false
376 visible: model ? model.visible || model.visible===undefined : modelData.visible
377 enabled: model ? model.enabled : modelData.enabled
378 opacity: enabled ? 1.0 : 0.3
381 verticalCenter: parent.verticalCenter
385 selected: listItem.checked || listItem.pressed
388 visible: modelData.children!==undefined && modelData.children.length > 0
394 if (modelData.children!==undefined && modelData.children.length > 0) {
395 stackView.push(menuComponent, {model: modelData.children, level: level + 1, current: modelData });
396 }
else if (root.resetMenuOnTriggered) {
A heading label used for subsections of texts.
int smallSpacing
units.smallSpacing is the amount of spacing that should be used around smaller UI elements...
An item that represents an abstract Action.
An item delegate for the primitive ListView component.
Overlay Drawers are used to expose additional UI elements needed for small secondary tasks for which ...
bool checked
checked: bool If true makes the list item look as checked or pressed.
int gridUnit
The fundamental unit of space that should be used for sizes, expressed in pixels. ...
QtObject iconSizes
units.iconSizes provides access to platform-dependent icon sizing