diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-06-06 22:38:15 +1000 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-06-06 22:38:15 +1000 |
| commit | 17fb60f216e3f6979a44144677a7d1d8bb9e9fe4 (patch) | |
| tree | ca79775a5cc31d58ae2f024dc5c905b0c86adc89 /modules/bar/Content.qml | |
| parent | popouts: transition between popout content (diff) | |
| download | caelestia-shell-17fb60f216e3f6979a44144677a7d1d8bb9e9fe4.tar.gz caelestia-shell-17fb60f216e3f6979a44144677a7d1d8bb9e9fe4.tar.bz2 caelestia-shell-17fb60f216e3f6979a44144677a7d1d8bb9e9fe4.zip | |
feat: tray item menus
Diffstat (limited to 'modules/bar/Content.qml')
| -rw-r--r-- | modules/bar/Content.qml | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/modules/bar/Content.qml b/modules/bar/Content.qml index ebd19cc..54879fa 100644 --- a/modules/bar/Content.qml +++ b/modules/bar/Content.qml @@ -15,16 +15,31 @@ StyledRect { const spacing = Appearance.spacing.small; const aw = activeWindow.child; const awy = activeWindow.y + aw.y; + + const ty = tray.y; + const th = tray.implicitHeight; + const trayItems = tray.items; + const n = statusIconsInner.network; const ny = statusIcons.y + statusIconsInner.y + n.y - spacing / 2; + const bls = statusIcons.y + statusIconsInner.y + statusIconsInner.bs - spacing / 2; const ble = statusIcons.y + statusIconsInner.y + statusIconsInner.be + spacing / 2; + const b = statusIconsInner.battery; const by = statusIcons.y + statusIconsInner.y + b.y - spacing / 2; + if (y >= awy && y <= awy + aw.implicitHeight) { Popouts.currentName = "activewindow"; Popouts.currentCenter = Qt.binding(() => activeWindow.y + aw.y + aw.implicitHeight / 2); Popouts.hasCurrent = true; + } else if (y > ty && y < ty + th) { + const index = Math.floor(((y - ty) / th) * trayItems.count); + const item = trayItems.itemAt(index); + + Popouts.currentName = `traymenu${index}`; + Popouts.currentCenter = Qt.binding(() => tray.y + item.y + item.implicitHeight / 2); + Popouts.hasCurrent = true; } else if (y >= ny && y <= ny + n.implicitHeight + spacing) { Popouts.currentName = "network"; Popouts.currentCenter = Qt.binding(() => statusIcons.y + statusIconsInner.y + n.y + n.implicitHeight / 2); |