9import QtQuick.Controls as QQC2
10import org.kde.kirigami as Kirigami
38 readonly property int margins: 6
46 property bool framedView: true
55 property bool extraFooterTopPadding: false
64 property bool headerPaddingEnabled: true
73 property bool footerPaddingEnabled: true
75 property bool sidebarMode: false
77 function __itemVisible(item: Item): bool {
78 return item !== null && item.visible && item.implicitHeight > 0;
81 function __headerContentVisible(): bool {
82 return __itemVisible(headerParent.contentItem);
84 function __footerContentVisible(): bool {
85 return __itemVisible(footerParent.contentItem);
92 function __headerSeparatorVisible(): bool {
93 return !framedView && __headerContentVisible();
95 function __footerSeparatorVisible(): bool {
96 return !framedView && extraFooterTopPadding;
99 title: (typeof kcm !==
"undefined") ? kcm.name :
""
109 topPadding: framedView && !__headerContentVisible() ? margins : 0
110 leftPadding: undefined
111 rightPadding: undefined
112 bottomPadding: framedView && !__footerContentVisible() ? margins : 0
113 verticalPadding: undefined
114 horizontalPadding: framedView ? margins : 0
125 height: root.__headerContentVisible() ? undefined : 0
126 padding: root.headerPaddingEnabled ? root.margins : 0
137 visible: root.__headerSeparatorVisible()
144 visible: !root.framedView
147 color:
Kirigami.Theme.backgroundColor
159 visible: root.__footerSeparatorVisible()
170 height: root.__footerContentVisible() ? undefined : 0
171 padding: root.footerPaddingEnabled ? root.margins : 0
175 function __swapContentIntoContainer(property: string, container:
Item): void {
176 const content = this[property];
177 const rootContainer = container.parent;
179 if (content && content !== rootContainer) {
182 content.anchors.top = undefined;
184 this[property] = rootContainer;
185 container.contentItem = content;
189 function __adoptOverlaySheets(): void {
191 for (const object of contentItem.data) {
192 if (
object instanceof
Kirigami.OverlaySheet) {
193 if (object.parent === null) {
194 object.parent = this;
201 Component.onCompleted: {
202 __swapContentIntoContainer(
"header", headerParent);
203 __swapContentIntoContainer(
"footer", footerParent);
204 __adoptOverlaySheets();
QTextStream & left(QTextStream &stream)
QTextStream & right(QTextStream &stream)