mirror of
https://github.com/kossLAN/dots.git
synced 2025-11-05 06:59:50 -05:00
progress save
This commit is contained in:
parent
fa7d012416
commit
d32bedda31
9 changed files with 293 additions and 249 deletions
62
shell/bar/systray/TrayMenuLauncher.qml
Normal file
62
shell/bar/systray/TrayMenuLauncher.qml
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
pragma ComponentBehavior: Bound
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import Quickshell
|
||||
import Quickshell.Widgets
|
||||
import Quickshell.Services.SystemTray
|
||||
import ".."
|
||||
|
||||
PopupItem {
|
||||
id: root
|
||||
onClicked: {
|
||||
menuOpener.menu = trayItem.menu;
|
||||
popup.set(menu);
|
||||
}
|
||||
|
||||
required property PopupHandler popup
|
||||
required property SystemTrayItem trayItem
|
||||
|
||||
menu: ColumnLayout {
|
||||
id: trayMenu
|
||||
spacing: 2
|
||||
// visible: false
|
||||
|
||||
property var leftItem: false
|
||||
property var rightItem: false
|
||||
|
||||
Repeater {
|
||||
model: menuOpener.children
|
||||
|
||||
delegate: TrayMenuItem {
|
||||
id: sysTrayContent
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
|
||||
rootMenu: trayMenu
|
||||
|
||||
onInteracted: {
|
||||
menuOpener.menu = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
QsMenuOpener {
|
||||
id: menuOpener
|
||||
}
|
||||
|
||||
IconImage {
|
||||
id: trayIcon
|
||||
anchors.fill: parent
|
||||
source: {
|
||||
// console.log(trayField.modelData.id);
|
||||
switch (root.trayItem.id) {
|
||||
case "obs":
|
||||
return "image://icon/obs-tray";
|
||||
default:
|
||||
return root.trayItem.icon;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue