nix/nixos/desktop/quickshell/widgets/Tray.qml
Markus Zoppelt 288f844ccf feat: network, tailscale, syncthing, and richer sysinfo
fix: open Tailscale and Syncthing panels on any click
2026-08-22 17:00:50 +02:00

50 lines
1.5 KiB
QML

import QtQuick
import Quickshell.Services.SystemTray
import ".."
Row {
spacing: 4
Repeater {
model: SystemTray.items
MouseArea {
required property var modelData
implicitWidth: Theme.iconSize + 8
implicitHeight: Theme.barHeight - 8
acceptedButtons: Qt.LeftButton | Qt.RightButton
cursorShape: Qt.PointingHandCursor
hoverEnabled: true
onClicked: event => {
if (modelData.hasMenu)
TrayMenu.open(modelData, this);
else if (event.button === Qt.LeftButton)
modelData.activate();
}
onEntered: {
const t = [modelData.tooltipTitle, modelData.tooltipDescription].filter(Boolean).join("\n");
if (t)
Tooltip.show(this, t);
}
onExited: Tooltip.hide()
Item {
anchors.centerIn: parent
width: Theme.iconSize
height: Theme.iconSize
clip: true
Image {
anchors.fill: parent
sourceSize.width: Theme.iconSize
sourceSize.height: Theme.iconSize
fillMode: Image.PreserveAspectFit
smooth: true
mipmap: true
cache: false
source: modelData.icon
}
}
}
}
}