Port to singleton Units

The context property version is slower to access and won't be supported
in Qt6. Let's port away from it and use the singleton version instead.

Here was my full process for making this change:

1. Made the change with `find . -name '*.qml' | xargs perl -pi -e 's/units\./PlasmaCore\.Units\./g'`
2. Verified no more occurrences with `grep -r " units."`
3. Made sure this didn't change any comments in a silly way by inspecting the output of `git diff | grep "+   " | grep "//"`
4. Manually inspected the full git diff to make sure there were no other unintentional or silly changes (there were none)
5. verified that all changed files have the PlasmaCore import with the correct name with `for FILE in `git status | grep modified | cut -d ":" -f 3`; do grep -q "as PlasmaCore" $FILE || echo "$FILE needs the PlasmaCore import"; done` (one needed the import)
This commit is contained in:
Nate Graham 2021-03-05 12:22:42 -07:00
parent bc9eb362c8
commit 5447cef2d8
82 changed files with 291 additions and 290 deletions

View File

@ -17,7 +17,7 @@ Item {
PlasmaCore.IconItem {
source: "kbugbuster"
width: units.iconSizes.large
width: PlasmaCore.Units.iconSizes.large
height: width
anchors {
right: col.right
@ -29,10 +29,10 @@ Item {
Column {
id: col
spacing: units.largeSpacing /2
spacing: PlasmaCore.Units.largeSpacing /2
anchors {
fill: parent
margins: units.largeSpacing
margins: PlasmaCore.Units.largeSpacing
}
PlasmaExtras.Heading {

View File

@ -19,7 +19,7 @@ Rectangle {
height: 100
radius: 10
smooth: true
Layout.minimumWidth: units.gridUnit * 20
Layout.minimumWidth: PlasmaCore.Units.gridUnit * 20
Layout.minimumHeight: column.implicitHeight
Plasmoid.compactRepresentation: Component {

View File

@ -14,7 +14,7 @@ Item {
id: root
width: 100
height: 100
Layout.minimumWidth: units.gridUnit * 20
Layout.minimumWidth: PlasmaCore.Units.gridUnit * 20
Layout.minimumHeight: column.implicitHeight

View File

@ -30,10 +30,10 @@ PlasmaComponents.Page {
text: "Icons"
}
PlasmaComponents.Label {
text: "iconSizes.small : " + units.iconSizes.small +
", iconSizes.desktop: " + units.iconSizes.desktop +
",<br />iconSizes.toolbar: " + units.iconSizes.toolbar +
", iconSizes.dialog : " + units.iconSizes.dialog
text: "iconSizes.small : " + PlasmaCore.Units.iconSizes.small +
", iconSizes.desktop: " + PlasmaCore.Units.iconSizes.desktop +
",<br />iconSizes.toolbar: " + PlasmaCore.Units.iconSizes.toolbar +
", iconSizes.dialog : " + PlasmaCore.Units.iconSizes.dialog
}
Flow {

View File

@ -49,7 +49,7 @@ PlasmaComponents.Page {
}
PlasmaComponents.Button {
height: units.iconSizes.desktop
height: PlasmaCore.Units.iconSizes.desktop
text: "Busy"
checked: plasmoid.busy
onClicked: {
@ -59,7 +59,7 @@ PlasmaComponents.Page {
PlasmaComponents.Button {
id: ctxButton
height: units.iconSizes.desktop
height: PlasmaCore.Units.iconSizes.desktop
text: "Context Menu"
Loader {
id: menuLoader

View File

@ -18,11 +18,11 @@ Item {
width: 100
height: 100
clip: true
Layout.minimumWidth: units.gridUnit * 20
Layout.minimumHeight: units.gridUnit * 30
Layout.minimumWidth: PlasmaCore.Units.gridUnit * 20
Layout.minimumHeight: PlasmaCore.Units.gridUnit * 30
property int _s: units.iconSizes.small
property int _h: units.iconSizes.desktop
property int _s: PlasmaCore.Units.iconSizes.small
property int _h: PlasmaCore.Units.iconSizes.desktop
PlasmaCore.DataSource {
id: dataSource

View File

@ -61,7 +61,7 @@ ShaderExample {
}
PlasmaComponents.Button {
anchors { right: parent.right; bottom: parent.bottom; }
// height: units.iconSizes.toolbar
// height: PlasmaCore.Units.iconSizes.toolbar
text: "Busy"
checked: plasmoid.busy
onClicked: {

View File

@ -17,10 +17,10 @@ Item {
width: 400
height: 400
Layout.minimumWidth: units.gridUnit * 20
Layout.minimumHeight: units.gridUnit * 30
property int _s: units.iconSizes.small
property int _h: units.iconSizes.desktop
Layout.minimumWidth: PlasmaCore.Units.gridUnit * 20
Layout.minimumHeight: PlasmaCore.Units.gridUnit * 30
property int _s: PlasmaCore.Units.iconSizes.small
property int _h: PlasmaCore.Units.iconSizes.desktop
property int _m: 12
Item {
@ -35,7 +35,7 @@ Item {
right: parent.right
top: parent.top
}
height: units.iconSizes.toolbar * 1.5
height: PlasmaCore.Units.iconSizes.toolbar * 1.5
PlasmaComponents.TabButton { tab: colorShower; text: tab.pageName; }
PlasmaComponents.TabButton { tab: wobbleExample; text: tab.pageName; }

View File

@ -27,7 +27,7 @@ Text {
text: "Lesley 40:83 - (" + font.family + ")"
height: paintedHeightCheck.checked ? paintedHeight : 22
//anchors.fill: parent
//spacing: units.smallSpacing/2
//spacing: PlasmaCore.Units.smallSpacing/2
verticalAlignment: Text.AlignTop
Rectangle {

View File

@ -18,15 +18,15 @@ Column {
width: 400
height: 400
spacing: units.gridUnit
spacing: PlasmaCore.Units.gridUnit
id: themePage
anchors {
margins: units.largeSpacing
margins: PlasmaCore.Units.largeSpacing
}
Row {
spacing: units.gridUnit/2
spacing: PlasmaCore.Units.gridUnit/2
PlasmaComponents.CheckBox {
id: boxesCheck
text: "Show Boxes"
@ -56,24 +56,24 @@ Column {
FontGizmo {
id: giz2
font.pixelSize: units.gridUnit * 1
font.pixelSize: PlasmaCore.Units.gridUnit * 1
}
FontGizmo {
id: giz3
font.pixelSize: units.gridUnit * 2
font.pixelSize: PlasmaCore.Units.gridUnit * 2
}
FontGizmo {
id: giz4
font.pixelSize: units.gridUnit * 2
font.pixelSize: PlasmaCore.Units.gridUnit * 2
text: "AlignTop"
verticalAlignment: Text.AlignTop
}
FontGizmo {
id: giz5
font.pixelSize: units.gridUnit * 2
font.pixelSize: PlasmaCore.Units.gridUnit * 2
text: "AlignVCenter"
verticalAlignment: Text.AlignVCenter
}
@ -86,7 +86,7 @@ Column {
//
Rectangle {
width: parent.width
height: units.gridUnit * 6
height: PlasmaCore.Units.gridUnit * 6
color: "transparent"
border.width: boxesCheck.checked ? 1 : 0
@ -95,7 +95,7 @@ Column {
Rectangle {
id: img
color: "orange"
height: units.gridUnit * 2
height: PlasmaCore.Units.gridUnit * 2
width: height
anchors {
top: parent.top
@ -113,11 +113,11 @@ Column {
text: "That's a Headline"
//height: paintedHeight
height: units.gridUnit
height: PlasmaCore.Units.gridUnit
font.pixelSize: height
anchors {
left: img.right
leftMargin: units.gridUnit / 2
leftMargin: PlasmaCore.Units.gridUnit / 2
top: img.top
}
}

View File

@ -21,7 +21,7 @@ Item {
id: themePage
anchors {
margins: units.largeSpacing
margins: PlasmaCore.Units.largeSpacing
}
FontTest {

View File

@ -15,10 +15,10 @@ Item {
property int cheight: 48
property int cwidth: themePage.width / 1.2
property int _m: units.gridUnit / 2 * units.devicePixelRatio
property int _m: PlasmaCore.Units.gridUnit / 2 * PlasmaCore.Units.devicePixelRatio
anchors {
margins: units.largeSpacing
margins: PlasmaCore.Units.largeSpacing
}
Column {
id: col
@ -42,7 +42,7 @@ Item {
PlasmaComponents.Label {
id: cheatLabel
text: "Cheating with the font size. This label scales with the devicePixelRatio <b>on top of</b> font rendering. Just to show how text scaling can work dynamically. Normal labels scale with the font size. For demonstration purposes we're faking scaled fonts here, to show how layouts' flows change."
font.pointSize: theme.defaultFont.pointSize * units.devicePixelRatio / 1.8
font.pointSize: theme.defaultFont.pointSize * PlasmaCore.Units.devicePixelRatio / 1.8
wrapMode: Text.WordWrap
anchors {
margins: _m
@ -54,7 +54,7 @@ Item {
Image {
id: apeImage
objectName: "apeImage"
height: parent.height / 6 * units.devicePixelRatio
height: parent.height / 6 * PlasmaCore.Units.devicePixelRatio
//width: height
anchors {
top: cheatLabel.top
@ -68,41 +68,41 @@ Item {
anchors {
left: parent.left
top: cheatLabel.height > apeImage.height ? cheatLabel.bottom : apeImage.bottom
topMargin: units.largeSpacing
topMargin: PlasmaCore.Units.largeSpacing
right: parent.right
}
//height: _h
//width: parent.width
spacing: units.smallSpacing
spacing: PlasmaCore.Units.smallSpacing
PlasmaCore.IconItem {
source: "configure"
width: units.iconSizes.small
width: PlasmaCore.Units.iconSizes.small
height: width
}
PlasmaCore.IconItem {
source: "dialog-ok"
width: units.iconSizes.smallMedium
width: PlasmaCore.Units.iconSizes.smallMedium
height: width
}
PlasmaCore.IconItem {
source: "resize-tr2bl"
width: units.iconSizes.medium
width: PlasmaCore.Units.iconSizes.medium
height: width
}
PlasmaCore.IconItem {
source: "akonadi"
width: units.iconSizes.large
width: PlasmaCore.Units.iconSizes.large
height: width
}
PlasmaCore.IconItem {
source: "clock"
width: units.iconSizes.huge
width: PlasmaCore.Units.iconSizes.huge
height: width
}
// KQuickControlsAddons.QIconItem {
// icon: "preferences-desktop-icons"
// width: units.iconSizes.enormous
// width: PlasmaCore.Units.iconSizes.enormous
// height: width
// }

View File

@ -21,12 +21,12 @@ Item {
id: themePage
anchors {
margins: units.largeSpacing
margins: PlasmaCore.Units.largeSpacing
}
Column {
//anchors.fill: parent
//spacing: units.smallSpacing/2
//spacing: PlasmaCore.Units.smallSpacing/2
PlasmaExtras.Heading {
width: parent.width
@ -41,7 +41,7 @@ Item {
width: cwidth/2
onClicked: {
print("DPI Button onClicked");
var d = units.devicePixelRatio * 96;
var d = PlasmaCore.Units.devicePixelRatio * 96;
dpilabel.text = "\t" + d;
}
}
@ -51,48 +51,48 @@ Item {
}
Row {
PlasmaComponents.Label {
text: "units.devicePixelRatio: "
text: "PlasmaCore.Units.devicePixelRatio: "
width: cwidth
}
PlasmaComponents.Label {
width: cheight
height: cheight / 2
text: units.devicePixelRatio
text: PlasmaCore.Units.devicePixelRatio
}
}
Row {
PlasmaComponents.Label {
text: "units.gridUnit: "
text: "PlasmaCore.Units.gridUnit: "
width: cwidth
}
PlasmaComponents.Label {
width: cheight
height: cheight / 2
text: units.gridUnit
text: PlasmaCore.Units.gridUnit
}
}
Row {
PlasmaComponents.Label {
text: "units.largeSpacing: "
text: "PlasmaCore.Units.largeSpacing: "
width: cwidth
}
PlasmaComponents.Label {
width: cheight
height: cheight / 2
text: units.largeSpacing
text: PlasmaCore.Units.largeSpacing
}
}
Row {
PlasmaComponents.Label {
text: "units.smallSpacing: "
text: "PlasmaCore.Units.smallSpacing: "
width: cwidth
}
PlasmaComponents.Label {
width: cheight
height: cheight / 2
text: units.smallSpacing
text: PlasmaCore.Units.smallSpacing
}
}

View File

@ -17,11 +17,11 @@ Item {
width: 300
height: 400
clip: true
Layout.minimumWidth: units.gridUnit * 10
Layout.minimumHeight: units.gridUnit * 10
Layout.minimumWidth: PlasmaCore.Units.gridUnit * 10
Layout.minimumHeight: PlasmaCore.Units.gridUnit * 10
property int _s: units.iconSizes.small
property int _h: units.iconSizes.medium
property int _s: PlasmaCore.Units.iconSizes.small
property int _h: PlasmaCore.Units.iconSizes.medium
PlasmaComponents.TabBar {
id: tabBar
@ -77,7 +77,7 @@ Item {
visible: false
anchors {
bottom: parent.bottom
bottomMargin: units.largeSpacing/2
bottomMargin: PlasmaCore.Units.largeSpacing/2
left: sliderLabel.right
right: parent.right
}
@ -87,14 +87,14 @@ Item {
focus: true
onValueChanged: {
var r = value / 96;
print("Setting units.devicePixelRatio: " + r);
units.devicePixelRatio = r;
print("Setting PlasmaCore.Units.devicePixelRatio: " + r);
PlasmaCore.Units.devicePixelRatio = r;
if (value == 0) {
value = units.devicePixelRatio * 96;
value = PlasmaCore.Units.devicePixelRatio * 96;
}
}
Component.onCompleted: dprSlider.value = units.devicePixelRatio * 96
Component.onCompleted: dprSlider.value = PlasmaCore.Units.devicePixelRatio * 96
}

View File

@ -14,8 +14,8 @@ import org.kde.plasma.extras 2.0 as PlasmaExtras
Item {
// Initial size of the window in gridUnits
width: units.gridUnit * 28
height: units.gridUnit * 20
width: PlasmaCore.Units.gridUnit * 28
height: PlasmaCore.Units.gridUnit * 20
// We use a ColumnLayout to position and size the individual items
ColumnLayout {
@ -23,10 +23,10 @@ Item {
// Our ColumnLayout is fills the parent item with a bit of margin
anchors {
fill: parent
margins: units.largeSpacing
margins: PlasmaCore.Units.largeSpacing
}
spacing: units.gridUnit
spacing: PlasmaCore.Units.gridUnit
// A title on top
PlasmaExtras.Heading {
@ -71,7 +71,7 @@ Item {
PlasmaCore.IconItem {
// We use an anchor layout and dpi-corrected sizing
width: units.iconSizes.large * 4
width: PlasmaCore.Units.iconSizes.large * 4
height: width
anchors {
left: parent.left

View File

@ -16,10 +16,10 @@ Column {
property alias cfg_Speed: slider.value
Row {
spacing: units.largeSpacing / 2
spacing: PlasmaCore.Units.largeSpacing / 2
QtControls.Label {
width: formAlignment - units.largeSpacing
width: formAlignment - PlasmaCore.Units.largeSpacing
horizontalAlignment: Text.AlignRight
text: "Speed:"
}

View File

@ -15,12 +15,12 @@ PlasmaCore.ColorScope {
id: tooltipContentItem
property Item toolTip
property int preferredTextWidth: units.gridUnit * 20
property int preferredTextWidth: PlasmaCore.Units.gridUnit * 20
Layout.minimumWidth: childrenRect.width + units.gridUnit
Layout.minimumHeight: childrenRect.height + units.gridUnit
Layout.maximumWidth: childrenRect.width + units.gridUnit
Layout.maximumHeight: childrenRect.height + units.gridUnit
Layout.minimumWidth: childrenRect.width + PlasmaCore.Units.gridUnit
Layout.minimumHeight: childrenRect.height + PlasmaCore.Units.gridUnit
Layout.maximumWidth: childrenRect.width + PlasmaCore.Units.gridUnit
Layout.maximumHeight: childrenRect.height + PlasmaCore.Units.gridUnit
LayoutMirroring.enabled: Qt.application.layoutDirection === Qt.RightToLeft
LayoutMirroring.childrenInherit: true
@ -32,10 +32,10 @@ PlasmaCore.ColorScope {
anchors {
left: parent.left
top: parent.top
margins: units.gridUnit / 2
margins: PlasmaCore.Units.gridUnit / 2
}
spacing: units.largeSpacing
spacing: PlasmaCore.Units.largeSpacing
Image {
id: tooltipImage
@ -50,8 +50,8 @@ PlasmaCore.ColorScope {
source: toolTip ? toolTip.icon : ""
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
visible: toolTip != null && toolTip.icon != "" && toolTip.image == "" && valid
Layout.preferredWidth: units.iconSizes.medium
Layout.preferredHeight: units.iconSizes.medium
Layout.preferredWidth: PlasmaCore.Units.iconSizes.medium
Layout.preferredHeight: PlasmaCore.Units.iconSizes.medium
}
ColumnLayout {

View File

@ -28,7 +28,7 @@ QtObject {
property int gridUnit: fontMetrics.height
/**
* units.iconSizes provides access to platform-dependent icon sizing
* PlasmaCore.Units.iconSizes provides access to platform-dependent icon sizing
*
* The icon sizes provided are normalized for different DPI, so icons
* will scale depending on the DPI.
@ -55,7 +55,7 @@ QtObject {
}
/**
* units.smallSpacing is the amount of spacing that should be used around smaller UI elements,
* PlasmaCore.Units.smallSpacing is the amount of spacing that should be used around smaller UI elements,
* for example as spacing in Columns. Internally, this size depends on the size of
* the default font as rendered on the screen, so it takes user-configured font size and DPI
* into account.
@ -63,7 +63,7 @@ QtObject {
property int smallSpacing: Math.floor(gridUnit/4)
/**
* units.largeSpacing is the amount of spacing that should be used inside bigger UI elements,
* PlasmaCore.Units.largeSpacing is the amount of spacing that should be used inside bigger UI elements,
* for example between an icon and the corresponding text. Internally, this size depends on
* the size of the default font as rendered on the screen, so it takes user-configured font
* size and DPI into account.
@ -73,34 +73,34 @@ QtObject {
/**
* The ratio between physical and device-independent pixels. This value does not depend on the \
* size of the configured font. If you want to take font sizes into account when scaling elements,
* use theme.mSize(theme.defaultFont), units.smallSpacing and units.largeSpacing.
* use theme.mSize(theme.defaultFont), PlasmaCore.Units.smallSpacing and PlasmaCore.Units.largeSpacing.
* The devicePixelRatio follows the definition of "device independent pixel" by Microsoft.
*/
property real devicePixelRatio: Math.max(1, ((fontMetrics.font.pixelSize*0.75) / fontMetrics.font.pointSize))
/**
* units.longDuration should be used for longer, screen-covering animations, for opening and
* PlasmaCore.Units.longDuration should be used for longer, screen-covering animations, for opening and
* closing of dialogs and other "not too small" animations
*/
property int longDuration: units.longDuration
property int longDuration: PlasmaCore.Units.longDuration
/**
* units.shortDuration should be used for short animations, such as accentuating a UI event,
* PlasmaCore.Units.shortDuration should be used for short animations, such as accentuating a UI event,
* hover events, etc..
*/
property int shortDuration: units.shortDuration
property int shortDuration: PlasmaCore.Units.shortDuration
/**
* units.veryLongDuration should be used for specialty animations that benefit
* PlasmaCore.Units.veryLongDuration should be used for specialty animations that benefit
* from being even longer than longDuration.
*/
property int veryLongDuration: units.veryLongDuration
property int veryLongDuration: PlasmaCore.Units.veryLongDuration
/**
* units.veryShortDuration should be used for elements that should have a hint of smoothness,
* PlasmaCore.Units.veryShortDuration should be used for elements that should have a hint of smoothness,
* but otherwise animate near instantly.
*/
property int veryShortDuration: units.veryShortDuration
property int veryShortDuration: PlasmaCore.Units.veryShortDuration
readonly property QtObject __styleItem: QtQuickControlsPrivate.StyleItem {elementType: "frame" }

View File

@ -20,10 +20,10 @@ QtObject {
* Given the screen has an accurate DPI settings, it corresponds to a width of
* the capital letter M
*/
property int gridUnit: units.gridUnit
property int gridUnit: PlasmaCore.Units.gridUnit
/**
* units.iconSizes provides access to platform-dependent icon sizing
* PlasmaCore.Units.iconSizes provides access to platform-dependent icon sizing
*
* The icon sizes provided are normalized for different DPI, so icons
* will scale depending on the DPI.
@ -50,7 +50,7 @@ QtObject {
}
/**
* units.smallSpacing is the amount of spacing that should be used around smaller UI elements,
* PlasmaCore.Units.smallSpacing is the amount of spacing that should be used around smaller UI elements,
* for example as spacing in Columns. Internally, this size depends on the size of
* the default font as rendered on the screen, so it takes user-configured font size and DPI
* into account.
@ -58,7 +58,7 @@ QtObject {
property int smallSpacing: Math.floor(gridUnit/4)
/**
* units.largeSpacing is the amount of spacing that should be used inside bigger UI elements,
* PlasmaCore.Units.largeSpacing is the amount of spacing that should be used inside bigger UI elements,
* for example between an icon and the corresponding text. Internally, this size depends on
* the size of the default font as rendered on the screen, so it takes user-configured font
* size and DPI into account.
@ -68,34 +68,34 @@ QtObject {
/**
* The ratio between physical and device-independent pixels. This value does not depend on the \
* size of the configured font. If you want to take font sizes into account when scaling elements,
* use theme.mSize(theme.defaultFont), units.smallSpacing and units.largeSpacing.
* use theme.mSize(theme.defaultFont), PlasmaCore.Units.smallSpacing and PlasmaCore.Units.largeSpacing.
* The devicePixelRatio follows the definition of "device independent pixel" by Microsoft.
*/
property real devicePixelRatio: units.devicePixelRatio
property real devicePixelRatio: PlasmaCore.Units.devicePixelRatio
/**
* units.longDuration should be used for longer, screen-covering animations, for opening and
* PlasmaCore.Units.longDuration should be used for longer, screen-covering animations, for opening and
* closing of dialogs and other "not too small" animations
*/
property int longDuration: units.longDuration
property int longDuration: PlasmaCore.Units.longDuration
/**
* units.shortDuration should be used for short animations, such as accentuating a UI event,
* PlasmaCore.Units.shortDuration should be used for short animations, such as accentuating a UI event,
* hover events, etc..
*/
property int shortDuration: units.shortDuration
property int shortDuration: PlasmaCore.Units.shortDuration
/**
* units.veryShortDuration should be used for elements that should have a hint of smoothness,
* PlasmaCore.Units.veryShortDuration should be used for elements that should have a hint of smoothness,
* but otherwise animate near instantly.
*/
property int veryShortDuration: units.veryShortDuration
property int veryShortDuration: PlasmaCore.Units.veryShortDuration
/**
* units.veryLongDuration should be used for specialty animations that benefit
* PlasmaCore.Units.veryLongDuration should be used for specialty animations that benefit
* from being even longer than longDuration.
*/
property int veryLongDuration: units.veryLongDuration
property int veryLongDuration: PlasmaCore.Units.veryLongDuration
/**
* How much the mouse scroll wheel scrolls, expressed in lines of text.

View File

@ -22,7 +22,7 @@ T.CheckBox {
leftPadding: control.indicator && !control.mirrored ? control.indicator.width + control.spacing : 0
rightPadding: control.indicator && control.mirrored ? control.indicator.width + control.spacing : 0
spacing: units.smallSpacing
spacing: PlasmaCore.Units.smallSpacing
hoverEnabled: true
@ -38,14 +38,14 @@ T.CheckBox {
contentItem: RowLayout {
opacity: control.enabled ? 1 : 0.6
spacing: units.smallSpacing
spacing: PlasmaCore.Units.smallSpacing
PlasmaCore.IconItem {
source: control.icon.name || control.icon.source
visible: source.length > 0
implicitWidth: units.iconSizes.smallMedium
implicitHeight: units.iconSizes.smallMedium
implicitWidth: PlasmaCore.Units.iconSizes.smallMedium
implicitHeight: PlasmaCore.Units.iconSizes.smallMedium
}
Label {

View File

@ -21,7 +21,7 @@ T.CheckDelegate {
bottomPadding: background.margins.bottom
leftPadding: background.margins.left
rightPadding: background.margins.right
spacing: units.smallSpacing
spacing: PlasmaCore.Units.smallSpacing
contentItem: Label {
leftPadding: control.mirrored ? (control.indicator ? control.indicator.width : 0) + control.spacing : 0

View File

@ -13,7 +13,7 @@ PlasmaCore.FrameSvgItem {
property Item control
imagePath: "widgets/button"
prefix: "normal"
implicitWidth: units.iconSizes.small
implicitWidth: PlasmaCore.Units.iconSizes.small
implicitHeight: implicitWidth
opacity: control.enabled ? 1 : 0.6
@ -47,7 +47,7 @@ PlasmaCore.FrameSvgItem {
}
Behavior on opacity {
NumberAnimation {
duration: units.longDuration
duration: PlasmaCore.Units.longDuration
easing.type: Easing.InOutQuad
}
}

View File

@ -17,16 +17,16 @@ import "mobiletextselection" as MobileTextSelection
T.ComboBox {
id: control
implicitWidth: Math.max(units.gridUnit, contentItem.implicitWidth)
implicitWidth: Math.max(PlasmaCore.Units.gridUnit, contentItem.implicitWidth)
+ leftPadding + rightPadding + indicator.implicitWidth + rightPadding
implicitHeight: Math.max(units.gridUnit, contentItem.implicitHeight)
implicitHeight: Math.max(PlasmaCore.Units.gridUnit, contentItem.implicitHeight)
+ topPadding + bottomPadding
baselineOffset: contentItem.y + contentItem.baselineOffset
hoverEnabled: true
topPadding: surfaceNormal.margins.top
leftPadding: surfaceNormal.margins.left
rightPadding: surfaceNormal.margins.right + units.gridUnit * 2
rightPadding: surfaceNormal.margins.right + PlasmaCore.Units.gridUnit * 2
bottomPadding: surfaceNormal.margins.bottom
delegate: ItemDelegate {
@ -37,7 +37,7 @@ T.ComboBox {
}
indicator: PlasmaCore.SvgItem {
implicitWidth: units.iconSizes.small
implicitWidth: PlasmaCore.Units.iconSizes.small
implicitHeight: implicitWidth
anchors {
right: parent.right

View File

@ -12,7 +12,7 @@ import "private" as Private
T.Dial {
id: control
implicitWidth: units.gridUnit * 5
implicitWidth: PlasmaCore.Units.gridUnit * 5
implicitHeight: implicitWidth
hoverEnabled: true
onPositionChanged: canvas.requestPaint()
@ -53,7 +53,7 @@ T.Dial {
x: (control.width/2) + Math.cos((-(control.angle-90)*Math.PI)/180) * (control.width/2-width/2) - width/2
y: (control.height/2) + Math.sin(((control.angle-90)*Math.PI)/180) * (control.height/2-height/2) - height/2
implicitHeight: Math.floor(units.gridUnit*1.6)
implicitHeight: Math.floor(PlasmaCore.Units.gridUnit*1.6)
implicitWidth: implicitHeight
Private.RoundShadow {
@ -82,7 +82,7 @@ T.Dial {
height: width
anchors.centerIn: parent
Behavior on opacity {
NumberAnimation { duration: units.longDuration }
NumberAnimation { duration: PlasmaCore.Units.longDuration }
}
}
}

View File

@ -47,7 +47,7 @@ T.Dialog {
contentItem: Item { }
background: PlasmaCore.FrameSvgItem {
implicitWidth: units.gridUnit * 12
implicitWidth: PlasmaCore.Units.gridUnit * 12
imagePath: "widgets/background"
}

View File

@ -14,7 +14,7 @@ T.DialogButtonBox {
implicitWidth: contentItem.implicitWidth + leftPadding + rightPadding
implicitHeight: contentItem.implicitHeight + topPadding + bottomPadding
spacing: units.smallSpacing
spacing: PlasmaCore.Units.smallSpacing
leftPadding: parent.leftPadding
topPadding: parent.topPadding
rightPadding: parent.rightPadding
@ -27,7 +27,7 @@ T.DialogButtonBox {
contentItem: ListView {
implicitWidth: contentWidth
implicitHeight: units.gridUnit * 1.6
implicitHeight: PlasmaCore.Units.gridUnit * 1.6
model: control.contentModel
spacing: control.spacing

View File

@ -19,10 +19,10 @@ T.Drawer {
contentWidth: contentItem.implicitWidth || (contentChildren.length === 1 ? contentChildren[0].implicitWidth : 0)
contentHeight: contentItem.implicitHeight || (contentChildren.length === 1 ? contentChildren[0].implicitHeight : 0)
topPadding: control.edge === Qt.BottomEdge ? Math.round(units.devicePixelRatio) : 0
leftPadding: control.edge === Qt.RightEdge ? Math.round(units.devicePixelRatio) : 0
rightPadding: control.edge === Qt.LeftEdge ? Math.round(units.devicePixelRatio) : 0
bottomPadding: control.edge === Qt.TopEdge ? Math.round(units.devicePixelRatio) : 0
topPadding: control.edge === Qt.BottomEdge ? Math.round(PlasmaCore.Units.devicePixelRatio) : 0
leftPadding: control.edge === Qt.RightEdge ? Math.round(PlasmaCore.Units.devicePixelRatio) : 0
rightPadding: control.edge === Qt.LeftEdge ? Math.round(PlasmaCore.Units.devicePixelRatio) : 0
bottomPadding: control.edge === Qt.TopEdge ? Math.round(PlasmaCore.Units.devicePixelRatio) : 0
background: PlasmaCore.FrameSvgItem {
anchors {
@ -32,7 +32,7 @@ T.Drawer {
rightMargin: -margins.right
bottomMargin: -margins.bottom
}
implicitWidth: units.gridUnit * 12
implicitWidth: PlasmaCore.Units.gridUnit * 12
imagePath: "widgets/background"
enabledBorders: {
switch (control.edge) {

View File

@ -18,7 +18,7 @@ T.Frame {
contentWidth: contentItem.implicitWidth || (contentChildren.length === 1 ? contentChildren[0].implicitWidth : 0)
contentHeight: contentItem.implicitHeight || (contentChildren.length === 1 ? contentChildren[0].implicitHeight : 0)
padding: units.smallSpacing
padding: PlasmaCore.Units.smallSpacing
background: PlasmaCore.FrameSvgItem {
imagePath: "widgets/frame"

View File

@ -21,7 +21,7 @@ T.CheckDelegate {
bottomPadding: background.margins.bottom
leftPadding: background.margins.left
rightPadding: background.margins.right
spacing: units.smallSpacing
spacing: PlasmaCore.Units.smallSpacing
contentItem: Label {
leftPadding: control.mirrored ? (control.indicator ? control.indicator.width : 0) + control.spacing : 0

View File

@ -88,7 +88,7 @@ T.Menu {
background: PlasmaCore.FrameSvgItem {
imagePath: "widgets/background"
implicitWidth: units.gridUnit * 8
implicitHeight: units.gridUnit * 2
implicitWidth: PlasmaCore.Units.gridUnit * 8
implicitHeight: PlasmaCore.Units.gridUnit * 2
}
}

View File

@ -25,7 +25,7 @@ T.MenuItem {
topPadding: highlight.margins.top
rightPadding: highlight.margins.right
bottomPadding: highlight.margins.bottom
spacing: units.smallSpacing
spacing: PlasmaCore.Units.smallSpacing
hoverEnabled: true
Kirigami.MnemonicData.enabled: controlRoot.enabled && controlRoot.visible
@ -101,7 +101,7 @@ T.MenuItem {
}
background: Item {
implicitWidth: units.gridUnit * 8
implicitWidth: PlasmaCore.Units.gridUnit * 8
PlasmaCore.FrameSvgItem {
id: highlight
@ -118,7 +118,7 @@ T.MenuItem {
}
Behavior on opacity {
NumberAnimation {
duration: units.shortDuration
duration: PlasmaCore.Units.shortDuration
}
}
}

View File

@ -15,11 +15,11 @@ T.PageIndicator {
implicitWidth: contentItem.implicitWidth + leftPadding + rightPadding
implicitHeight: contentItem.implicitHeight + topPadding + bottomPadding
padding: units.smallSpacing
spacing: units.smallSpacing
padding: PlasmaCore.Units.smallSpacing
spacing: PlasmaCore.Units.smallSpacing
delegate: Rectangle {
implicitWidth: units.gridUnit/2
implicitWidth: PlasmaCore.Units.gridUnit/2
implicitHeight: implicitWidth
radius: width
@ -28,7 +28,7 @@ T.PageIndicator {
opacity: index === currentIndex ? 0.9 : pressed ? 0.7 : 0.5
Behavior on opacity {
OpacityAnimator {
duration: units.longDuration
duration: PlasmaCore.Units.longDuration
easing.type: Easing.InOutQuad
}
}

View File

@ -11,7 +11,7 @@ import org.kde.plasma.core 2.0 as PlasmaCore
T.ProgressBar {
id: control
implicitWidth: units.gridUnit * 8
implicitWidth: PlasmaCore.Units.gridUnit * 8
implicitHeight: background.implicitHeight
hoverEnabled: true
@ -36,7 +36,7 @@ T.ProgressBar {
running: control.indeterminate && control.visible
onStarted: indicator.width = Qt.binding(function() {
return units.gridUnit * 2;
return PlasmaCore.Units.gridUnit * 2;
});
onStopped: indicator.width = Qt.binding(function() {
return indicator.parent.width * control.position;

View File

@ -20,7 +20,7 @@ T.RadioButton {
baselineOffset: contentItem.y + contentItem.baselineOffset
padding: 1
spacing: Math.round(units.gridUnit / 8)
spacing: Math.round(PlasmaCore.Units.gridUnit / 8)
hoverEnabled: true

View File

@ -21,7 +21,7 @@ T.RadioDelegate {
bottomPadding: background.margins.bottom
leftPadding: background.margins.left
rightPadding: background.margins.right
spacing: units.smallSpacing
spacing: PlasmaCore.Units.smallSpacing
contentItem: Label {
leftPadding: control.mirrored ? (control.indicator ? control.indicator.width : 0) + control.spacing : 0

View File

@ -18,7 +18,7 @@ PlasmaCore.SvgItem {
opacity: control.enabled ? 1 : 0.6
implicitWidth: implicitHeight
implicitHeight: units.iconSizes.small
implicitHeight: PlasmaCore.Units.iconSizes.small
PlasmaCore.SvgItem {
id: checkmark
@ -33,7 +33,7 @@ PlasmaCore.SvgItem {
}
Behavior on opacity {
NumberAnimation {
duration: units.longDuration
duration: PlasmaCore.Units.longDuration
easing.type: Easing.InOutQuad
}
}

View File

@ -12,8 +12,8 @@ import "private" as Private
T.RangeSlider {
id: control
implicitWidth: control.orientation === Qt.Horizontal ? units.gridUnit * 12 : units.gridUnit * 1.6
implicitHeight: control.orientation === Qt.Horizontal ? units.gridUnit * 1.6 : units.gridUnit * 12
implicitWidth: control.orientation === Qt.Horizontal ? PlasmaCore.Units.gridUnit * 12 : PlasmaCore.Units.gridUnit * 1.6
implicitHeight: control.orientation === Qt.Horizontal ? PlasmaCore.Units.gridUnit * 1.6 : PlasmaCore.Units.gridUnit * 12
PlasmaCore.Svg {
id: grooveSvg
@ -78,8 +78,8 @@ T.RangeSlider {
prefix: "groove"
colorGroup: PlasmaCore.ColorScope.colorGroup
readonly property bool horizontal: control.orientation === Qt.Horizontal
implicitWidth: horizontal ? units.gridUnit * 8 : margins.left + margins.right
implicitHeight: horizontal ? margins.top + margins.bottom : units.gridUnit * 8
implicitWidth: horizontal ? PlasmaCore.Units.gridUnit * 8 : margins.left + margins.right
implicitHeight: horizontal ? margins.top + margins.bottom : PlasmaCore.Units.gridUnit * 8
width: horizontal ? control.availableWidth : implicitWidth
height: horizontal ? implicitHeight : control.availableHeight
anchors.centerIn: parent

View File

@ -14,9 +14,9 @@ import "private" as Private
T.RoundButton {
id: control
implicitWidth: Math.max(units.gridUnit, contentItem.implicitWidth)
implicitWidth: Math.max(PlasmaCore.Units.gridUnit, contentItem.implicitWidth)
+ leftPadding + rightPadding
implicitHeight: Math.max(units.gridUnit, contentItem.implicitHeight)
implicitHeight: Math.max(PlasmaCore.Units.gridUnit, contentItem.implicitHeight)
+ topPadding + bottomPadding
leftPadding: text.length > 0 ? surfaceNormal.margins.left : contentItem.extraSpace
@ -28,10 +28,10 @@ T.RoundButton {
contentItem: RowLayout {
// This is the spacing which will make the icon a square inscribed in the circle with an extra smallspacing of margins
readonly property int extraSpace: implicitWidth/2 - implicitWidth/2*Math.sqrt(2)/2 + units.smallSpacing
readonly property int extraSpace: implicitWidth/2 - implicitWidth/2*Math.sqrt(2)/2 + PlasmaCore.Units.smallSpacing
PlasmaCore.IconItem {
Layout.preferredWidth: units.iconSizes.smallMedium
Layout.preferredHeight: units.iconSizes.smallMedium
Layout.preferredWidth: PlasmaCore.Units.iconSizes.smallMedium
Layout.preferredHeight: PlasmaCore.Units.iconSizes.smallMedium
Layout.fillWidth: true
Layout.fillHeight: true
visible: source.length > 0
@ -85,7 +85,7 @@ T.RoundButton {
//internal: if there is no hover status, don't paint on mouse over in touchscreens
opacity: (control.pressed || control.checked || !control.flat || (roundShadow.hasOverState && control.hovered)) ? 1 : 0
Behavior on opacity {
PropertyAnimation { duration: units.longDuration }
PropertyAnimation { duration: PlasmaCore.Units.longDuration }
}
}
@ -107,7 +107,7 @@ T.RoundButton {
opacity: background.useNormalButton && (!control.flat || control.hovered) && (!control.pressed || !control.checked) ? 1 : 0
Behavior on opacity {
OpacityAnimator {
duration: units.longDuration
duration: PlasmaCore.Units.longDuration
easing.type: Easing.InOutQuad
}
}
@ -131,7 +131,7 @@ T.RoundButton {
opacity: control.checked || control.pressed ? 1 : 0
Behavior on opacity {
OpacityAnimator {
duration: units.longDuration
duration: PlasmaCore.Units.longDuration
easing.type: Easing.InOutQuad
}
}

View File

@ -33,7 +33,7 @@ T.ScrollBar {
}
// the separator line doesn't work yet with the plasmoids design
visible: typeof plasmoid === "undefined"
width: units.devicePixelRatio
width: PlasmaCore.Units.devicePixelRatio
color: PlasmaCore.ColorScope.textColor
opacity: 0.1
}
@ -46,7 +46,7 @@ T.ScrollBar {
opacity: controlRoot.hovered
Behavior on opacity {
OpacityAnimator {
duration: units.longDuration
duration: PlasmaCore.Units.longDuration
}
}
}

View File

@ -12,8 +12,8 @@ import "private" as Private
T.Slider {
id: control
implicitWidth: control.orientation === Qt.Horizontal ? units.gridUnit * 12 : units.gridUnit * 1.6
implicitHeight: control.orientation === Qt.Horizontal ? units.gridUnit * 1.6 : units.gridUnit * 12
implicitWidth: control.orientation === Qt.Horizontal ? PlasmaCore.Units.gridUnit * 12 : PlasmaCore.Units.gridUnit * 1.6
implicitHeight: control.orientation === Qt.Horizontal ? PlasmaCore.Units.gridUnit * 1.6 : PlasmaCore.Units.gridUnit * 12
wheelEnabled: true
snapMode: T.Slider.SnapOnRelease
@ -55,8 +55,8 @@ T.Slider {
prefix: "groove"
colorGroup: PlasmaCore.ColorScope.colorGroup
readonly property bool horizontal: control.orientation === Qt.Horizontal
implicitWidth: horizontal ? units.gridUnit * 8 : margins.left + margins.right
implicitHeight: horizontal ? margins.top + margins.bottom : units.gridUnit * 8
implicitWidth: horizontal ? PlasmaCore.Units.gridUnit * 8 : margins.left + margins.right
implicitHeight: horizontal ? margins.top + margins.bottom : PlasmaCore.Units.gridUnit * 8
width: horizontal ? control.availableWidth : implicitWidth
height: horizontal ? implicitHeight : control.availableHeight
anchors.centerIn: parent
@ -90,9 +90,9 @@ T.Slider {
Rectangle {
color: PlasmaCore.ColorScope.textColor
opacity: 0.3
width: background.horizontal ? units.devicePixelRatio : units.gridUnit/2
height: background.horizontal ? units.gridUnit/2 : units.devicePixelRatio
y: background.horizontal ? background.height + units.devicePixelRatio : handle.height / 2 + index * ((repeater.height - handle.height) / (repeater.count > 1 ? repeater.count - 1 : 1))
width: background.horizontal ? PlasmaCore.Units.devicePixelRatio : PlasmaCore.Units.gridUnit/2
height: background.horizontal ? PlasmaCore.Units.gridUnit/2 : PlasmaCore.Units.devicePixelRatio
y: background.horizontal ? background.height + PlasmaCore.Units.devicePixelRatio : handle.height / 2 + index * ((repeater.height - handle.height) / (repeater.count > 1 ? repeater.count - 1 : 1))
x: background.horizontal ? handle.width / 2 + index * ((repeater.width - handle.width) / (repeater.count > 1 ? repeater.count - 1 : 1)) : background.width
}
}

View File

@ -14,8 +14,8 @@ import "private" as Private
T.SpinBox {
id: control
implicitWidth: Math.max(units.gridUnit * 6, contentItem.implicitWidth + 2 * padding + up.indicator.implicitWidth + down.indicator.implicitWidth)
implicitHeight: units.gridUnit * 1.6
implicitWidth: Math.max(PlasmaCore.Units.gridUnit * 6, contentItem.implicitWidth + 2 * padding + up.indicator.implicitWidth + down.indicator.implicitWidth)
implicitHeight: PlasmaCore.Units.gridUnit * 1.6
padding: 6
leftPadding: padding + height
@ -74,7 +74,7 @@ T.SpinBox {
// How many pixels you have to drag to change the value by one unit
// of 'control.stepSize'; bigger magnitudes will require more movement
// to achieve the same change in spinbox value
property int magnitude: units.gridUnit
property int magnitude: PlasmaCore.Units.gridUnit
target: null // Don't actually move anything, we just want drag data
xAxis.enabled: true

View File

@ -14,11 +14,11 @@ T.Switch {
implicitWidth: Math.max(background ? background.implicitWidth : 0,
contentItem.implicitWidth + leftPadding + rightPadding)
implicitHeight: units.gridUnit * 1.6
implicitHeight: PlasmaCore.Units.gridUnit * 1.6
baselineOffset: contentItem.y + contentItem.baselineOffset
padding: 1
spacing: Math.round(units.gridUnit / 8)
spacing: Math.round(PlasmaCore.Units.gridUnit / 8)
hoverEnabled: true

View File

@ -21,7 +21,7 @@ T.SwitchDelegate {
bottomPadding: background.margins.bottom
leftPadding: background.margins.left
rightPadding: background.margins.right
spacing: units.smallSpacing
spacing: PlasmaCore.Units.smallSpacing
contentItem: Label {
leftPadding: control.mirrored ? (control.indicator ? control.indicator.width : 0) + control.spacing : 0

View File

@ -10,8 +10,8 @@ import "private" as Private
Item {
property Item control
implicitWidth: Math.round(units.gridUnit * 1.5)
implicitHeight : units.gridUnit
implicitWidth: Math.round(PlasmaCore.Units.gridUnit * 1.5)
implicitHeight : PlasmaCore.Units.gridUnit
opacity: control.enabled ? 1 : 0.6
@ -35,7 +35,7 @@ Item {
opacity: control.checked ? 1 : 0
Behavior on opacity {
OpacityAnimator {
duration: units.longDuration
duration: PlasmaCore.Units.longDuration
easing.type: Easing.InOutQuad
}
}
@ -50,7 +50,7 @@ Item {
elementId: "normal"
implicitWidth: implicitHeight
implicitHeight: units.gridUnit
implicitHeight: PlasmaCore.Units.gridUnit
Private.RoundShadow {
anchors.fill: parent
@ -59,7 +59,7 @@ Item {
}
Behavior on x {
XAnimator {
duration: units.longDuration
duration: PlasmaCore.Units.longDuration
easing.type: Easing.InOutQuad
}
}

View File

@ -29,7 +29,7 @@ T.TabBar {
flickableDirection: Flickable.AutoFlickIfNeeded
snapMode: ListView.SnapToItem
highlightMoveDuration: units.longDuration
highlightMoveDuration: PlasmaCore.Units.longDuration
highlightRangeMode: ListView.ApplyRange
preferredHighlightBegin: 40
preferredHighlightEnd: width - 40

View File

@ -19,7 +19,7 @@ T.TabButton {
implicitHeight: contentItem.implicitHeight + topPadding + bottomPadding
baselineOffset: contentItem.y + contentItem.baselineOffset
padding: units.smallSpacing
padding: PlasmaCore.Units.smallSpacing
hoverEnabled: true
@ -50,8 +50,8 @@ T.TabButton {
Layout.maximumWidth: control.icon.width > 0 ? control.icon.width : Number.POSITIVE_INFINITY
Layout.maximumHeight: control.icon.height > 0 ? control.icon.height : Number.POSITIVE_INFINITY
implicitWidth: control.icon.width > 0 ? control.icon.width : units.iconSizes.smallMedium
implicitHeight: control.icon.height > 0 ? control.icon.height : units.iconSizes.smallMedium
implicitWidth: control.icon.width > 0 ? control.icon.width : PlasmaCore.Units.iconSizes.smallMedium
implicitHeight: control.icon.height > 0 ? control.icon.height : PlasmaCore.Units.iconSizes.smallMedium
colorGroup: control.PlasmaCore.ColorScope.colorGroup
visible: source.length > 0 && control.display !== T.AbstractButton.TextOnly

View File

@ -36,10 +36,10 @@ T.TextField {
&& (echoMode == TextInput.Normal || control.text.length > 0)
implicitWidth: Math.max((placeholderText ? placeholder.implicitWidth : 0),
units.gridUnit * 8,
PlasmaCore.Units.gridUnit * 8,
contentWidth)
+ base.margins.left + base.margins.right
implicitHeight: Math.max(units.gridUnit, contentHeight)
implicitHeight: Math.max(PlasmaCore.Units.gridUnit, contentHeight)
+ topPadding + bottomPadding
leftPadding: base.margins.left + (LayoutMirroring.enabled ? inlineButtonRow.width : 0)
@ -120,13 +120,13 @@ T.TextField {
PlasmaCore.IconItem {
id: showPasswordButton
source: __effectiveRevealPasswordButtonShown ? (control.echoMode === TextInput.Normal ? "visibility": "hint") : ""
height: Math.max(control.height * 0.8, units.iconSizes.small)
height: Math.max(control.height * 0.8, PlasmaCore.Units.iconSizes.small)
width: height
opacity: (__effectiveRevealPasswordButtonShown && control.enabled) ? 1 : 0
visible: opacity > 0
Behavior on opacity {
NumberAnimation {
duration: units.longDuration
duration: PlasmaCore.Units.longDuration
easing.type: Easing.InOutQuad
}
}
@ -144,13 +144,13 @@ T.TextField {
id: clearButton
//ltr confusingly refers to the direction of the arrow in the icon, not the text direction which it should be used in
source: clearButtonShown ? (LayoutMirroring.enabled ? "edit-clear-locationbar-ltr" : "edit-clear-locationbar-rtl") : ""
height: Math.max(control.height * 0.8, units.iconSizes.small)
height: Math.max(control.height * 0.8, PlasmaCore.Units.iconSizes.small)
width: height
opacity: (control.length > 0 && clearButtonShown && control.enabled) ? 1 : 0
visible: opacity > 0
Behavior on opacity {
NumberAnimation {
duration: units.longDuration
duration: PlasmaCore.Units.longDuration
easing.type: Easing.InOutQuad
}
}

View File

@ -11,7 +11,7 @@ import org.kde.kirigami 2.5 as Kirigami
Item {
id: root
width: 1 //<-important that this is actually a single device pixel
height: units.gridUnit
height: PlasmaCore.Units.gridUnit
property Item target
@ -20,7 +20,7 @@ Item {
visible: Kirigami.Settings.tabletMode && ((target.activeFocus && !selectionStartHandle) || target.selectedText.length > 0)
Rectangle {
width: Math.round(units.devicePixelRatio * 3)
width: Math.round(PlasmaCore.Units.devicePixelRatio * 3)
anchors {
horizontalCenter: parent.horizontalCenter
top: parent.top
@ -29,7 +29,7 @@ Item {
color: Qt.tint(theme.highlightColor, Qt.rgba(1,1,1,0.4))
radius: width
Rectangle {
width: Math.round(units.gridUnit/1.5)
width: Math.round(PlasmaCore.Units.gridUnit/1.5)
height: width
visible: MobileTextActionsToolBar.shouldBeVisible
anchors {
@ -42,7 +42,7 @@ Item {
MouseArea {
anchors {
fill: parent
margins: -units.gridUnit
margins: -PlasmaCore.Units.gridUnit
}
preventStealing: true
onPositionChanged: {

View File

@ -10,6 +10,7 @@ import QtQuick 2.1
import QtQuick.Layouts 1.2
import QtQuick.Window 2.2
import QtQuick.Controls @QQC2_VERSION@
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.kirigami 2.5 as Kirigami
Popup {
@ -33,7 +34,7 @@ Popup {
if (desiredY >= 0) {
return Math.min(desiredY, parent.height - root.height);
} else {
return Math.min(Math.max(0, controlRoot.mapToItem(root.parent, 0, controlRoot.positionToRectangle(controlRoot.selectionEnd).y + Math.round(units.gridUnit*1.5)).y), parent.height - root.height);
return Math.min(Math.max(0, controlRoot.mapToItem(root.parent, 0, controlRoot.positionToRectangle(controlRoot.selectionEnd).y + Math.round(PlasmaCore.Units.gridUnit*1.5)).y), parent.height - root.height);
}
}

View File

@ -52,7 +52,7 @@ Item {
to: "hidden"
SequentialAnimation {
OpacityAnimator {
duration: units.shortDuration
duration: PlasmaCore.Units.shortDuration
easing.type: Easing.OutQuad
}
PropertyAction {
@ -72,7 +72,7 @@ Item {
value: true
}
OpacityAnimator {
duration: units.shortDuration
duration: PlasmaCore.Units.shortDuration
easing.type: Easing.OutQuad
}
}

View File

@ -140,7 +140,7 @@ Item {
}
NumberAnimation {
property: "opacity"
duration: units.shortDuration
duration: PlasmaCore.Units.shortDuration
easing.type: Easing.OutQuad
}
PropertyAction {
@ -162,7 +162,7 @@ Item {
NumberAnimation {
property: "opacity"
// Using a shorter duration here makes things feel more responsive.
duration: units.shortDuration/2
duration: PlasmaCore.Units.shortDuration/2
easing.type: Easing.OutQuad
}
PropertyAction {
@ -184,7 +184,7 @@ Item {
NumberAnimation {
property: "opacity"
// Using a shorter duration here makes things feel more responsive.
duration: units.shortDuration/2
duration: PlasmaCore.Units.shortDuration/2
easing.type: Easing.OutQuad
}
PropertyAction {

View File

@ -159,7 +159,7 @@ Item {
}
NumberAnimation {
property: "opacity"
duration: units.shortDuration
duration: PlasmaCore.Units.shortDuration
easing.type: Easing.OutQuad
}
PropertyAction {
@ -181,7 +181,7 @@ Item {
NumberAnimation {
property: "opacity"
// Using a shorter duration here makes things feel more responsive.
duration: units.shortDuration/2
duration: PlasmaCore.Units.shortDuration/2
easing.type: Easing.OutQuad
}
PropertyAction {
@ -202,7 +202,7 @@ Item {
}
NumberAnimation {
property: "opacity"
duration: units.shortDuration
duration: PlasmaCore.Units.shortDuration
easing.type: Easing.OutQuad
}
PropertyAction {

View File

@ -113,7 +113,7 @@ Item {
Transition {
PropertyAnimation {
properties: "opacity"
duration: units.longDuration
duration: PlasmaCore.Units.longDuration
easing.type: Easing.OutQuad
}
}

View File

@ -77,7 +77,7 @@ Item {
Transition {
PropertyAnimation {
properties: "opacity"
duration: units.longDuration
duration: PlasmaCore.Units.longDuration
easing.type: Easing.OutQuad
}
}

View File

@ -25,7 +25,7 @@ QtQuickControlStyle.ButtonStyle {
property int minimumHeight
label: RowLayout {
spacing: units.smallSpacing
spacing: PlasmaCore.Units.smallSpacing
property real minimumWidth: implicitWidth + style.padding.left + style.padding.right
onMinimumWidthChanged: {
@ -46,8 +46,8 @@ QtQuickControlStyle.ButtonStyle {
PlasmaCore.IconItem {
id: icon
source: control.iconName || control.iconSource
Layout.minimumWidth: valid ? units.iconSizes.tiny : 0
Layout.preferredWidth: valid ? units.iconSizes.small : 0
Layout.minimumWidth: valid ? PlasmaCore.Units.iconSizes.tiny : 0
Layout.preferredWidth: valid ? PlasmaCore.Units.iconSizes.small : 0
visible: valid
Layout.minimumHeight: Layout.minimumWidth
Layout.preferredHeight: Layout.preferredWidth
@ -80,7 +80,7 @@ QtQuickControlStyle.ButtonStyle {
id: arrow
when: control.menu !== null
visible: when
Layout.minimumWidth: units.iconSizes.small
Layout.minimumWidth: PlasmaCore.Units.iconSizes.small
Layout.maximumWidth: Layout.minimumWidth
Layout.alignment: Qt.AlignVCenter
height: width

View File

@ -21,12 +21,12 @@ QtQuickControlStyle.CalendarStyle {
background: Item {
implicitWidth: Math.max(250, Math.round(units.gridUnit * 14))
implicitHeight: Math.max(250, Math.round(units.gridUnit * 14))
implicitWidth: Math.max(250, Math.round(PlasmaCore.Units.gridUnit * 14))
implicitHeight: Math.max(250, Math.round(PlasmaCore.Units.gridUnit * 14))
}
navigationBar: Item {
height: Math.round(units.gridUnit * 2.73)
height: Math.round(PlasmaCore.Units.gridUnit * 2.73)
PlasmaComponents.ToolButton {
id: previousMonth
@ -42,7 +42,7 @@ QtQuickControlStyle.CalendarStyle {
text: styleData.title
elide: Text.ElideRight
horizontalAlignment: Text.AlignHCenter
font.pixelSize: units.gridUnit * 1.25
font.pixelSize: PlasmaCore.Units.gridUnit * 1.25
anchors.verticalCenter: parent.verticalCenter
anchors.left: previousMonth.right
anchors.leftMargin: 2
@ -97,7 +97,7 @@ QtQuickControlStyle.CalendarStyle {
}
dayOfWeekDelegate: Item {
implicitHeight: Math.round(units.gridUnit * 2.25)
implicitHeight: Math.round(PlasmaCore.Units.gridUnit * 2.25)
PlasmaComponents.Label {
text: control.__locale.dayName(styleData.dayOfWeek, control.dayOfWeekFormat)
anchors.centerIn: parent
@ -105,7 +105,7 @@ QtQuickControlStyle.CalendarStyle {
}
weekNumberDelegate: Item {
implicitWidth: Math.round(units.gridUnit * 2)
implicitWidth: Math.round(PlasmaCore.Units.gridUnit * 2)
PlasmaComponents.Label {
text: styleData.weekNumber
anchors.centerIn: parent

View File

@ -20,19 +20,19 @@ QtQuickControlStyle.CheckBoxStyle {
anchors.left: parent.left
anchors.right: parent.right
anchors.top: parent.bottom
height: 1 * units.devicePixelRatio
height: 1 * PlasmaCore.Units.devicePixelRatio
color: theme.highlightColor
visible: control.activeFocus
}
}
background: Item {}
spacing: units.smallSpacing
spacing: PlasmaCore.Units.smallSpacing
indicator: PlasmaCore.FrameSvgItem {
imagePath: "widgets/button"
prefix: "normal"
width: units.iconSizes.small
width: PlasmaCore.Units.iconSizes.small
height: width
opacity: control.enabled ? 1 : 0.6
@ -57,7 +57,7 @@ QtQuickControlStyle.CheckBoxStyle {
}
Behavior on opacity {
NumberAnimation {
duration: units.longDuration
duration: PlasmaCore.Units.longDuration
easing.type: Easing.InOutQuad
}
}

View File

@ -14,7 +14,7 @@ import org.kde.plasma.components 2.0 as PlasmaComponents
import "private" as Private
QtQuickControlStyle.ComboBoxStyle {
drowDownButtonWidth: units.iconSizes.small
drowDownButtonWidth: PlasmaCore.Units.iconSizes.small
label: PlasmaComponents.Label {
text: control.currentText

View File

@ -12,14 +12,14 @@ Item {
property Item input: parent
width: units.smallSpacing
width: PlasmaCore.Units.smallSpacing
height: input.cursorRectangle.height
visible: input.activeFocus && input.selectionStart === input.selectionEnd
Rectangle {
width: units.smallSpacing
height: parent.height + units.gridUnit
width: PlasmaCore.Units.smallSpacing
height: parent.height + PlasmaCore.Units.gridUnit
radius: width
color: theme.highlightColor
}
@ -27,7 +27,7 @@ Item {
Rectangle {
id: handle
x: -width/2 + parent.width/2
width: units.gridUnit
width: PlasmaCore.Units.gridUnit
height: width
radius: width
color: theme.highlightColor

View File

@ -8,20 +8,20 @@ import QtQuick 2.2
import org.kde.plasma.core 2.0 as PlasmaCore
Item {
width: units.gridUnit
height: styleData.lineHeight + units.gridUnit
width: PlasmaCore.Units.gridUnit
height: styleData.lineHeight + PlasmaCore.Units.gridUnit
visible: styleData.hasSelection
Rectangle {
id: handle
width: units.gridUnit
width: PlasmaCore.Units.gridUnit
height: width
radius: width
color: theme.highlightColor
anchors.bottom: parent.bottom
}
Rectangle {
width: units.gridUnit/2
width: PlasmaCore.Units.gridUnit/2
height: width
anchors {
left: handle.left
@ -30,8 +30,8 @@ Item {
color: theme.highlightColor
}
Rectangle {
width: units.smallSpacing
height: styleData.lineHeight + units.gridUnit/2
width: PlasmaCore.Units.smallSpacing
height: styleData.lineHeight + PlasmaCore.Units.gridUnit/2
color: theme.highlightColor
anchors.left: parent.left
}

View File

@ -128,7 +128,7 @@ Item {
var endRect = input.positionToRectangle(input.selectionEnd);
var pos = getMenuInstance().parent.mapFromItem(input, (startRect.x + endRect.x)/2 - getMenuInstance().width/2, endRect.y);
pos.y += (pos.y + getMenuInstance().height + units.gridUnit) > getMenuInstance().parent.height ? -units.smallSpacing - getMenuInstance().height : units.gridUnit*2;
pos.y += (pos.y + getMenuInstance().height + PlasmaCore.Units.gridUnit) > getMenuInstance().parent.height ? -PlasmaCore.Units.smallSpacing - getMenuInstance().height : PlasmaCore.Units.gridUnit*2;
getMenuInstance().dismiss();
getMenuInstance().popup(pos);

View File

@ -35,7 +35,7 @@ Style {
id: label
anchors.top: parent.top
anchors.left: checkboxloader.right
anchors.margins: units.smallSpacing
anchors.margins: PlasmaCore.Units.smallSpacing
text: control.title
}

View File

@ -27,8 +27,8 @@ QtQuickControlStyle.MenuBarStyle {
imagePath: "widgets/tabbar"
prefix: styleData.open || styleData.selected ? "north-active-tab" : ""
property string plainText: QtQuickControlsPrivate.StyleHelpers.removeMnemonics(styleData.text)
implicitWidth: text.implicitWidth + units.smallSpacing * 3
implicitHeight: text.implicitHeight + units.smallSpacing * 2
implicitWidth: text.implicitWidth + PlasmaCore.Units.smallSpacing * 3
implicitHeight: text.implicitHeight + PlasmaCore.Units.smallSpacing * 2
enabled: styleData.enabled
colorGroup: PlasmaCore.ColorScope.colorGroup

View File

@ -36,7 +36,7 @@ ProgressBarStyle {
}
background: Item {
implicitWidth: units.gridUnit * 14
implicitWidth: PlasmaCore.Units.gridUnit * 14
implicitHeight: theme.mSize(theme.defaultFont).height * 1.6
PlasmaCore.FrameSvgItem {
anchors.centerIn: parent
@ -56,7 +56,7 @@ ProgressBarStyle {
prefix: "bar-active"
colorGroup: PlasmaCore.ColorScope.colorGroup
width: control.indeterminate ? units.gridUnit * 2 : Math.max(margins.left + margins.right, parent.width)
width: control.indeterminate ? PlasmaCore.Units.gridUnit * 2 : Math.max(margins.left + margins.right, parent.width)
height: style.implicitHeight
visible: control.indeterminate || currentProgress > 0
@ -77,7 +77,7 @@ ProgressBarStyle {
duration: PlasmaCore.Units.veryLongDuration * 2
// The progress Item's width might be left over from the previous state
// so we use the control.width/height directly instead
to: control.width - units.gridUnit * 2
to: control.width - PlasmaCore.Units.gridUnit * 2
onToChanged: {
//the animation won't update the boundaries automatically
if (anim.running) {

View File

@ -20,7 +20,7 @@ QtQuickControlStyle.RadioButtonStyle {
anchors.left: parent.left
anchors.right: parent.right
anchors.top: parent.bottom
height: 1 * units.devicePixelRatio
height: 1 * PlasmaCore.Units.devicePixelRatio
color: theme.highlightColor
visible: control.activeFocus
}
@ -28,7 +28,7 @@ QtQuickControlStyle.RadioButtonStyle {
//Not needed?
background: Item {}
spacing: units.smallSpacing
spacing: PlasmaCore.Units.smallSpacing
indicator: PlasmaCore.SvgItem {
svg: PlasmaCore.Svg {
@ -38,7 +38,7 @@ QtQuickControlStyle.RadioButtonStyle {
elementId: "normal"
opacity: control.enabled ? 1 : 0.6
width: units.iconSizes.small
width: PlasmaCore.Units.iconSizes.small
height: width
PlasmaCore.SvgItem {
@ -54,7 +54,7 @@ QtQuickControlStyle.RadioButtonStyle {
}
Behavior on opacity {
NumberAnimation {
duration: units.longDuration
duration: PlasmaCore.Units.longDuration
easing.type: Easing.InOutQuad
}
}

View File

@ -36,9 +36,9 @@ QtQuickControlStyle.ScrollViewStyle {
// QTBUG-35608
// default values are hardcoded in qtdeclarative/src/quick/items/qquickflickablebehavior_p.h
control.flickableItem.flickDeceleration = Math.round(1500 * units.devicePixelRatio);
control.flickableItem.flickDeceleration = Math.round(1500 * PlasmaCore.Units.devicePixelRatio);
// double maximum speed so it feels better
control.flickableItem.maximumFlickVelocity = Math.round(2500 * units.devicePixelRatio);
control.flickableItem.maximumFlickVelocity = Math.round(2500 * PlasmaCore.Units.devicePixelRatio);
control.flickableItem.interactive = true;
}
@ -76,7 +76,7 @@ QtQuickControlStyle.ScrollViewStyle {
opacity: !visible || flickableItem.atYBeginning ? 0 : 1
Behavior on opacity {
NumberAnimation {
duration: units.longDuration
duration: PlasmaCore.Units.longDuration
easing.type: Easing.InOutQuad
}
}
@ -102,7 +102,7 @@ QtQuickControlStyle.ScrollViewStyle {
opacity: !visible || flickableItem.atYEnd ? 0 : 1
Behavior on opacity {
NumberAnimation {
duration: units.longDuration
duration: PlasmaCore.Units.longDuration
easing.type: Easing.InOutQuad
}
}
@ -127,7 +127,7 @@ QtQuickControlStyle.ScrollViewStyle {
opacity: !visible || flickableItem.atXBeginning ? 0 : 1
Behavior on opacity {
NumberAnimation {
duration: units.longDuration
duration: PlasmaCore.Units.longDuration
easing.type: Easing.InOutQuad
}
}
@ -152,7 +152,7 @@ QtQuickControlStyle.ScrollViewStyle {
opacity: !visible || flickableItem.atXEnd ? 0 : 1
Behavior on opacity {
NumberAnimation {
duration: units.longDuration
duration: PlasmaCore.Units.longDuration
easing.type: Easing.InOutQuad
}
}
@ -172,7 +172,7 @@ QtQuickControlStyle.ScrollViewStyle {
opacity: styleData.hovered ? 1 : 0
Behavior on opacity {
NumberAnimation {
duration: units.longDuration
duration: PlasmaCore.Units.longDuration
easing.type: Easing.InOutQuad
}
}
@ -200,8 +200,8 @@ QtQuickControlStyle.ScrollViewStyle {
svg: scrollbarSvg
visible: scrollbarSvg.arrowPresent
//if there is no arrow we don't want to waste space, a tiny margin does look better though
implicitWidth: scrollbarSvg.arrowPresent ? widthHint : units.smallSpacing
implicitHeight: scrollbarSvg.arrowPresent ? widthHint : units.smallSpacing
implicitWidth: scrollbarSvg.arrowPresent ? widthHint : PlasmaCore.Units.smallSpacing
implicitHeight: scrollbarSvg.arrowPresent ? widthHint : PlasmaCore.Units.smallSpacing
elementId: {
if (styleData.pressed) {
return styleData.horizontal ? "sunken-arrow-right" : "sunken-arrow-down"
@ -217,8 +217,8 @@ QtQuickControlStyle.ScrollViewStyle {
decrementControl: PlasmaCore.SvgItem {
svg: scrollbarSvg
visible: scrollbarSvg.arrowPresent
implicitWidth: scrollbarSvg.arrowPresent ? widthHint : units.smallSpacing
implicitHeight: scrollbarSvg.arrowPresent ? widthHint : units.smallSpacing
implicitWidth: scrollbarSvg.arrowPresent ? widthHint : PlasmaCore.Units.smallSpacing
implicitHeight: scrollbarSvg.arrowPresent ? widthHint : PlasmaCore.Units.smallSpacing
elementId: {
if (styleData.pressed) {
return styleData.horizontal ? "sunken-arrow-left" : "sunken-arrow-up"

View File

@ -8,21 +8,21 @@ import QtQuick 2.2
import org.kde.plasma.core 2.0 as PlasmaCore
Item {
width: units.gridUnit
width: PlasmaCore.Units.gridUnit
x: -width
height: styleData.lineHeight + units.gridUnit
height: styleData.lineHeight + PlasmaCore.Units.gridUnit
visible: styleData.hasSelection
Rectangle {
id: handle
width: units.gridUnit
width: PlasmaCore.Units.gridUnit
height: width
radius: width
color: theme.highlightColor
anchors.bottom: parent.bottom
}
Rectangle {
width: units.gridUnit/2
width: PlasmaCore.Units.gridUnit/2
height: width
anchors {
right: handle.right
@ -31,8 +31,8 @@ Item {
color: theme.highlightColor
}
Rectangle {
width: units.smallSpacing
height: styleData.lineHeight + units.gridUnit/2
width: PlasmaCore.Units.smallSpacing
height: styleData.lineHeight + PlasmaCore.Units.gridUnit/2
color: theme.highlightColor
anchors.right: parent.right
}

View File

@ -12,10 +12,10 @@ import org.kde.plasma.core 2.0 as PlasmaCore
QtQuickControlStyle.StatusBarStyle {
padding {
left: units.smallSpacing
right: units.smallSpacing
top: units.smallSpacing
bottom: units.smallSpacing/2
left: PlasmaCore.Units.smallSpacing
right: PlasmaCore.Units.smallSpacing
top: PlasmaCore.Units.smallSpacing
bottom: PlasmaCore.Units.smallSpacing/2
}

View File

@ -40,7 +40,7 @@ QtQuickControlStyle.SwitchStyle {
opacity: checked ? 1 : 0
Behavior on opacity {
PropertyAnimation { duration: units.shortDuration * 2 }
PropertyAnimation { duration: PlasmaCore.Units.shortDuration * 2 }
}
}
}

View File

@ -40,7 +40,7 @@ QtQuickControlStyle.TabViewStyle {
colorGroup: PlasmaCore.ColorScope.colorGroup
Behavior on opacity {
PropertyAnimation {
duration: units.longDuration
duration: PlasmaCore.Units.longDuration
}
}
}

View File

@ -53,7 +53,7 @@ QtQuickControlStyle.TableViewStyle {
rowDelegate: Rectangle {
height: Math.round(units.gridUnit * 1.2)
height: Math.round(PlasmaCore.Units.gridUnit * 1.2)
property color selectedColor: styleData.hasActiveFocus ? theme.viewHoverColor: theme.viewFocusColor
color: styleData.selected ? selectedColor :
@ -113,8 +113,8 @@ QtQuickControlStyle.TableViewStyle {
svg: scrollbarSvg
visible: scrollbarSvg.arrowPresent
//if there is no arrow we don't want to waste space, a tiny margin does look better though
implicitWidth: scrollbarSvg.arrowPresent ? scrollbarWidthHint : units.smallSpacing
implicitHeight: scrollbarSvg.arrowPresent ? scrollbarWidthHint : units.smallSpacing
implicitWidth: scrollbarSvg.arrowPresent ? scrollbarWidthHint : PlasmaCore.Units.smallSpacing
implicitHeight: scrollbarSvg.arrowPresent ? scrollbarWidthHint : PlasmaCore.Units.smallSpacing
elementId: {
if (styleData.pressed) {
return styleData.horizontal ? "sunken-arrow-right" : "sunken-arrow-down"
@ -130,8 +130,8 @@ QtQuickControlStyle.TableViewStyle {
decrementControl: PlasmaCore.SvgItem {
svg: scrollbarSvg
visible: scrollbarSvg.arrowPresent
implicitWidth: scrollbarSvg.arrowPresent ? scrollbarWidthHint : units.smallSpacing
implicitHeight: scrollbarSvg.arrowPresent ? scrollbarWidthHint : units.smallSpacing
implicitWidth: scrollbarSvg.arrowPresent ? scrollbarWidthHint : PlasmaCore.Units.smallSpacing
implicitHeight: scrollbarSvg.arrowPresent ? scrollbarWidthHint : PlasmaCore.Units.smallSpacing
elementId: {
if (styleData.pressed) {
return styleData.horizontal ? "sunken-arrow-left" : "sunken-arrow-up"

View File

@ -48,7 +48,7 @@ QtQuickControlStyle.TextAreaStyle {
style.padding.left = base.margins.left
style.padding.top = base.margins.top
//TODO: if QtControls gets a component for this, use it instead of this hardcoded heuristic
style.padding.right = base.margins.right + (control.clearButtonShown ? Math.max(control.parent.height*0.8, units.iconSizes.small)+units.smallSpacing : 0)
style.padding.right = base.margins.right + (control.clearButtonShown ? Math.max(control.parent.height*0.8, PlasmaCore.Units.iconSizes.small)+PlasmaCore.Units.smallSpacing : 0)
style.padding.bottom = base.margins.bottom
}
}

View File

@ -74,11 +74,11 @@ QtQuickControlStyle.TextFieldStyle {
//TODO: if QtControls gets a component for this, use it instead of this hardcoded heuristic
root.padding.right = Qt.binding(function() {
var actionIconSize = Math.max(control.height * 0.8, units.iconSizes.small);
var actionIconSize = Math.max(control.height * 0.8, PlasmaCore.Units.iconSizes.small);
//actionCount is an int of the number of items
var actionCount = (control.hasOwnProperty("clearButtonShown") && control.clearButtonShown) +
(control.hasOwnProperty("__effectiveRevealPasswordButtonShown") && control.__effectiveRevealPasswordButtonShown);
return base.margins.right + (actionIconSize * actionCount) + (actionCount > 0 ? units.smallSpacing : 0);
return base.margins.right + (actionIconSize * actionCount) + (actionCount > 0 ? PlasmaCore.Units.smallSpacing : 0);
})
}
}

View File

@ -33,9 +33,9 @@ QtQuickControlStyle.ButtonStyle {
RowLayout {
id: buttonContent
anchors.fill: parent
spacing: units.smallSpacing
spacing: PlasmaCore.Units.smallSpacing
Layout.preferredHeight: Math.max(units.iconSizes.small, label.implicitHeight)
Layout.preferredHeight: Math.max(PlasmaCore.Units.iconSizes.small, label.implicitHeight)
property real minimumWidth: Layout.minimumWidth + style.padding.left + style.padding.right
onMinimumWidthChanged: {
@ -98,7 +98,7 @@ QtQuickControlStyle.ButtonStyle {
id: arrow
when: control.menu !== null
visible: when
Layout.minimumWidth: units.iconSizes.small
Layout.minimumWidth: PlasmaCore.Units.iconSizes.small
Layout.maximumWidth: Layout.minimumWidth
Layout.minimumHeight: Layout.minimumWidth
@ -174,7 +174,7 @@ QtQuickControlStyle.ButtonStyle {
//internal: if there is no hover status, don't paint on mouse over in touchscreens
opacity: (control.pressed || control.checked || !style.flat || (roundShadow.hasOverState && style.controlHovered)) ? 1 : 0
Behavior on opacity {
PropertyAnimation { duration: units.longDuration }
PropertyAnimation { duration: PlasmaCore.Units.longDuration }
}
}
}

View File

@ -114,7 +114,7 @@ Item {
Transition {
PropertyAnimation {
properties: "opacity"
duration: units.longDuration
duration: PlasmaCore.Units.longDuration
easing.type: Easing.OutQuad
}
}

View File

@ -113,7 +113,7 @@ Item {
Transition {
PropertyAnimation {
properties: "opacity"
duration: units.veryShortDuration
duration: PlasmaCore.Units.veryShortDuration
easing.type: Easing.OutQuad
}
}

View File

@ -77,7 +77,7 @@ Item {
Transition {
PropertyAnimation {
properties: "opacity"
duration: units.longDuration
duration: PlasmaCore.Units.longDuration
easing.type: Easing.OutQuad
}
}

View File

@ -16,7 +16,7 @@ ColumnLayout {
property alias cfg_DisplayText: textField.text
RowLayout {
spacing: units.largeSpacing / 2
spacing: PlasmaCore.Units.largeSpacing / 2
// To allow aligned integration in the settings form,
// "formAlignment" is a property injected by the config containment
@ -24,7 +24,7 @@ ColumnLayout {
QtControls.Label {
Layout.minimumWidth: width
Layout.maximumWidth: width
width: formAlignment - units.largeSpacing
width: formAlignment - PlasmaCore.Units.largeSpacing
horizontalAlignment: Text.AlignRight
// use i18nd in config QML, as the default textdomain is set to that of the config container

View File

@ -16,7 +16,7 @@ ColumnLayout {
property alias cfg_DisplayText: textField.text
RowLayout {
spacing: units.largeSpacing / 2
spacing: PlasmaCore.Units.largeSpacing / 2
// To allow aligned integration in the settings form,
// "formAlignment" is a property injected by the config containment
@ -24,7 +24,7 @@ ColumnLayout {
QtControls.Label {
Layout.minimumWidth: width
Layout.maximumWidth: width
width: formAlignment - units.largeSpacing
width: formAlignment - PlasmaCore.Units.largeSpacing
horizontalAlignment: Text.AlignRight
// use i18nd in config QML, as the default textdomain is set to that of the config container

View File

@ -19,8 +19,8 @@ ColumnLayout {
Layout.minimumHeight: rect1.height
Rectangle {
id: rect1
width: units.gridUnit * 30
height: units.gridUnit * 15
width: PlasmaCore.Units.gridUnit * 30
height: PlasmaCore.Units.gridUnit * 15
color: PlasmaCore.ColorScope.backgroundColor
Column {
@ -48,7 +48,7 @@ ColumnLayout {
}
Rectangle {
width: parent.width
height: units.gridUnit * 3
height: PlasmaCore.Units.gridUnit * 3
color: PlasmaCore.ColorScope.textColor
}
}
@ -61,8 +61,8 @@ ColumnLayout {
Layout.minimumHeight: rect1.height
Rectangle {
id: rect2
width: units.gridUnit * 30
height: units.gridUnit * 15
width: PlasmaCore.Units.gridUnit * 30
height: PlasmaCore.Units.gridUnit * 15
color: PlasmaCore.ColorScope.backgroundColor
}
}

View File

@ -42,7 +42,7 @@ ColumnLayout
id: menuColumn
Layout.minimumWidth: menuColumn.implicitWidth
Layout.minimumHeight: menuColumn.implicitHeight
spacing: units.smallSpacing
spacing: PlasmaCore.Units.smallSpacing
PlasmaExtras.Heading {
level: 3

View File

@ -16,7 +16,7 @@ import org.kde.plasma.extras 2.0 as PlasmaExtras
ColumnLayout
{
height: units.gridUnit * 20
height: PlasmaCore.Units.gridUnit * 20
Controls.Label {
id: label
text: "Press the button and make sure the popup is on the correct place"
@ -46,7 +46,7 @@ ColumnLayout
id: menuColumn
Layout.minimumWidth: menuColumn.implicitWidth
Layout.minimumHeight: menuColumn.implicitHeight
spacing: units.smallSpacing
spacing: PlasmaCore.Units.smallSpacing
PlasmaExtras.Heading {
level: 3