Commit c196e18e 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 1da5715c
......@@ -22,7 +22,7 @@ import QtQuick 2.2
import QtQuick.Layouts 1.1
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 {
readonly property bool inPanel: (plasmoid.location == PlasmaCore.Types.TopEdge
......@@ -43,9 +43,9 @@ MouseArea {
source: plasmoid.icon
active: parent.containsMouse
PlasmaComponents.BusyIndicator {
PlasmaComponents3.BusyIndicator {
id: busyIndicator
anchors.fill: parent
anchors.centerIn: parent
running: runningActions > 0
visible: running
}
......
......@@ -26,7 +26,8 @@ import QtQuick.Layouts 1.3
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
import org.kde.plasma.components 2.0 as PlasmaComponents // for ContextMenu/MenuItem
import org.kde.plasma.components 3.0 as PlasmaComponents3
import org.kde.plasma.private.bluetooth 1.0 as PlasmaBt
import org.kde.bluezqt 1.0 as BluezQt
......@@ -76,10 +77,10 @@ PlasmaExtras.ExpandableListItem {
Layout.rowSpan: 2
}
PlasmaComponents.ToolButton {
PlasmaComponents3.ToolButton {
id: browseFilesButton
text: i18n("Browse Files")
iconSource: "folder"
icon.name: "folder"
visible: Uuids.indexOf(BluezQt.Services.ObexFileTransfer) != -1
onClicked: {
......@@ -88,10 +89,10 @@ PlasmaExtras.ExpandableListItem {
}
}
PlasmaComponents.ToolButton {
PlasmaComponents3.ToolButton {
id: sendFileButton
text: i18n("Send File")
iconSource: "folder-download"
icon.name: "folder-download"
visible: Uuids.indexOf(BluezQt.Services.ObexObjectPush) != -1
onClicked: {
......@@ -172,7 +173,7 @@ PlasmaExtras.ExpandableListItem {
model: currentDeviceDetails.length
PlasmaComponents.Label {
PlasmaComponents3.Label {
id: detailLabel
Layout.fillWidth: true
horizontalAlignment: index % 2 ? Text.AlignLeft : Text.AlignRight
......
......@@ -23,7 +23,7 @@ import QtQuick 2.4
import QtQuick.Controls 2.4
import org.kde.bluezqt 1.0 as BluezQt
import org.kde.plasma.extras 2.0 as PlasmaExtras
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.private.bluetooth 1.0 as PlasmaBt
......
......@@ -20,7 +20,8 @@
*/
import QtQuick 2.2
import org.kde.plasma.components 2.0 as PlasmaComponents
import org.kde.plasma.components 2.0 as PlasmaComponents // for ListItem
import org.kde.plasma.components 3.0 as PlasmaComponents3
PlasmaComponents.ListItem {
id: header
......@@ -35,10 +36,9 @@ PlasmaComponents.ListItem {
height: headerLabel.height + units.gridUnit
sectionDelegate: true
PlasmaComponents.Label {
PlasmaComponents3.Label {
id: headerLabel
anchors.centerIn: parent
height: paintedHeight
font.weight: Font.DemiBold
elide: Text.ElideRight
}
......
......@@ -21,14 +21,14 @@
import QtQuick 2.2
import QtQuick.Layouts 1.1
import org.kde.bluezqt 1.0 as BluezQt
import org.kde.plasma.components 2.0 as PlasmaComponents
import org.kde.plasma.components 3.0 as PlasmaComponents3
ColumnLayout {
id: mediaPlayer
spacing: 0
PlasmaComponents.Label {
PlasmaComponents3.Label {
id: trackTitleLabel
Layout.fillWidth: true
elide: Text.ElideRight
......@@ -41,7 +41,7 @@ ColumnLayout {
visible: text.length
}
PlasmaComponents.Label {
PlasmaComponents3.Label {
id: trackArtistLabel
Layout.fillWidth: true
elide: Text.ElideRight
......@@ -52,7 +52,7 @@ ColumnLayout {
visible: text.length
}
PlasmaComponents.Label {
PlasmaComponents3.Label {
id: trackAlbumLabel
Layout.fillWidth: true
elide: Text.ElideRight
......@@ -66,31 +66,31 @@ ColumnLayout {
RowLayout {
spacing: 0
PlasmaComponents.ToolButton {
PlasmaComponents3.ToolButton {
id: previousButton
iconSource: "media-skip-backward"
icon.name: "media-skip-backward"
onClicked: MediaPlayer.previous()
}
PlasmaComponents.ToolButton {
PlasmaComponents3.ToolButton {
id: playPauseButton
iconSource: playPauseButtonIcon()
icon.name: playPauseButtonIcon()
onClicked: playPauseButtonClicked()
}
PlasmaComponents.ToolButton {
PlasmaComponents3.ToolButton {
id: stopButton
iconSource: "media-playback-stop"
icon.name: "media-playback-stop"
enabled: MediaPlayer && MediaPlayer.status != BluezQt.MediaPlayer.Stopped
onClicked: MediaPlayer.stop()
}
PlasmaComponents.ToolButton {
PlasmaComponents3.ToolButton {
id: nextButton
iconSource: "media-skip-forward"
icon.name: "media-skip-forward"
onClicked: MediaPlayer.next()
}
......
......@@ -21,7 +21,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
Item {
id: switchButton
......@@ -29,14 +29,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: switchButtonCheckbox.height + Math.round(units.gridUnit / 2)
width: switchButtonCheckbox.width + switchButtonIcon.width + units.gridUnit
PlasmaComponents.CheckBox {
PlasmaComponents3.CheckBox {
id: switchButtonCheckbox
anchors {
......@@ -53,6 +53,10 @@ Item {
}
}
}
PlasmaComponents3.ToolTip {
id: itemTooltip
}
}
PlasmaCore.IconItem {
......
......@@ -20,62 +20,59 @@
*/
import QtQuick 2.2
import QtQuick.Layouts 1.2
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 3.0 as PlasmaComponents3
import org.kde.plasma.extras 2.0 as PlasmaExtras
import org.kde.plasma.private.bluetooth 1.0 as PlasmaBt
PlasmaExtras.PlasmoidHeading {
id: toolbar
height: btSwitchButton.height
RowLayout {
anchors.fill: parent
spacing: units.smallSpacing
SwitchButton {
id: btSwitchButton
SwitchButton {
checked: btManager.bluetoothOperational
enabled: btManager.bluetoothBlocked || btManager.adapters.length
icon: "preferences-system-bluetooth"
tooltip: i18n("Enable Bluetooth")
anchors {
left: parent.left
verticalCenter: parent.verticalCenter
onClicked: toggleBluetooth()
}
checked: btManager.bluetoothOperational
enabled: btManager.bluetoothBlocked || btManager.adapters.length
icon: "preferences-system-bluetooth"
tooltip: i18n("Enable Bluetooth")
onClicked: toggleBluetooth()
}
Row {
id: rightButtons
spacing: units.smallSpacing
anchors {
right: parent.right
verticalCenter: parent.verticalCenter
Item {
Layout.fillWidth: true
}
PlasmaComponents.ToolButton {
PlasmaComponents3.ToolButton {
id: addDeviceButton
iconSource: "list-add"
tooltip: i18n("Add New Device...")
icon.name: "list-add"
onClicked: {
PlasmaBt.LaunchApp.runCommand("bluedevil-wizard");
}
PlasmaComponents3.ToolTip {
text: i18n("Add New Device...")
}
}
PlasmaComponents.ToolButton {
PlasmaComponents3.ToolButton {
id: openSettingsButton
iconSource: "configure"
tooltip: i18n("Configure Bluetooth...")
icon.name: "configure"
onClicked: {
KCMShell.open(["bluedevildevices", "bluedeviladapters", "bluedevilglobal"]);
}
PlasmaComponents3.ToolTip {
text: i18n("Configure Bluetooth...")
}
}
}
......
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