8 import QtQuick.Layouts 1.2
9 import QtQuick.Templates 2.0 as T
10 import org.kde.kirigami 2.4 as Kirigami
47 property int headerOrientation:
Qt.Vertical
64 property bool showClickFeedback:
false
67 Layout.fillWidth:
true
69 implicitWidth: Math.max(background.implicitWidth, mainLayout.implicitWidth) + leftPadding + rightPadding
70 implicitHeight: mainLayout.implicitHeight + topPadding + bottomPadding
72 hoverEnabled: !Kirigami.Settings.tabletMode && showClickFeedback
74 Layout.columnSpan: headerOrientation ===
Qt.Horizontal && parent.hasOwnProperty(
"columns") ? parent.columns : 1
76 Kirigami.Theme.inherit:
false
77 Kirigami.Theme.colorSet: Kirigami.Theme.View
79 topPadding: contentItemParent.children.length > 0 ? Kirigami.Units.largeSpacing : 0
80 leftPadding: Kirigami.Units.largeSpacing
81 bottomPadding: contentItemParent.children.length > 0 ? Kirigami.Units.largeSpacing : 0
82 rightPadding: Kirigami.Units.largeSpacing
84 width: ListView.view ? ListView.view.width - ListView.view.leftMargin - ListView.view.rightMargin : undefined
88 rowSpacing: root.topPadding
89 columnSpacing: root.leftPadding
94 leftMargin: root.leftPadding
95 topMargin: root.topPadding
96 rightMargin: root.rightPadding
98 bottomMargin: root.bottomPadding
100 columns: headerOrientation ===
Qt.Vertical ? 1 : 2
101 function preferredHeight(item) {
105 if (item.Layout.preferredHeight > 0) {
106 return item.Layout.preferredHeight;
108 return item.implicitHeight
112 Layout.fillWidth:
true
113 Layout.fillHeight: root.headerOrientation ===
Qt.Horizontal
114 Layout.rowSpan: root.headerOrientation ===
Qt.Vertical ? 1 : 2
115 Layout.preferredWidth: header ? header.implicitWidth : 0
116 Layout.preferredHeight: root.headerOrientation ===
Qt.Vertical ? mainLayout.preferredHeight(header) : -1
117 visible: children.length > 0
120 id: contentItemParent
121 Layout.fillWidth:
true
122 Layout.fillHeight:
true
123 Layout.topMargin: root.topPadding
124 Layout.bottomMargin: root.bottomPadding
125 Layout.preferredWidth: contentItem ? contentItem.implicitWidth : 0
126 Layout.preferredHeight: mainLayout.preferredHeight(contentItem)
127 visible: children.length > 0
131 Layout.fillWidth:
true
132 Layout.preferredWidth: footer ? footer.implicitWidth : 0
133 Layout.preferredHeight: mainLayout.preferredHeight(footer)
134 visible: children.length > 0
139 onContentItemChanged: {
144 contentItem.parent = contentItemParent;
145 contentItem.anchors.fill = contentItemParent;
152 header.parent = headerParent;
153 header.anchors.fill = headerParent;
161 footer.parent = footerParent;
162 footer.anchors.left = footerParent.left;
163 footer.anchors.top = footerParent.top;
164 footer.anchors.right = footerParent.right;
165 footer.anchors.topMargin =
Qt.binding(() =>
166 (root.height - root.bottomPadding - root.topPadding) - (footerParent.y + footerParent.height));
169 contentItemChanged();