From 17fb60f216e3f6979a44144677a7d1d8bb9e9fe4 Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Fri, 6 Jun 2025 22:38:15 +1000 Subject: feat: tray item menus --- modules/bar/Content.qml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'modules/bar/Content.qml') 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); -- cgit v1.2.3-freya