Commit 84b2076c authored by Nate Graham's avatar Nate Graham
Browse files

[applet] Port to singleton Units and Theme

This is for Qt 6 compatibility and also improves speed a bit to use the
singletons instead of the deprecated context properties.
parent 27991b56
......@@ -23,8 +23,8 @@ Item {
Plasmoid.toolTipMainText: i18n("Bluetooth")
Plasmoid.icon: Logic.icon()
Plasmoid.switchWidth: units.gridUnit * 15
Plasmoid.switchHeight: units.gridUnit * 10
Plasmoid.switchWidth: PlasmaCore.Units.gridUnit * 15
Plasmoid.switchHeight: PlasmaCore.Units.gridUnit * 10
Plasmoid.compactRepresentation: CompactRepresentation { }
Plasmoid.fullRepresentation: FullRepresentation { }
......
......@@ -16,8 +16,8 @@ MouseArea {
|| plasmoid.location == PlasmaCore.Types.BottomEdge
|| plasmoid.location == PlasmaCore.Types.LeftEdge)
Layout.maximumWidth: inPanel ? units.iconSizeHints.panel : -1
Layout.maximumHeight: inPanel ? units.iconSizeHints.panel : -1
Layout.maximumWidth: inPanel ? PlasmaCore.Units.iconSizeHints.panel : -1
Layout.maximumHeight: inPanel ? PlasmaCore.Units.iconSizeHints.panel : -1
onClicked: plasmoid.expanded = !plasmoid.expanded
......
......@@ -57,7 +57,7 @@ PlasmaExtras.ExpandableListItem {
rowSpacing: 0
Item {
width: units.iconSizes.medium
width: PlasmaCore.Units.iconSizes.medium
Layout.rowSpan: 2
}
......@@ -95,13 +95,13 @@ PlasmaExtras.ExpandableListItem {
}
Item {
height: units.smallSpacing
height: PlasmaCore.Units.smallSpacing
}
// Media Player
RowLayout {
Item {
width: units.iconSizes.medium
width: PlasmaCore.Units.iconSizes.medium
}
MediaPlayerItem {
......@@ -121,7 +121,7 @@ PlasmaExtras.ExpandableListItem {
}
Item {
height: units.smallSpacing
height: PlasmaCore.Units.smallSpacing
visible: mediaPlayerSeparator.visible
}
......@@ -150,7 +150,7 @@ PlasmaExtras.ExpandableListItem {
// Details
GridLayout {
columns: 2
rowSpacing: units.smallSpacing / 4
rowSpacing: PlasmaCore.Units.smallSpacing / 4
Repeater {
id: repeater
......@@ -162,7 +162,7 @@ PlasmaExtras.ExpandableListItem {
Layout.fillWidth: true
horizontalAlignment: index % 2 ? Text.AlignLeft : Text.AlignRight
elide: index % 2 ? Text.ElideRight : Text.ElideNone
font.pointSize: theme.smallestFont.pointSize
font.pointSize: PlasmaCore.Theme.smallestFont.pointSize
text: index % 2 ? currentDeviceDetails[index] : currentDeviceDetails[index] + ":"
textFormat: index % 2 ? Text.PlainText : Text.StyledText
......
......@@ -8,6 +8,7 @@
import QtQuick 2.4
import QtQuick.Controls 2.4
import org.kde.bluezqt 1.0 as BluezQt
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.extras 2.0 as PlasmaExtras
import org.kde.plasma.components 2.0 as PlasmaComponents // for Highlight
import org.kde.plasma.components 3.0 as PlasmaComponents3
......@@ -74,8 +75,8 @@ PlasmaComponents3.Page {
text: section == "Connected" ? i18n("Connected devices") : i18n("Available devices")
}
highlight: PlasmaComponents.Highlight { }
highlightMoveDuration: units.longDuration
highlightResizeDuration: units.longDuration
highlightMoveDuration: PlasmaCore.Units.longDuration
highlightResizeDuration: PlasmaCore.Units.longDuration
delegate: DeviceItem {
width: listView.width
}
......@@ -89,7 +90,7 @@ PlasmaComponents3.Page {
anchors.centerIn: parent
anchors.left: parent.left
anchors.right: parent.right
anchors.margins: units.largeSpacing
anchors.margins: PlasmaCore.Units.largeSpacing
visible: text.length > 0
......
......@@ -6,6 +6,7 @@
*/
import QtQuick 2.2
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as PlasmaComponents // for ListItem
import org.kde.plasma.components 3.0 as PlasmaComponents3
......@@ -19,7 +20,7 @@ PlasmaComponents.ListItem {
right: parent.right
}
height: headerLabel.height + units.gridUnit
height: headerLabel.height + PlasmaCore.Units.gridUnit
sectionDelegate: true
PlasmaComponents3.Label {
......
......@@ -7,6 +7,7 @@
import QtQuick 2.2
import QtQuick.Layouts 1.1
import org.kde.bluezqt 1.0 as BluezQt
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 3.0 as PlasmaComponents3
ColumnLayout {
......@@ -20,7 +21,7 @@ ColumnLayout {
elide: Text.ElideRight
font.weight: MediaPlayer && MediaPlayer.track.title ? Font.DemiBold : Font.Normal
font.italic: MediaPlayer && MediaPlayer.status == BluezQt.MediaPlayer.Playing
font.pointSize: theme.smallestFont.pointSize
font.pointSize: PlasmaCore.Theme.smallestFont.pointSize
opacity: 0.6
text: trackTitleText()
textFormat: Text.PlainText
......@@ -31,7 +32,7 @@ ColumnLayout {
id: trackArtistLabel
Layout.fillWidth: true
elide: Text.ElideRight
font.pointSize: theme.smallestFont.pointSize
font.pointSize: PlasmaCore.Theme.smallestFont.pointSize
opacity: 0.6
text: MediaPlayer ? MediaPlayer.track.artist : ""
textFormat: Text.PlainText
......@@ -42,7 +43,7 @@ ColumnLayout {
id: trackAlbumLabel
Layout.fillWidth: true
elide: Text.ElideRight
font.pointSize: theme.smallestFont.pointSize
font.pointSize: PlasmaCore.Theme.smallestFont.pointSize
opacity: 0.6
text: MediaPlayer ? MediaPlayer.track.album : ""
textFormat: Text.PlainText
......
......@@ -18,7 +18,7 @@ PlasmaExtras.PlasmoidHeading {
RowLayout {
anchors.fill: parent
spacing: units.smallSpacing
spacing: PlasmaCore.Units.smallSpacing
PlasmaComponents3.CheckBox {
checked: btManager.bluetoothOperational
......
Supports Markdown
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