Commit fabfea4c authored by Nate Graham's avatar Nate Graham 🔩
Browse files

[applet] Port mostly to PlasmaComponents3

Tested; no regressions. The new remaining things that still need PC2 are
now labeled with the reason in the import line so you can easily see by
doing a `grep org.kde.plasma.components 2.0` in the repo.
parent aaa685e2
......@@ -20,7 +20,7 @@
import QtQuick 2.2
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as PlasmaComponents
import org.kde.plasma.components 3.0 as PlasmaComponents3
MouseArea {
id: panelIconWidget
......@@ -38,10 +38,10 @@ MouseArea {
colorGroup: PlasmaCore.ColorScope.colorGroup
active: parent.containsMouse
PlasmaComponents.BusyIndicator {
PlasmaComponents3.BusyIndicator {
id: connectingIndicator
anchors.fill: parent
anchors.centerIn: parent
running: connectionIconProvider.connecting
visible: running
}
......
......@@ -27,7 +27,7 @@ import org.kde.kcoreaddons 1.0 as KCoreAddons
import org.kde.kquickcontrolsaddons 2.0
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as PlasmaComponents
import org.kde.plasma.components 2.0 as PlasmaComponents // for ContextMenu+MenuItem/TabBar+TabButton
import org.kde.plasma.extras 2.0 as PlasmaExtras
import org.kde.plasma.networkmanagement 0.2 as PlasmaNM
......
......@@ -20,7 +20,8 @@
import QtQuick 2.2
import org.kde.kquickcontrolsaddons 2.0 as KQuickControlsAddons
import org.kde.plasma.components 2.0 as PlasmaComponents
import org.kde.plasma.components 2.0 as PlasmaComponents // for ContextMenu+MenuItem
import org.kde.plasma.components 3.0 as PlasmaComponents3
Column {
property var details: []
......@@ -62,14 +63,13 @@ Column {
}
height: Math.max(detailNameLabel.height, detailValueLabel.height)
PlasmaComponents.Label {
PlasmaComponents3.Label {
id: detailNameLabel
anchors {
left: parent.left
leftMargin: repeater.longestString - paintedWidth + Math.round(units.gridUnit / 2)
}
height: paintedHeight
font.pointSize: theme.smallestFont.pointSize
horizontalAlignment: Text.AlignRight
text: details[index*2] + ": "
......@@ -82,7 +82,7 @@ Column {
}
}
PlasmaComponents.Label {
PlasmaComponents3.Label {
id: detailValueLabel
anchors {
......@@ -90,7 +90,6 @@ Column {
right: parent.right
leftMargin: repeater.longestString + Math.round(units.gridUnit / 2)
}
height: paintedHeight
elide: Text.ElideRight
font.pointSize: theme.smallestFont.pointSize
text: details[(index*2)+1]
......
......@@ -19,10 +19,10 @@
*/
import QtQuick 2.2
import org.kde.plasma.components 2.0 as PlasmaComponents
import org.kde.plasma.components 3.0 as PlasmaComponents3
import org.kde.plasma.networkmanagement 0.2 as PlasmaNM
PlasmaComponents.TextField {
PlasmaComponents3.TextField {
property int securityType
echoMode: TextInput.Password
......
......@@ -20,7 +20,7 @@
import QtQuick 2.2
import QtQuick.Layouts 1.2
import org.kde.plasma.components 2.0 as PlasmaComponents
import org.kde.plasma.components 2.0 as PlasmaComponents // for Highlight
import org.kde.plasma.components 3.0 as PlasmaComponents3
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.extras 2.0 as PlasmaExtras
......
......@@ -19,7 +19,7 @@
*/
import QtQuick 2.2
import org.kde.plasma.components 2.0 as PlasmaComponents
import org.kde.plasma.components 3.0 as PlasmaComponents3
import org.kde.plasma.core 2.0 as PlasmaCore
Item {
......@@ -28,14 +28,14 @@ Item {
property alias icon: switchButtonIcon.source
property alias checked: switchButtonCheckbox.checked
property alias enabled: switchButtonCheckbox.enabled
property alias tooltip: switchButtonCheckbox.tooltip
property alias tooltip: itemTooltip.text
signal clicked
height: Math.max(switchButtonCheckbox.height, switchButtonIcon.height)
width: switchButtonCheckbox.width + switchButtonIcon.width + units.smallSpacing * 3
PlasmaComponents.CheckBox {
PlasmaComponents3.CheckBox {
id: switchButtonCheckbox
anchors {
left: parent.left
......@@ -58,4 +58,8 @@ Item {
width: units.iconSizes.smallMedium
height: units.iconSizes.smallMedium
}
PlasmaComponents3.ToolTip {
id: itemTooltip
}
}
......@@ -20,7 +20,6 @@
import QtQuick 2.2
import QtQuick.Layouts 1.2
import org.kde.plasma.components 2.0 as PlasmaComponents
import org.kde.plasma.components 3.0 as PlasmaComponents3
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.networkmanagement 0.2 as PlasmaNM
......@@ -216,7 +215,7 @@ ColumnLayout {
}
}
PlasmaComponents.TextField {
PlasmaComponents3.TextField {
id: searchTextField
Layout.fillWidth: true
......
......@@ -21,7 +21,7 @@
import QtQuick 2.4
import org.kde.kcoreaddons 1.0 as KCoreAddons
import org.kde.kquickcontrolsaddons 2.0 as KQuickControlsAddons
import org.kde.plasma.components 2.0 as PlasmaComponents
import org.kde.plasma.components 3.0 as PlasmaComponents3
Item {
property real rxBytes: 0
......@@ -35,15 +35,13 @@ Item {
model: 6
readonly property int labelHeight: theme.mSize(theme.smallestFont).height
PlasmaComponents.Label {
PlasmaComponents3.Label {
anchors {
right: plotter.left
top: parent.top
rightMargin: units.smallSpacing
topMargin: Math.round(index * plotter.height / 5)
}
// Workaround to get paintedHeight. (Undefined or paintedheight does not work.)
height: labels.labelHeight
font.pointSize: theme.smallestFont.pointSize
lineHeight: 1.75
text: KCoreAddons.Format.formatByteSize(plotter.maxValue * (1 - index / 5)) + i18n("/s")
......
......@@ -21,7 +21,7 @@
import QtQuick 2.1
import QtQuick.Controls 1.4 as QQC
import org.kde.kquickcontrolsaddons 2.0 as KQuickControlsAddons
import org.kde.plasma.components 2.0 as PlasmaComponents
import org.kde.plasma.components 3.0 as PlasmaComponents3
import org.kde.plasma.networkmanagement 0.2 as PlasmaNM
ListItem {
......@@ -91,7 +91,7 @@ ListItem {
text: itemText()
}
PlasmaComponents.BusyIndicator {
PlasmaComponents3.BusyIndicator {
id: connectingIndicator
anchors {
......
......@@ -19,7 +19,6 @@
*/
import QtQuick 2.2
import org.kde.plasma.components 2.0 as PlasmaComponents
ListItem {
id: header
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment