Stop systemd-run option injection, open Syncthing folders only via a store-pinned real-directory helper, treat labels as PlainText, and allowlist image URLs.
50 lines
1.5 KiB
QML
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: Fmt.imageUrl(modelData.icon)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|