From 5447cef2d83aa189b80d71fe815c7944db5abc3f Mon Sep 17 00:00:00 2001 From: Nate Graham Date: Fri, 5 Mar 2021 12:22:42 -0700 Subject: [PATCH] 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) --- .../applets/bugreport/contents/ui/main.qml | 6 ++-- .../conditionalloader/contents/ui/main.qml | 2 +- examples/applets/config/contents/ui/main.qml | 2 +- .../testcomponents/contents/ui/IconsPage.qml | 8 +++--- .../contents/ui/PlasmoidPage.qml | 4 +-- .../contents/ui/testcomponents.qml | 8 +++--- .../testshaders/contents/ui/WobbleExample.qml | 2 +- .../contents/ui/testshaderapplet.qml | 10 +++---- .../testtheme/contents/ui/FontGizmo.qml | 2 +- .../testtheme/contents/ui/FontTest.qml | 22 +++++++-------- .../testtheme/contents/ui/FontsPage.qml | 2 +- .../testtheme/contents/ui/ScalePage.qml | 24 ++++++++-------- .../testtheme/contents/ui/UnitsPage.qml | 22 +++++++-------- .../testtheme/contents/ui/testtheme.qml | 18 ++++++------ .../developerguide/basic/contents/ui/main.qml | 10 +++---- .../wallpapers/autumn/contents/ui/config.qml | 4 +-- .../core/private/DefaultToolTip.qml | 18 ++++++------ .../kirigamiplasmadesktopstyle/Units.qml | 24 ++++++++-------- .../kirigamiplasmastyle/Units.qml | 28 +++++++++---------- .../plasmacomponents3/CheckBox.qml | 8 +++--- .../plasmacomponents3/CheckDelegate.qml | 2 +- .../plasmacomponents3/CheckIndicator.qml | 4 +-- .../plasmacomponents3/ComboBox.qml | 8 +++--- .../plasmacomponents3/Dial.qml | 6 ++-- .../plasmacomponents3/Dialog.qml | 2 +- .../plasmacomponents3/DialogButtonBox.qml | 4 +-- .../plasmacomponents3/Drawer.qml | 10 +++---- .../plasmacomponents3/Frame.qml | 2 +- .../plasmacomponents3/ItemDelegate.qml | 2 +- .../plasmacomponents3/Menu.qml | 4 +-- .../plasmacomponents3/MenuItem.qml | 6 ++-- .../plasmacomponents3/PageIndicator.qml | 8 +++--- .../plasmacomponents3/ProgressBar.qml | 4 +-- .../plasmacomponents3/RadioButton.qml | 2 +- .../plasmacomponents3/RadioDelegate.qml | 2 +- .../plasmacomponents3/RadioIndicator.qml | 4 +-- .../plasmacomponents3/RangeSlider.qml | 8 +++--- .../plasmacomponents3/RoundButton.qml | 16 +++++------ .../plasmacomponents3/ScrollBar.qml | 4 +-- .../plasmacomponents3/Slider.qml | 14 +++++----- .../plasmacomponents3/SpinBox.qml | 6 ++-- .../plasmacomponents3/Switch.qml | 4 +-- .../plasmacomponents3/SwitchDelegate.qml | 2 +- .../plasmacomponents3/SwitchIndicator.qml | 10 +++---- .../plasmacomponents3/TabBar.qml | 2 +- .../plasmacomponents3/TabButton.qml | 6 ++-- .../plasmacomponents3/TextField.qml | 12 ++++---- .../mobiletextselection/MobileCursor.qml | 8 +++--- .../MobileTextActionsToolBar.qml | 3 +- .../plasmacomponents3/private/ButtonFocus.qml | 4 +-- .../private/FlatButtonBackground.qml | 6 ++-- .../private/RaisedButtonBackground.qml | 6 ++-- .../plasmacomponents3/private/RoundShadow.qml | 2 +- .../private/TextFieldFocus.qml | 2 +- .../plasmastyle/ButtonStyle.qml | 8 +++--- .../plasmastyle/CalendarStyle.qml | 12 ++++---- .../plasmastyle/CheckBoxStyle.qml | 8 +++--- .../plasmastyle/ComboBoxStyle.qml | 2 +- .../plasmastyle/CursorDelegate.qml | 8 +++--- .../plasmastyle/CursorHandleStyle.qml | 12 ++++---- .../plasmastyle/EditMenuTouch.qml | 2 +- .../plasmastyle/GroupBoxStyle.qml | 2 +- .../plasmastyle/MenuBarStyle.qml | 4 +-- .../plasmastyle/ProgressBarStyle.qml | 6 ++-- .../plasmastyle/RadioButtonStyle.qml | 8 +++--- .../plasmastyle/ScrollViewStyle.qml | 22 +++++++-------- .../plasmastyle/SelectionHandleStyle.qml | 12 ++++---- .../plasmastyle/StatusBarStyle.qml | 8 +++--- .../plasmastyle/SwitchStyle.qml | 2 +- .../plasmastyle/TabViewStyle.qml | 2 +- .../plasmastyle/TableViewStyle.qml | 10 +++---- .../plasmastyle/TextAreaStyle.qml | 2 +- .../plasmastyle/TextFieldStyle.qml | 4 +-- .../plasmastyle/ToolButtonStyle.qml | 8 +++--- .../plasmastyle/private/ButtonShadow.qml | 2 +- .../plasmastyle/private/RoundShadow.qml | 2 +- .../plasmastyle/private/TextFieldFocus.qml | 2 +- .../package/contents/ui/config.qml | 4 +-- .../package/contents/ui/config.qml | 4 +-- tests/colorcontext.qml | 10 +++---- tests/dialog_positioning2.qml | 2 +- tests/dialog_positioning_parentrotated.qml | 4 +-- 82 files changed, 291 insertions(+), 290 deletions(-) diff --git a/examples/applets/bugreport/contents/ui/main.qml b/examples/applets/bugreport/contents/ui/main.qml index 6c0f53f69..494c478e1 100644 --- a/examples/applets/bugreport/contents/ui/main.qml +++ b/examples/applets/bugreport/contents/ui/main.qml @@ -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 { diff --git a/examples/applets/conditionalloader/contents/ui/main.qml b/examples/applets/conditionalloader/contents/ui/main.qml index 753d12434..33edab6a5 100644 --- a/examples/applets/conditionalloader/contents/ui/main.qml +++ b/examples/applets/conditionalloader/contents/ui/main.qml @@ -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 { diff --git a/examples/applets/config/contents/ui/main.qml b/examples/applets/config/contents/ui/main.qml index 4a66c1a41..4fe1dac91 100644 --- a/examples/applets/config/contents/ui/main.qml +++ b/examples/applets/config/contents/ui/main.qml @@ -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 diff --git a/examples/applets/testcomponents/contents/ui/IconsPage.qml b/examples/applets/testcomponents/contents/ui/IconsPage.qml index 17164cf6b..002879737 100644 --- a/examples/applets/testcomponents/contents/ui/IconsPage.qml +++ b/examples/applets/testcomponents/contents/ui/IconsPage.qml @@ -30,10 +30,10 @@ PlasmaComponents.Page { text: "Icons" } PlasmaComponents.Label { - text: "iconSizes.small : " + units.iconSizes.small + - ", iconSizes.desktop: " + units.iconSizes.desktop + - ",
iconSizes.toolbar: " + units.iconSizes.toolbar + - ", iconSizes.dialog : " + units.iconSizes.dialog + text: "iconSizes.small : " + PlasmaCore.Units.iconSizes.small + + ", iconSizes.desktop: " + PlasmaCore.Units.iconSizes.desktop + + ",
iconSizes.toolbar: " + PlasmaCore.Units.iconSizes.toolbar + + ", iconSizes.dialog : " + PlasmaCore.Units.iconSizes.dialog } Flow { diff --git a/examples/applets/testcomponents/contents/ui/PlasmoidPage.qml b/examples/applets/testcomponents/contents/ui/PlasmoidPage.qml index 056208e0e..ad62b6e86 100644 --- a/examples/applets/testcomponents/contents/ui/PlasmoidPage.qml +++ b/examples/applets/testcomponents/contents/ui/PlasmoidPage.qml @@ -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 diff --git a/examples/applets/testcomponents/contents/ui/testcomponents.qml b/examples/applets/testcomponents/contents/ui/testcomponents.qml index aa40ae30b..ad47c187b 100644 --- a/examples/applets/testcomponents/contents/ui/testcomponents.qml +++ b/examples/applets/testcomponents/contents/ui/testcomponents.qml @@ -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 diff --git a/examples/applets/testshaders/contents/ui/WobbleExample.qml b/examples/applets/testshaders/contents/ui/WobbleExample.qml index bdfa48d11..bdae536b5 100644 --- a/examples/applets/testshaders/contents/ui/WobbleExample.qml +++ b/examples/applets/testshaders/contents/ui/WobbleExample.qml @@ -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: { diff --git a/examples/applets/testshaders/contents/ui/testshaderapplet.qml b/examples/applets/testshaders/contents/ui/testshaderapplet.qml index 768fd8cf5..e6d19af5e 100644 --- a/examples/applets/testshaders/contents/ui/testshaderapplet.qml +++ b/examples/applets/testshaders/contents/ui/testshaderapplet.qml @@ -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; } diff --git a/examples/applets/testtheme/contents/ui/FontGizmo.qml b/examples/applets/testtheme/contents/ui/FontGizmo.qml index 5591f8e7f..47a6579fc 100644 --- a/examples/applets/testtheme/contents/ui/FontGizmo.qml +++ b/examples/applets/testtheme/contents/ui/FontGizmo.qml @@ -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 { diff --git a/examples/applets/testtheme/contents/ui/FontTest.qml b/examples/applets/testtheme/contents/ui/FontTest.qml index 5536a796d..1c08ac222 100644 --- a/examples/applets/testtheme/contents/ui/FontTest.qml +++ b/examples/applets/testtheme/contents/ui/FontTest.qml @@ -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 } } diff --git a/examples/applets/testtheme/contents/ui/FontsPage.qml b/examples/applets/testtheme/contents/ui/FontsPage.qml index 910d363cb..4356f86ce 100644 --- a/examples/applets/testtheme/contents/ui/FontsPage.qml +++ b/examples/applets/testtheme/contents/ui/FontsPage.qml @@ -21,7 +21,7 @@ Item { id: themePage anchors { - margins: units.largeSpacing + margins: PlasmaCore.Units.largeSpacing } FontTest { diff --git a/examples/applets/testtheme/contents/ui/ScalePage.qml b/examples/applets/testtheme/contents/ui/ScalePage.qml index 4cc90541c..b96ec34a6 100644 --- a/examples/applets/testtheme/contents/ui/ScalePage.qml +++ b/examples/applets/testtheme/contents/ui/ScalePage.qml @@ -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 on top of 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 // } diff --git a/examples/applets/testtheme/contents/ui/UnitsPage.qml b/examples/applets/testtheme/contents/ui/UnitsPage.qml index 865c4a6ba..c4c74d692 100644 --- a/examples/applets/testtheme/contents/ui/UnitsPage.qml +++ b/examples/applets/testtheme/contents/ui/UnitsPage.qml @@ -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 } } diff --git a/examples/applets/testtheme/contents/ui/testtheme.qml b/examples/applets/testtheme/contents/ui/testtheme.qml index ff48c0f8c..801749dcb 100644 --- a/examples/applets/testtheme/contents/ui/testtheme.qml +++ b/examples/applets/testtheme/contents/ui/testtheme.qml @@ -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 } diff --git a/examples/developerguide/basic/contents/ui/main.qml b/examples/developerguide/basic/contents/ui/main.qml index 481a820c5..f9afe8556 100644 --- a/examples/developerguide/basic/contents/ui/main.qml +++ b/examples/developerguide/basic/contents/ui/main.qml @@ -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 diff --git a/examples/wallpapers/autumn/contents/ui/config.qml b/examples/wallpapers/autumn/contents/ui/config.qml index 974007ab6..e182f06bb 100644 --- a/examples/wallpapers/autumn/contents/ui/config.qml +++ b/examples/wallpapers/autumn/contents/ui/config.qml @@ -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:" } diff --git a/src/declarativeimports/core/private/DefaultToolTip.qml b/src/declarativeimports/core/private/DefaultToolTip.qml index 5099128ab..9baf29e9a 100644 --- a/src/declarativeimports/core/private/DefaultToolTip.qml +++ b/src/declarativeimports/core/private/DefaultToolTip.qml @@ -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 { diff --git a/src/declarativeimports/kirigamiplasmadesktopstyle/Units.qml b/src/declarativeimports/kirigamiplasmadesktopstyle/Units.qml index f9b0e85d9..f3e51b0a9 100644 --- a/src/declarativeimports/kirigamiplasmadesktopstyle/Units.qml +++ b/src/declarativeimports/kirigamiplasmadesktopstyle/Units.qml @@ -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" } diff --git a/src/declarativeimports/kirigamiplasmastyle/Units.qml b/src/declarativeimports/kirigamiplasmastyle/Units.qml index b29eddd29..9538b6dde 100644 --- a/src/declarativeimports/kirigamiplasmastyle/Units.qml +++ b/src/declarativeimports/kirigamiplasmastyle/Units.qml @@ -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. diff --git a/src/declarativeimports/plasmacomponents3/CheckBox.qml b/src/declarativeimports/plasmacomponents3/CheckBox.qml index 19de1eb99..1f07b8e17 100644 --- a/src/declarativeimports/plasmacomponents3/CheckBox.qml +++ b/src/declarativeimports/plasmacomponents3/CheckBox.qml @@ -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 { diff --git a/src/declarativeimports/plasmacomponents3/CheckDelegate.qml b/src/declarativeimports/plasmacomponents3/CheckDelegate.qml index 455d8055d..1fe72f74a 100644 --- a/src/declarativeimports/plasmacomponents3/CheckDelegate.qml +++ b/src/declarativeimports/plasmacomponents3/CheckDelegate.qml @@ -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 diff --git a/src/declarativeimports/plasmacomponents3/CheckIndicator.qml b/src/declarativeimports/plasmacomponents3/CheckIndicator.qml index 04322f5c8..9ac9a0100 100644 --- a/src/declarativeimports/plasmacomponents3/CheckIndicator.qml +++ b/src/declarativeimports/plasmacomponents3/CheckIndicator.qml @@ -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 } } diff --git a/src/declarativeimports/plasmacomponents3/ComboBox.qml b/src/declarativeimports/plasmacomponents3/ComboBox.qml index 7da9ca16f..35315f31f 100644 --- a/src/declarativeimports/plasmacomponents3/ComboBox.qml +++ b/src/declarativeimports/plasmacomponents3/ComboBox.qml @@ -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 diff --git a/src/declarativeimports/plasmacomponents3/Dial.qml b/src/declarativeimports/plasmacomponents3/Dial.qml index 5e4ca1afc..4b7d74616 100644 --- a/src/declarativeimports/plasmacomponents3/Dial.qml +++ b/src/declarativeimports/plasmacomponents3/Dial.qml @@ -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 } } } } diff --git a/src/declarativeimports/plasmacomponents3/Dialog.qml b/src/declarativeimports/plasmacomponents3/Dialog.qml index 61908ecdb..19b757446 100644 --- a/src/declarativeimports/plasmacomponents3/Dialog.qml +++ b/src/declarativeimports/plasmacomponents3/Dialog.qml @@ -47,7 +47,7 @@ T.Dialog { contentItem: Item { } background: PlasmaCore.FrameSvgItem { - implicitWidth: units.gridUnit * 12 + implicitWidth: PlasmaCore.Units.gridUnit * 12 imagePath: "widgets/background" } diff --git a/src/declarativeimports/plasmacomponents3/DialogButtonBox.qml b/src/declarativeimports/plasmacomponents3/DialogButtonBox.qml index f13b55e43..e961510d7 100644 --- a/src/declarativeimports/plasmacomponents3/DialogButtonBox.qml +++ b/src/declarativeimports/plasmacomponents3/DialogButtonBox.qml @@ -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 diff --git a/src/declarativeimports/plasmacomponents3/Drawer.qml b/src/declarativeimports/plasmacomponents3/Drawer.qml index 9411f528a..f09f12455 100644 --- a/src/declarativeimports/plasmacomponents3/Drawer.qml +++ b/src/declarativeimports/plasmacomponents3/Drawer.qml @@ -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) { diff --git a/src/declarativeimports/plasmacomponents3/Frame.qml b/src/declarativeimports/plasmacomponents3/Frame.qml index 74c9f4c9b..36c997b69 100644 --- a/src/declarativeimports/plasmacomponents3/Frame.qml +++ b/src/declarativeimports/plasmacomponents3/Frame.qml @@ -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" diff --git a/src/declarativeimports/plasmacomponents3/ItemDelegate.qml b/src/declarativeimports/plasmacomponents3/ItemDelegate.qml index 651908e1b..f341a2afb 100644 --- a/src/declarativeimports/plasmacomponents3/ItemDelegate.qml +++ b/src/declarativeimports/plasmacomponents3/ItemDelegate.qml @@ -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 diff --git a/src/declarativeimports/plasmacomponents3/Menu.qml b/src/declarativeimports/plasmacomponents3/Menu.qml index a1678bef6..92d69ebb6 100644 --- a/src/declarativeimports/plasmacomponents3/Menu.qml +++ b/src/declarativeimports/plasmacomponents3/Menu.qml @@ -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 } } diff --git a/src/declarativeimports/plasmacomponents3/MenuItem.qml b/src/declarativeimports/plasmacomponents3/MenuItem.qml index b42bedff0..16f2a5e36 100644 --- a/src/declarativeimports/plasmacomponents3/MenuItem.qml +++ b/src/declarativeimports/plasmacomponents3/MenuItem.qml @@ -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 } } } diff --git a/src/declarativeimports/plasmacomponents3/PageIndicator.qml b/src/declarativeimports/plasmacomponents3/PageIndicator.qml index 0eae0b7b4..853629ff7 100644 --- a/src/declarativeimports/plasmacomponents3/PageIndicator.qml +++ b/src/declarativeimports/plasmacomponents3/PageIndicator.qml @@ -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 } } diff --git a/src/declarativeimports/plasmacomponents3/ProgressBar.qml b/src/declarativeimports/plasmacomponents3/ProgressBar.qml index 684f095e1..5df6d95ca 100644 --- a/src/declarativeimports/plasmacomponents3/ProgressBar.qml +++ b/src/declarativeimports/plasmacomponents3/ProgressBar.qml @@ -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; diff --git a/src/declarativeimports/plasmacomponents3/RadioButton.qml b/src/declarativeimports/plasmacomponents3/RadioButton.qml index 0b89ef20f..a6203f0c8 100644 --- a/src/declarativeimports/plasmacomponents3/RadioButton.qml +++ b/src/declarativeimports/plasmacomponents3/RadioButton.qml @@ -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 diff --git a/src/declarativeimports/plasmacomponents3/RadioDelegate.qml b/src/declarativeimports/plasmacomponents3/RadioDelegate.qml index 6f395c41b..487576cba 100644 --- a/src/declarativeimports/plasmacomponents3/RadioDelegate.qml +++ b/src/declarativeimports/plasmacomponents3/RadioDelegate.qml @@ -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 diff --git a/src/declarativeimports/plasmacomponents3/RadioIndicator.qml b/src/declarativeimports/plasmacomponents3/RadioIndicator.qml index 38ed4cc88..b224f95c1 100644 --- a/src/declarativeimports/plasmacomponents3/RadioIndicator.qml +++ b/src/declarativeimports/plasmacomponents3/RadioIndicator.qml @@ -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 } } diff --git a/src/declarativeimports/plasmacomponents3/RangeSlider.qml b/src/declarativeimports/plasmacomponents3/RangeSlider.qml index 85a8d646d..b3c3fed29 100644 --- a/src/declarativeimports/plasmacomponents3/RangeSlider.qml +++ b/src/declarativeimports/plasmacomponents3/RangeSlider.qml @@ -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 diff --git a/src/declarativeimports/plasmacomponents3/RoundButton.qml b/src/declarativeimports/plasmacomponents3/RoundButton.qml index d022690e1..d7e43d505 100644 --- a/src/declarativeimports/plasmacomponents3/RoundButton.qml +++ b/src/declarativeimports/plasmacomponents3/RoundButton.qml @@ -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 } } diff --git a/src/declarativeimports/plasmacomponents3/ScrollBar.qml b/src/declarativeimports/plasmacomponents3/ScrollBar.qml index 136d45255..bfc70d195 100644 --- a/src/declarativeimports/plasmacomponents3/ScrollBar.qml +++ b/src/declarativeimports/plasmacomponents3/ScrollBar.qml @@ -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 } } } diff --git a/src/declarativeimports/plasmacomponents3/Slider.qml b/src/declarativeimports/plasmacomponents3/Slider.qml index 747ced4f9..787e64af1 100644 --- a/src/declarativeimports/plasmacomponents3/Slider.qml +++ b/src/declarativeimports/plasmacomponents3/Slider.qml @@ -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 } } diff --git a/src/declarativeimports/plasmacomponents3/SpinBox.qml b/src/declarativeimports/plasmacomponents3/SpinBox.qml index 4677c09c8..ca0e85984 100644 --- a/src/declarativeimports/plasmacomponents3/SpinBox.qml +++ b/src/declarativeimports/plasmacomponents3/SpinBox.qml @@ -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 diff --git a/src/declarativeimports/plasmacomponents3/Switch.qml b/src/declarativeimports/plasmacomponents3/Switch.qml index 91c8a5691..450b59eda 100644 --- a/src/declarativeimports/plasmacomponents3/Switch.qml +++ b/src/declarativeimports/plasmacomponents3/Switch.qml @@ -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 diff --git a/src/declarativeimports/plasmacomponents3/SwitchDelegate.qml b/src/declarativeimports/plasmacomponents3/SwitchDelegate.qml index 67328d026..ff25bb1bf 100644 --- a/src/declarativeimports/plasmacomponents3/SwitchDelegate.qml +++ b/src/declarativeimports/plasmacomponents3/SwitchDelegate.qml @@ -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 diff --git a/src/declarativeimports/plasmacomponents3/SwitchIndicator.qml b/src/declarativeimports/plasmacomponents3/SwitchIndicator.qml index d0ea49258..81fbe1b89 100644 --- a/src/declarativeimports/plasmacomponents3/SwitchIndicator.qml +++ b/src/declarativeimports/plasmacomponents3/SwitchIndicator.qml @@ -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 } } diff --git a/src/declarativeimports/plasmacomponents3/TabBar.qml b/src/declarativeimports/plasmacomponents3/TabBar.qml index f81169698..4a0545ece 100644 --- a/src/declarativeimports/plasmacomponents3/TabBar.qml +++ b/src/declarativeimports/plasmacomponents3/TabBar.qml @@ -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 diff --git a/src/declarativeimports/plasmacomponents3/TabButton.qml b/src/declarativeimports/plasmacomponents3/TabButton.qml index da99bd5b6..5d2b9e647 100644 --- a/src/declarativeimports/plasmacomponents3/TabButton.qml +++ b/src/declarativeimports/plasmacomponents3/TabButton.qml @@ -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 diff --git a/src/declarativeimports/plasmacomponents3/TextField.qml b/src/declarativeimports/plasmacomponents3/TextField.qml index 969a22c26..48b743555 100644 --- a/src/declarativeimports/plasmacomponents3/TextField.qml +++ b/src/declarativeimports/plasmacomponents3/TextField.qml @@ -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 } } diff --git a/src/declarativeimports/plasmacomponents3/mobiletextselection/MobileCursor.qml b/src/declarativeimports/plasmacomponents3/mobiletextselection/MobileCursor.qml index 564a322bd..635a3cbd1 100644 --- a/src/declarativeimports/plasmacomponents3/mobiletextselection/MobileCursor.qml +++ b/src/declarativeimports/plasmacomponents3/mobiletextselection/MobileCursor.qml @@ -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: { diff --git a/src/declarativeimports/plasmacomponents3/mobiletextselection/MobileTextActionsToolBar.qml b/src/declarativeimports/plasmacomponents3/mobiletextselection/MobileTextActionsToolBar.qml index d3beb35ab..326559ecc 100644 --- a/src/declarativeimports/plasmacomponents3/mobiletextselection/MobileTextActionsToolBar.qml +++ b/src/declarativeimports/plasmacomponents3/mobiletextselection/MobileTextActionsToolBar.qml @@ -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); } } diff --git a/src/declarativeimports/plasmacomponents3/private/ButtonFocus.qml b/src/declarativeimports/plasmacomponents3/private/ButtonFocus.qml index 796bc31a1..0191682f0 100644 --- a/src/declarativeimports/plasmacomponents3/private/ButtonFocus.qml +++ b/src/declarativeimports/plasmacomponents3/private/ButtonFocus.qml @@ -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 } } diff --git a/src/declarativeimports/plasmacomponents3/private/FlatButtonBackground.qml b/src/declarativeimports/plasmacomponents3/private/FlatButtonBackground.qml index a40a6ba2e..b5b3e9257 100644 --- a/src/declarativeimports/plasmacomponents3/private/FlatButtonBackground.qml +++ b/src/declarativeimports/plasmacomponents3/private/FlatButtonBackground.qml @@ -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 { diff --git a/src/declarativeimports/plasmacomponents3/private/RaisedButtonBackground.qml b/src/declarativeimports/plasmacomponents3/private/RaisedButtonBackground.qml index b1274a400..e7e021dc5 100644 --- a/src/declarativeimports/plasmacomponents3/private/RaisedButtonBackground.qml +++ b/src/declarativeimports/plasmacomponents3/private/RaisedButtonBackground.qml @@ -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 { diff --git a/src/declarativeimports/plasmacomponents3/private/RoundShadow.qml b/src/declarativeimports/plasmacomponents3/private/RoundShadow.qml index 161171b58..d2bf32a82 100644 --- a/src/declarativeimports/plasmacomponents3/private/RoundShadow.qml +++ b/src/declarativeimports/plasmacomponents3/private/RoundShadow.qml @@ -113,7 +113,7 @@ Item { Transition { PropertyAnimation { properties: "opacity" - duration: units.longDuration + duration: PlasmaCore.Units.longDuration easing.type: Easing.OutQuad } } diff --git a/src/declarativeimports/plasmacomponents3/private/TextFieldFocus.qml b/src/declarativeimports/plasmacomponents3/private/TextFieldFocus.qml index 5fb2ec3f1..2b7faeb75 100644 --- a/src/declarativeimports/plasmacomponents3/private/TextFieldFocus.qml +++ b/src/declarativeimports/plasmacomponents3/private/TextFieldFocus.qml @@ -77,7 +77,7 @@ Item { Transition { PropertyAnimation { properties: "opacity" - duration: units.longDuration + duration: PlasmaCore.Units.longDuration easing.type: Easing.OutQuad } } diff --git a/src/declarativeimports/plasmastyle/ButtonStyle.qml b/src/declarativeimports/plasmastyle/ButtonStyle.qml index 34612713f..2d62132c3 100644 --- a/src/declarativeimports/plasmastyle/ButtonStyle.qml +++ b/src/declarativeimports/plasmastyle/ButtonStyle.qml @@ -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 diff --git a/src/declarativeimports/plasmastyle/CalendarStyle.qml b/src/declarativeimports/plasmastyle/CalendarStyle.qml index 30c3e676a..64d22b16f 100644 --- a/src/declarativeimports/plasmastyle/CalendarStyle.qml +++ b/src/declarativeimports/plasmastyle/CalendarStyle.qml @@ -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 diff --git a/src/declarativeimports/plasmastyle/CheckBoxStyle.qml b/src/declarativeimports/plasmastyle/CheckBoxStyle.qml index 9bcf463c4..fb64e1017 100644 --- a/src/declarativeimports/plasmastyle/CheckBoxStyle.qml +++ b/src/declarativeimports/plasmastyle/CheckBoxStyle.qml @@ -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 } } diff --git a/src/declarativeimports/plasmastyle/ComboBoxStyle.qml b/src/declarativeimports/plasmastyle/ComboBoxStyle.qml index 0934d9828..9accdbf08 100644 --- a/src/declarativeimports/plasmastyle/ComboBoxStyle.qml +++ b/src/declarativeimports/plasmastyle/ComboBoxStyle.qml @@ -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 diff --git a/src/declarativeimports/plasmastyle/CursorDelegate.qml b/src/declarativeimports/plasmastyle/CursorDelegate.qml index 3efc0dfda..956699e2d 100644 --- a/src/declarativeimports/plasmastyle/CursorDelegate.qml +++ b/src/declarativeimports/plasmastyle/CursorDelegate.qml @@ -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 diff --git a/src/declarativeimports/plasmastyle/CursorHandleStyle.qml b/src/declarativeimports/plasmastyle/CursorHandleStyle.qml index 34fc7cabf..fe627dd1a 100644 --- a/src/declarativeimports/plasmastyle/CursorHandleStyle.qml +++ b/src/declarativeimports/plasmastyle/CursorHandleStyle.qml @@ -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 } diff --git a/src/declarativeimports/plasmastyle/EditMenuTouch.qml b/src/declarativeimports/plasmastyle/EditMenuTouch.qml index 5eda20b16..3f023bb6c 100644 --- a/src/declarativeimports/plasmastyle/EditMenuTouch.qml +++ b/src/declarativeimports/plasmastyle/EditMenuTouch.qml @@ -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); diff --git a/src/declarativeimports/plasmastyle/GroupBoxStyle.qml b/src/declarativeimports/plasmastyle/GroupBoxStyle.qml index 5243b94db..01e7120e3 100644 --- a/src/declarativeimports/plasmastyle/GroupBoxStyle.qml +++ b/src/declarativeimports/plasmastyle/GroupBoxStyle.qml @@ -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 } diff --git a/src/declarativeimports/plasmastyle/MenuBarStyle.qml b/src/declarativeimports/plasmastyle/MenuBarStyle.qml index a482e8d64..7ee018364 100644 --- a/src/declarativeimports/plasmastyle/MenuBarStyle.qml +++ b/src/declarativeimports/plasmastyle/MenuBarStyle.qml @@ -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 diff --git a/src/declarativeimports/plasmastyle/ProgressBarStyle.qml b/src/declarativeimports/plasmastyle/ProgressBarStyle.qml index f0223db4f..d13b5d414 100644 --- a/src/declarativeimports/plasmastyle/ProgressBarStyle.qml +++ b/src/declarativeimports/plasmastyle/ProgressBarStyle.qml @@ -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) { diff --git a/src/declarativeimports/plasmastyle/RadioButtonStyle.qml b/src/declarativeimports/plasmastyle/RadioButtonStyle.qml index c7699f700..b6f3a1a51 100644 --- a/src/declarativeimports/plasmastyle/RadioButtonStyle.qml +++ b/src/declarativeimports/plasmastyle/RadioButtonStyle.qml @@ -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 } } diff --git a/src/declarativeimports/plasmastyle/ScrollViewStyle.qml b/src/declarativeimports/plasmastyle/ScrollViewStyle.qml index 4d07c4a95..6a1621001 100644 --- a/src/declarativeimports/plasmastyle/ScrollViewStyle.qml +++ b/src/declarativeimports/plasmastyle/ScrollViewStyle.qml @@ -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" diff --git a/src/declarativeimports/plasmastyle/SelectionHandleStyle.qml b/src/declarativeimports/plasmastyle/SelectionHandleStyle.qml index aedd1d1e9..9d29898e7 100644 --- a/src/declarativeimports/plasmastyle/SelectionHandleStyle.qml +++ b/src/declarativeimports/plasmastyle/SelectionHandleStyle.qml @@ -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 } diff --git a/src/declarativeimports/plasmastyle/StatusBarStyle.qml b/src/declarativeimports/plasmastyle/StatusBarStyle.qml index 257941557..27ea0baa2 100644 --- a/src/declarativeimports/plasmastyle/StatusBarStyle.qml +++ b/src/declarativeimports/plasmastyle/StatusBarStyle.qml @@ -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 } diff --git a/src/declarativeimports/plasmastyle/SwitchStyle.qml b/src/declarativeimports/plasmastyle/SwitchStyle.qml index 01d51e678..88dcdf0ae 100644 --- a/src/declarativeimports/plasmastyle/SwitchStyle.qml +++ b/src/declarativeimports/plasmastyle/SwitchStyle.qml @@ -40,7 +40,7 @@ QtQuickControlStyle.SwitchStyle { opacity: checked ? 1 : 0 Behavior on opacity { - PropertyAnimation { duration: units.shortDuration * 2 } + PropertyAnimation { duration: PlasmaCore.Units.shortDuration * 2 } } } } diff --git a/src/declarativeimports/plasmastyle/TabViewStyle.qml b/src/declarativeimports/plasmastyle/TabViewStyle.qml index 061ce457a..9dc28f09d 100644 --- a/src/declarativeimports/plasmastyle/TabViewStyle.qml +++ b/src/declarativeimports/plasmastyle/TabViewStyle.qml @@ -40,7 +40,7 @@ QtQuickControlStyle.TabViewStyle { colorGroup: PlasmaCore.ColorScope.colorGroup Behavior on opacity { PropertyAnimation { - duration: units.longDuration + duration: PlasmaCore.Units.longDuration } } } diff --git a/src/declarativeimports/plasmastyle/TableViewStyle.qml b/src/declarativeimports/plasmastyle/TableViewStyle.qml index 532b5aac4..04cbcffc6 100644 --- a/src/declarativeimports/plasmastyle/TableViewStyle.qml +++ b/src/declarativeimports/plasmastyle/TableViewStyle.qml @@ -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" diff --git a/src/declarativeimports/plasmastyle/TextAreaStyle.qml b/src/declarativeimports/plasmastyle/TextAreaStyle.qml index b46954ba8..9a379d88a 100644 --- a/src/declarativeimports/plasmastyle/TextAreaStyle.qml +++ b/src/declarativeimports/plasmastyle/TextAreaStyle.qml @@ -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 } } diff --git a/src/declarativeimports/plasmastyle/TextFieldStyle.qml b/src/declarativeimports/plasmastyle/TextFieldStyle.qml index 354a0027e..e3a0658c2 100644 --- a/src/declarativeimports/plasmastyle/TextFieldStyle.qml +++ b/src/declarativeimports/plasmastyle/TextFieldStyle.qml @@ -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); }) } } diff --git a/src/declarativeimports/plasmastyle/ToolButtonStyle.qml b/src/declarativeimports/plasmastyle/ToolButtonStyle.qml index 5810cf394..415be1a1a 100644 --- a/src/declarativeimports/plasmastyle/ToolButtonStyle.qml +++ b/src/declarativeimports/plasmastyle/ToolButtonStyle.qml @@ -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 } } } } diff --git a/src/declarativeimports/plasmastyle/private/ButtonShadow.qml b/src/declarativeimports/plasmastyle/private/ButtonShadow.qml index 54043f0ba..9371ae5db 100644 --- a/src/declarativeimports/plasmastyle/private/ButtonShadow.qml +++ b/src/declarativeimports/plasmastyle/private/ButtonShadow.qml @@ -114,7 +114,7 @@ Item { Transition { PropertyAnimation { properties: "opacity" - duration: units.longDuration + duration: PlasmaCore.Units.longDuration easing.type: Easing.OutQuad } } diff --git a/src/declarativeimports/plasmastyle/private/RoundShadow.qml b/src/declarativeimports/plasmastyle/private/RoundShadow.qml index 69dde3c93..5e637c65f 100644 --- a/src/declarativeimports/plasmastyle/private/RoundShadow.qml +++ b/src/declarativeimports/plasmastyle/private/RoundShadow.qml @@ -113,7 +113,7 @@ Item { Transition { PropertyAnimation { properties: "opacity" - duration: units.veryShortDuration + duration: PlasmaCore.Units.veryShortDuration easing.type: Easing.OutQuad } } diff --git a/src/declarativeimports/plasmastyle/private/TextFieldFocus.qml b/src/declarativeimports/plasmastyle/private/TextFieldFocus.qml index 5fb2ec3f1..2b7faeb75 100644 --- a/src/declarativeimports/plasmastyle/private/TextFieldFocus.qml +++ b/src/declarativeimports/plasmastyle/private/TextFieldFocus.qml @@ -77,7 +77,7 @@ Item { Transition { PropertyAnimation { properties: "opacity" - duration: units.longDuration + duration: PlasmaCore.Units.longDuration easing.type: Easing.OutQuad } } diff --git a/templates/plasma-wallpaper-with-qml-extension/package/contents/ui/config.qml b/templates/plasma-wallpaper-with-qml-extension/package/contents/ui/config.qml index 5d2947e99..2b53d1cbb 100644 --- a/templates/plasma-wallpaper-with-qml-extension/package/contents/ui/config.qml +++ b/templates/plasma-wallpaper-with-qml-extension/package/contents/ui/config.qml @@ -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 diff --git a/templates/plasma-wallpaper/package/contents/ui/config.qml b/templates/plasma-wallpaper/package/contents/ui/config.qml index 5d2947e99..2b53d1cbb 100644 --- a/templates/plasma-wallpaper/package/contents/ui/config.qml +++ b/templates/plasma-wallpaper/package/contents/ui/config.qml @@ -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 diff --git a/tests/colorcontext.qml b/tests/colorcontext.qml index d1b195eaf..2231d669e 100644 --- a/tests/colorcontext.qml +++ b/tests/colorcontext.qml @@ -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 } } diff --git a/tests/dialog_positioning2.qml b/tests/dialog_positioning2.qml index 8ab55d847..52c2c7a09 100644 --- a/tests/dialog_positioning2.qml +++ b/tests/dialog_positioning2.qml @@ -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 diff --git a/tests/dialog_positioning_parentrotated.qml b/tests/dialog_positioning_parentrotated.qml index 9816fa536..365cd57f1 100644 --- a/tests/dialog_positioning_parentrotated.qml +++ b/tests/dialog_positioning_parentrotated.qml @@ -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