From 2387e3473615f388ce7c217ceb9cdffb3bf21cb1 Mon Sep 17 00:00:00 2001 From: Hannes Date: Wed, 25 Feb 2026 18:11:21 +0100 Subject: [PATCH] fixed tray for goxlr-utility and hopefully more icons with extra querry --- modules/bar/widgets/Tray.qml | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/modules/bar/widgets/Tray.qml b/modules/bar/widgets/Tray.qml index c306fad..7bfaf73 100644 --- a/modules/bar/widgets/Tray.qml +++ b/modules/bar/widgets/Tray.qml @@ -81,7 +81,7 @@ Row { // Workspace Row Image { // Image id: iconImage - source: modelData.icon + // source: modelData.icon; Does not work for some tray icons fillMode: Image.PreserveAspectCrop anchors.centerIn: parent @@ -89,6 +89,29 @@ Row { // Workspace Row width: bar.height*0.5 height: bar.height*0.5 + Component.onCompleted: { + // Default to the original icon + let src = modelData.icon; + + // Check if there is a "?" in the URL (custom path) + if (src.includes('?')) { + let pathMatch = src.match(/path=([^&]+)/); + if (pathMatch && pathMatch[1]) { + + let folderPath = pathMatch[1]; + // Build a file:// URL pointing to the actual icon file + let segments = folderPath.split('/'); + let fileName = segments[segments.length - 1] + "-icon.png"; + console.log("########## filename: " + fileName) + src = "file://" + pathMatch[1] + "/" + fileName; + } + } + + // Set the resolved source + iconImage.source = src; + + // console.log("Resolved icon source:", src); + } asynchronous: true cache: true }