This commit is contained in:
2026-03-02 23:03:39 +02:00
parent f189e304a8
commit d536d75591
11 changed files with 276 additions and 58 deletions

View File

@@ -232,6 +232,15 @@ Item {
manager.closePowerMenu();
}
function resolveTrayIconSource(iconValue) {
const normalized = String(iconValue || "").trim();
if (normalized.length === 0)
return "";
if (normalized.indexOf("/") >= 0 || normalized.indexOf("file://") === 0)
return normalized;
return String(Quickshell.iconPath(normalized, true) || "");
}
function handleKey(key) {
switch (key) {
case Qt.Key_Up:
@@ -343,6 +352,7 @@ Item {
visible: !root.inSubmenu && index >= root.scrollOffset && index < root.scrollOffset + root.visibleRows
property var trayItem: modelData
readonly property string trayIconSource: root.resolveTrayIconSource(trayItem ? trayItem.icon : "")
Text {
x: root.textStartX
@@ -366,7 +376,7 @@ Item {
x: 182
y: 8 + 14
implicitSize: root.iconSize
source: trayItem ? trayItem.icon : ""
source: trayIconSource
asynchronous: true
}