Commit 06e2cf0d authored by David Edmundson's avatar David Edmundson

Port away from PlasmaCore.Units in system settings modules

Summary:
As Kirigrami has it's own version.

We want to be moving towards not having any Plasma imports in KCM code.
(except for theme previews)

Test Plan:
Opened all 3 KCMs listed
They looked pretty much identical

Reviewers: #plasma, mart

Reviewed By: #plasma, mart

Subscribers: mart, apol, plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D8286
parent eca3f5a2
......@@ -24,11 +24,11 @@ import QtQuick.Controls.Private 1.0
import QtQuick.Controls 1.0 as QtControls
import org.kde.kcm 1.0
import org.kde.plasma.core 2.0 // for units
import org.kde.kirigami 2.0 // for units
Item {
implicitWidth: units.gridUnit * 20
implicitHeight: units.gridUnit * 20
implicitWidth: Units.gridUnit * 20
implicitHeight: Units.gridUnit * 20
ConfigModule.quickHelp: i18n("This module lets you configure the desktop theme.")
......@@ -45,7 +45,7 @@ Item {
GridView {
id: grid
model: kcm.desktopThemeModel
cellWidth: Math.floor(grid.width / Math.max(Math.floor(grid.width / (units.gridUnit * 12)), 3))
cellWidth: Math.floor(grid.width / Math.max(Math.floor(grid.width / (Units.gridUnit * 12)), 3))
cellHeight: cellWidth / 1.6
onCountChanged: {
......@@ -61,7 +61,7 @@ Item {
Rectangle {
anchors {
fill: parent
margins: units.smallSpacing
margins: Units.smallSpacing
}
Connections {
target: kcm
......@@ -80,7 +80,7 @@ Item {
Item {
anchors {
fill: parent
margins: units.smallSpacing * 2
margins: Units.smallSpacing * 2
}
ThemePreview {
id: preview
......@@ -97,8 +97,8 @@ Item {
anchors {
bottom: parent.bottom
horizontalCenter: parent.horizontalCenter
leftMargin: units.smallSpacing * 2
rightMargin: units.smallSpacing * 2
leftMargin: Units.smallSpacing * 2
rightMargin: Units.smallSpacing * 2
}
height: paintedHeight
width: parent.width
......@@ -112,12 +112,12 @@ Item {
Rectangle {
opacity: grid.currentIndex == index ? 1.0 : 0
anchors.fill: parent
border.width: units.smallSpacing * 2
border.width: Units.smallSpacing * 2
border.color: syspal.highlight
color: "transparent"
Behavior on opacity {
PropertyAnimation {
duration: units.longDuration
duration: Units.longDuration
easing.type: Easing.OutQuad
}
}
......
......@@ -21,13 +21,12 @@ import QtQuick.Layouts 1.1
import QtQuick.Controls 1.0 as QtControls
import org.kde.kquickcontrolsaddons 2.0
import QtQuick.Controls.Private 1.0
//We need units from it
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.kirigami 2.0 // for Units
import org.kde.plasma.components 2.0 as PlasmaComponents
Item {
implicitWidth: units.gridUnit * 20
implicitHeight: units.gridUnit * 20
implicitWidth: Units.gridUnit * 20
implicitHeight: Units.gridUnit * 20
SystemPalette {id: syspal}
QtControls.ScrollView {
......@@ -35,7 +34,7 @@ Item {
GridView {
id: grid
model: kcm.splashModel
cellWidth: Math.floor(grid.width / Math.max(Math.floor(grid.width / (units.gridUnit*12)), 3))
cellWidth: Math.floor(grid.width / Math.max(Math.floor(grid.width / (Units.gridUnit*12)), 3))
cellHeight: cellWidth / 1.6
onCountChanged: {
......@@ -49,7 +48,7 @@ Item {
Rectangle {
anchors {
fill: parent
margins: units.smallSpacing
margins: Units.smallSpacing
}
Connections {
......@@ -63,7 +62,7 @@ Item {
QIconItem {
id: icon
anchors.centerIn: parent
width: units.iconSizes.large
width: Units.iconSizes.large
height: width
icon: "view-preview"
}
......@@ -71,7 +70,7 @@ Item {
id: image
anchors {
fill: parent
margins: units.smallSpacing * 2
margins: Units.smallSpacing * 2
}
source: model.screenshot || ""
Rectangle {
......@@ -103,12 +102,12 @@ Item {
Rectangle {
opacity: grid.currentIndex == index ? 1.0 : 0
anchors.fill: parent
border.width: units.smallSpacing * 2
border.width: Units.smallSpacing * 2
border.color: syspal.highlight
color: "transparent"
Behavior on opacity {
PropertyAnimation {
duration: units.longDuration
duration: Units.longDuration
easing.type: Easing.OutQuad
}
}
......@@ -133,7 +132,7 @@ Item {
anchors {
top: parent.top
right: parent.right
margins: units.smallSpacing
margins: Units.smallSpacing
}
visible: model.pluginName != "None"
iconSource: "media-playback-start"
......@@ -143,7 +142,7 @@ Item {
opacity: parent.containsMouse ? 1 : 0
Behavior on opacity {
PropertyAnimation {
duration: units.longDuration
duration: Units.longDuration
easing.type: Easing.OutQuad
}
}
......
......@@ -22,15 +22,14 @@ import QtQuick.Window 2.2
import QtQuick.Controls 1.0 as QtControls
import org.kde.kquickcontrolsaddons 2.0
import QtQuick.Controls.Private 1.0
//We need units from it
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.kirigami 2.0
import org.kde.plasma.components 2.0 as PlasmaComponents
import org.kde.kcm 1.0
Item {
id: root
implicitWidth: units.gridUnit * 20
implicitHeight: units.gridUnit * 20
implicitWidth: Units.gridUnit * 20
implicitHeight: Units.gridUnit * 20
ConfigModule.quickHelp: i18n("This module lets you configure the look of the whole workspace with some ready to go presets.")
......@@ -49,7 +48,7 @@ Item {
GridView {
id: grid
model: kcm.lookAndFeelModel
cellWidth: Math.floor(root.width / Math.max(Math.floor(root.width / (units.gridUnit*12)), 3)) - units.gridUnit
cellWidth: Math.floor(root.width / Math.max(Math.floor(root.width / (Units.gridUnit*12)), 3)) - Units.gridUnit
cellHeight: cellWidth / 1.6
onCountChanged: {
......@@ -63,7 +62,7 @@ Item {
Rectangle {
anchors {
fill: parent
margins: units.smallSpacing
margins: Units.smallSpacing
}
Connections {
target: kcm
......@@ -76,14 +75,14 @@ Item {
QIconItem {
id: icon
anchors.centerIn: parent
width: units.iconSizes.large
width: Units.iconSizes.large
height: width
icon: "view-preview"
}
Image {
anchors {
fill: parent
margins: units.smallSpacing * 2
margins: Units.smallSpacing * 2
}
source: model.screenshot
......@@ -116,12 +115,12 @@ Item {
Rectangle {
opacity: grid.currentIndex == index ? 1.0 : 0
anchors.fill: parent
border.width: units.smallSpacing * 2
border.width: Units.smallSpacing * 2
border.color: syspal.highlight
color: "transparent"
Behavior on opacity {
PropertyAnimation {
duration: units.longDuration
duration: Units.longDuration
easing.type: Easing.OutQuad
}
}
......@@ -147,7 +146,7 @@ Item {
anchors {
top: parent.top
right: parent.right
margins: units.smallSpacing
margins: Units.smallSpacing
}
visible: model.fullScreenPreview != ""
iconSource: "media-playback-start"
......@@ -160,7 +159,7 @@ Item {
opacity: parent.containsMouse ? 1 : 0
Behavior on opacity {
PropertyAnimation {
duration: units.longDuration
duration: Units.longDuration
easing.type: Easing.OutQuad
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment