diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-04-29 19:57:07 +1000 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-04-29 19:57:07 +1000 |
| commit | ae878e390fef99c6e7867b97fced78567e058ad0 (patch) | |
| tree | 15bf235fa19c9ed0aaf121c064d3215cb8db9506 /modules/bar/components | |
| parent | feat: bar bluetooth devices (diff) | |
| download | caelestia-shell-ae878e390fef99c6e7867b97fced78567e058ad0.tar.gz caelestia-shell-ae878e390fef99c6e7867b97fced78567e058ad0.tar.bz2 caelestia-shell-ae878e390fef99c6e7867b97fced78567e058ad0.zip | |
feat: bar system tray
Diffstat (limited to 'modules/bar/components')
| -rw-r--r-- | modules/bar/components/Tray.qml | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/modules/bar/components/Tray.qml b/modules/bar/components/Tray.qml new file mode 100644 index 0000000..08b638d --- /dev/null +++ b/modules/bar/components/Tray.qml @@ -0,0 +1,54 @@ +import "root:/widgets" +import "root:/services" +import "root:/config" +import Quickshell +import Quickshell.Widgets +import Quickshell.Services.SystemTray +import QtQuick +import Qt5Compat.GraphicalEffects + +BoxLayout { + id: root + + Repeater { + model: SystemTray.items + + MouseArea { + id: item + + required property SystemTrayItem modelData + + acceptedButtons: Qt.LeftButton | Qt.RightButton + width: Math.round(Appearance.font.size.large * 1.2) + height: Math.round(Appearance.font.size.large * 1.2) + + onClicked: event => { + if (event.button === Qt.LeftButton) + modelData.activate(); + else if (modelData.hasMenu) + menu.open(); + } + + QsMenuAnchor { + id: menu + + menu: item.modelData.menu + anchor.window: QsWindow.window + } + + IconImage { + id: icon + + visible: false + source: item.modelData.icon + anchors.fill: parent + } + + ColorOverlay { + anchors.fill: icon + source: icon + color: Appearance.colours.lavender + } + } + } +} |