[Plasmoid]Make device menu use PC ContextMenu

Summary:
Change the three dotted menu to use PlasmaComponents ContextMenu.
This prevents menu from staying open on other system tray's applets.
Wayland still has that issue, happens in other menus too.
BUG: 415142

And change menu icon into a hamburger menu.

Test Plan:
Before:
Open the menu, and then open an other applet. Menu will stay open on
the left. Even if change windows and open the system tray, will still
be there.
After:
Use X11. By clicking, for example volume applet, menu will minimize.
Will need to click again to open the applet.
This commit is contained in:
George Vogiatzis 2020-02-11 11:12:12 +02:00
parent 9d6db94f7d
commit 875cf16a40

View file

@ -88,18 +88,17 @@ PlasmaComponents.ListItem
PlasmaComponents3.ToolButton {
id: overflowMenu
Layout.alignment: Qt.AlignRight
icon.name: "overflow-menu"
Layout.maximumHeight: deviceName.height * 2
icon.name: "application-menu"
onClicked: {
menu.popup(overflowMenu, 0, overflowMenu.height)
menu.open(overflowMenu, overflowMenu.height)
}
Menu {
PlasmaComponents.ContextMenu {
id: menu
//Share
MenuItem
PlasmaComponents.MenuItem
{
FileDialog {
id: fileDialog
@ -109,7 +108,7 @@ PlasmaComponents.ListItem
}
id: shareFile
icon.name: "document-share"
icon: "document-share"
visible: share.available
text: i18n("Share file")
onClicked: {
@ -121,7 +120,7 @@ PlasmaComponents.ListItem
}
//Find my phone
MenuItem
PlasmaComponents.MenuItem
{
FindMyPhone {
id: findmyphone
@ -129,7 +128,7 @@ PlasmaComponents.ListItem
}
id: ring
icon.name: "irc-voice"
icon: "irc-voice"
visible: findmyphone.available
text: i18n("Ring my phone")
@ -139,7 +138,7 @@ PlasmaComponents.ListItem
}
//SFTP
MenuItem
PlasmaComponents.MenuItem
{
Sftp {
id: sftp
@ -147,7 +146,7 @@ PlasmaComponents.ListItem
}
id: browse
icon.name: "document-open-folder"
icon: "document-open-folder"
visible: sftp.available
text: i18n("Browse this device")
@ -157,14 +156,14 @@ PlasmaComponents.ListItem
}
//SMS
MenuItem
PlasmaComponents.MenuItem
{
SMS {
id: sms
device: root.device
}
icon.name: "message-new"
icon: "message-new"
visible: sms.available
text: i18n("SMS Messages")