diff --git a/src/qmlcontrols/kcmcontrols/qml/AbstractKCM.qml b/src/qmlcontrols/kcmcontrols/qml/AbstractKCM.qml index 32a96892d82dd5bb1f428f5ff58a3ac102659fce..8f46b56e605fef1ee3688fac5d4f86df6f34433e 100644 --- a/src/qmlcontrols/kcmcontrols/qml/AbstractKCM.qml +++ b/src/qmlcontrols/kcmcontrols/qml/AbstractKCM.qml @@ -37,29 +37,19 @@ Kirigami.Page { title: kcm.name - leftPadding: Kirigami.Settings.isMobile ? 0 : 4 - topPadding: headerParent.contentItem ? 0 : (Kirigami.Settings.isMobile ? 0 : 4) - rightPadding: (Kirigami.Settings.isMobile ? 0 : 4) - bottomPadding: footerParent.contentItem ? 0 : (Kirigami.Settings.isMobile ? 0 : 4) + leftPadding: Kirigami.Settings.isMobile ? 0 : headerParent.leftPadding + topPadding: headerParent.contentItem ? 0 : leftPadding + rightPadding: leftPadding + bottomPadding: footerParent.contentItem ? 0 : leftPadding header: QtControls.Control { id: headerParent - visible: contentItem ? contentItem.visible : false - height: visible ? implicitHeight : 0 - leftPadding: 4 - topPadding: 4 - rightPadding: 4 - bottomPadding: 4 + height: contentItem ? implicitHeight : 0 } footer: QtControls.Control { id: footerParent - visible: contentItem ? contentItem.visible : false - height: visible ? implicitHeight : 0 - leftPadding: 4 - topPadding: 4 - rightPadding: 4 - bottomPadding: 4 + height: contentItem ? implicitHeight : 0 } Component.onCompleted: { diff --git a/src/qmlcontrols/kcmcontrols/qml/GridViewKCM.qml b/src/qmlcontrols/kcmcontrols/qml/GridViewKCM.qml index 21ce85b76ea6758e6d6d183c618f148635cb9972..0aaecb2be0e3dff82eff24adb851198b65c00f3e 100644 --- a/src/qmlcontrols/kcmcontrols/qml/GridViewKCM.qml +++ b/src/qmlcontrols/kcmcontrols/qml/GridViewKCM.qml @@ -24,9 +24,8 @@ import org.kde.kcm 1.1 as KCM * footer: Item {...} * } * @endcode - * @inherits org.kde.kirigami.Page */ -Kirigami.Page { +AbstractKCM { id: root /** @@ -45,7 +44,6 @@ Kirigami.Page { */ property alias view: scroll.view - title: kcm.name implicitWidth: { var width = 0; @@ -64,21 +62,6 @@ Kirigami.Page { flickable: scroll.view - //NOTE: this should be smallspacing buit we need a pixel size in order to align with systemsettings widgets - leftPadding: Kirigami.Settings.isMobile ? 0 : headerParent.leftPadding - topPadding: headerParent.contentItem ? 0 : leftPadding - rightPadding: leftPadding - bottomPadding: footerParent.contentItem ? 0 : leftPadding - - header: QtControls.Control { - id: headerParent - height: contentItem ? implicitHeight : 0 - } - - footer: QtControls.Control { - id: footerParent - height: contentItem ? implicitHeight : 0 - } Component.onCompleted: { if (footer && footer != footerParent) { var f = footer diff --git a/src/qmlcontrols/kcmcontrols/qml/ScrollViewKCM.qml b/src/qmlcontrols/kcmcontrols/qml/ScrollViewKCM.qml index f243975afe2f29f21c2eee3f5a210d35f5750fa3..c01ff5828759ef5c89130571d8e26d8dfe3ab8cd 100644 --- a/src/qmlcontrols/kcmcontrols/qml/ScrollViewKCM.qml +++ b/src/qmlcontrols/kcmcontrols/qml/ScrollViewKCM.qml @@ -25,47 +25,16 @@ import "." as Priv * footer: Item {...} * } * @endcode - * @inherits org.kde.kirigami.Page */ -Kirigami.Page { +AbstractKCM { id: root /** - * view: GridView + * view: ScrollView * Exposes the internal flickable */ property alias view: scroll.view - title: kcm.name - implicitWidth: Kirigami.Units.gridUnit * 20 - implicitHeight: view && view.contentHeight > 0 ? Math.min(view.contentHeight, Kirigami.Units.gridUnit * 20) : Kirigami.Units.gridUnit * 20 - //flickable: scroll.view - - //NOTE: this should be smallspacing buit we need a pixel size in order to align with systemsettings widgets - leftPadding: Kirigami.Settings.isMobile ? 0 : 4 - topPadding: headerParent.contentItem ? 0 : (Kirigami.Settings.isMobile ? 0 : 4) - rightPadding: (Kirigami.Settings.isMobile ? 0 : 4) - bottomPadding: footerParent.contentItem ? 0 : (Kirigami.Settings.isMobile ? 0 : 4) - - header: QtControls.Control { - id: headerParent - visible: root.contentItem && root.contentItem.visible - height: visible ? implicitHeight : 0 - leftPadding: 4 - topPadding: 4 - rightPadding: 4 - bottomPadding: 4 - } - - footer: QtControls.Control { - id: footerParent - visible: root.contentItem && root.contentItem.visible - height: visible ? implicitHeight : 0 - leftPadding: 4 - topPadding: 4 - rightPadding: 4 - bottomPadding: 4 - } Component.onCompleted: { if (footer && footer != footerParent) { var f = footer diff --git a/src/qmlcontrols/kcmcontrols/qml/SimpleKCM.qml b/src/qmlcontrols/kcmcontrols/qml/SimpleKCM.qml index ecd930a65524200a1f8fc7bc39ebddfe555656b7..7e7875fd86fa37b685deb11c4438db5abaa0246c 100644 --- a/src/qmlcontrols/kcmcontrols/qml/SimpleKCM.qml +++ b/src/qmlcontrols/kcmcontrols/qml/SimpleKCM.qml @@ -36,29 +36,19 @@ Kirigami.ScrollablePage { title: kcm.name - leftPadding: Kirigami.Settings.isMobile ? 0 : 4 - topPadding: headerParent.contentItem ? 0 : (Kirigami.Settings.isMobile ? 0 : 4) - rightPadding: (Kirigami.Settings.isMobile ? 0 : 4) - bottomPadding: footerParent.contentItem ? 0 : (Kirigami.Settings.isMobile ? 0 : 4) + leftPadding: Kirigami.Settings.isMobile ? 0 : headerParent.leftPadding + topPadding: headerParent.contentItem ? 0 : leftPadding + rightPadding: leftPadding + bottomPadding: footerParent.contentItem ? 0 : leftPadding header: QtControls.Control { id: headerParent - visible: contentItem ? contentItem.visible : false - height: visible ? implicitHeight : 0 - leftPadding: 4 - topPadding: 4 - rightPadding: 4 - bottomPadding: 4 + height: contentItem ? implicitHeight : 0 } footer: QtControls.Control { id: footerParent - visible: contentItem ? contentItem.visible : false - height: visible ? implicitHeight : 0 - leftPadding: 4 - topPadding: 4 - rightPadding: 4 - bottomPadding: 4 + height: contentItem ? implicitHeight : 0 } Component.onCompleted: {