diff options
| author | Leander Scherer <leander@schererleander.de> | 2026-05-18 21:48:24 +0200 |
|---|---|---|
| committer | Leander Scherer <leander@schererleander.de> | 2026-05-28 22:42:07 +0200 |
| commit | 9a7cf1242d296dbdb9c03df48ab09054960295aa (patch) | |
| tree | f1a2d5c77ef6bdb049c995afcc4c663c1ffd1373 /modules/system/quickshell/TrayMenu.qml | |
| parent | 3ef8b4973bcae26445f99467d50ad75730d204b5 (diff) | |
feat(quickshell): basic bar, tray, notification
Diffstat (limited to 'modules/system/quickshell/TrayMenu.qml')
| -rw-r--r-- | modules/system/quickshell/TrayMenu.qml | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/modules/system/quickshell/TrayMenu.qml b/modules/system/quickshell/TrayMenu.qml new file mode 100644 index 0000000..9e2e9f2 --- /dev/null +++ b/modules/system/quickshell/TrayMenu.qml @@ -0,0 +1,39 @@ +import QtQuick +import QtQuick.Layouts +import Quickshell + +Scope { + id: root + property var menuItem: null + property var parentWindow + property var anchorItem + property bool active: false + + function open(item) { + anchorItem = item + active = true + menuAnchor.open() + } + + function close() { + active = false + menuAnchor.close() + } + + QsMenuAnchor { + id: menuAnchor + menu: root.menuItem + + anchor.window: root.parentWindow + anchor.item: root.anchorItem + anchor.edges: Edges.Bottom + anchor.gravity: Edges.Bottom + anchor.margins.top: Theme.popupGap + + onVisibleChanged: { + if (!visible && root.active) { + root.active = false + } + } + } +} |
