KDeclarative

SimpleKCM.qml
1 /*
2  SPDX-FileCopyrightText: 2017 Marco Martin <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6 
7 import QtQuick 2.7
8 import QtQuick.Controls 2.2 as QtControls
9 import org.kde.kirigami 2.2 as Kirigami
10 import org.kde.kcm 1.1 as KCM
11 
34 Kirigami.ScrollablePage {
35  id: root
36 
37  title: kcm.name
38 
39  leftPadding: 6 // Layout_ChildMarginWidth from Breeze
40  topPadding: headerParent.contentItem ? 0 : leftPadding
41  rightPadding: leftPadding
42  bottomPadding: footerParent.contentItem ? 0 : leftPadding
43 
44  header: QtControls.Control {
45  id: headerParent
46  height: contentItem ? implicitHeight : 0
47  }
48 
49  footer: QtControls.Control {
50  id: footerParent
51  height: contentItem ? implicitHeight : 0
52  }
53 
54  Component.onCompleted: {
55  if (footer && footer != footerParent) {
56  var f = footer
57 
58  footerParent.contentItem = f
59  footer = footerParent
60  footer.visible = true
61  f.parent = footerParent
62  }
63 
64  if (header && header != headerParent) {
65  var h = header
66 
67  headerParent.contentItem = h
68  header = headerParent
69  header.visible = true
70  h.parent = headerParent
71  }
72  }
73 
74  children: [
75  Kirigami.Separator {
76  z: 999
77  anchors {
78  left: parent.left
79  right: parent.right
80  top: parent.top
81  topMargin: root.header.visible ? root.header.height : 0
82  }
83  visible: !root.flickable.atYBeginning && !Kirigami.Settings.isMobile
84  },
85  Kirigami.Separator {
86  z: 999
87  anchors {
88  left: parent.left
89  right: parent.right
90  bottom: parent.bottom
91  bottomMargin: root.footer.visible ? root.footer.height : 0
92  }
93  visible: !root.flickable.atYEnd && !Kirigami.Settings.isMobile
94  }
95  ]
96 }
QTextStream & left(QTextStream &s)
QTextStream & right(QTextStream &s)
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Tue Jan 19 2021 22:41:07 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.