Commit 36bcade7 authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧

plasmoid: move plasmoid buttons into a menu

This way we get to see what they do together with the icon.
Removes some visual clutter as well.

Reviewed by Albert Vaca
parent 8a919a80
Pipeline #8874 passed with stage
in 8 minutes and 56 seconds
......@@ -72,95 +72,108 @@ PlasmaComponents.ListItem
RowLayout
{
width: parent.width
Battery {
id: battery
device: root.device
}
PlasmaComponents.Label {
id: deviceName
elide: Text.ElideRight
text: (battery.available && battery.charge > -1) ? i18n("%1 (%2)", display, battery.displayString) : display
Layout.fillWidth: true
textFormat: Text.PlainText
}
//Share
PlasmaComponents.Button
{
FileDialog {
id: fileDialog
title: i18n("Please choose a file")
folder: shortcuts.home
selectMultiple: true
}
id: shareFile
iconSource: "document-share"
visible: share.available
tooltip: i18n("Share file")
PlasmaComponents3.ToolButton {
id: overflowMenu
Layout.alignment: Qt.AlignRight
icon.name: "overflow-menu"
Layout.maximumHeight: deviceName.height * 2
onClicked: {
fileDialog.open()
fileDialog.fileUrls.forEach(function (url) {
share.plugin.shareUrl(url)
})
menu.popup(overflowMenu, 0, overflowMenu.height)
}
}
//Find my phone
PlasmaComponents.Button
{
FindMyPhone {
id: findmyphone
device: root.device
}
Menu {
id: menu
//Share
MenuItem
{
FileDialog {
id: fileDialog
title: i18n("Please choose a file")
folder: shortcuts.home
selectMultiple: true
}
id: ring
iconSource: "irc-voice"
visible: findmyphone.available
tooltip: i18n("Ring my phone")
id: shareFile
icon.name: "document-share"
visible: share.available
text: i18n("Share file")
onClicked: {
fileDialog.open()
fileDialog.fileUrls.forEach(function (url) {
share.plugin.shareUrl(url)
})
}
}
onClicked: {
findmyphone.ring()
}
}
//Find my phone
MenuItem
{
FindMyPhone {
id: findmyphone
device: root.device
}
//SFTP
PlasmaComponents.Button
{
Sftp {
id: sftp
device: root.device
}
id: ring
icon.name: "irc-voice"
visible: findmyphone.available
text: i18n("Ring my phone")
id: browse
iconSource: "document-open-folder"
visible: sftp.available
tooltip: i18n("Browse this device")
onClicked: {
findmyphone.ring()
}
}
onClicked: {
sftp.browse()
}
}
//SFTP
MenuItem
{
Sftp {
id: sftp
device: root.device
}
//SMS
PlasmaComponents.Button
{
SMS {
id: sms
device: root.device
}
id: browse
icon.name: "document-open-folder"
visible: sftp.available
text: i18n("Browse this device")
iconSource: "message-new"
visible: sms.available
tooltip: i18n("SMS Messages")
onClicked: {
sftp.browse()
}
}
onClicked: {
sms.plugin.launchApp()
//SMS
MenuItem
{
SMS {
id: sms
device: root.device
}
icon.name: "message-new"
visible: sms.available
text: i18n("SMS Messages")
onClicked: {
sms.plugin.launchApp()
}
}
}
}
height: browse.height
width: parent.width
}
//RemoteKeyboard
......
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