fixed tray for goxlr-utility and hopefully more icons with extra querry
This commit is contained in:
@@ -81,7 +81,7 @@ Row { // Workspace Row
|
|||||||
|
|
||||||
Image { // Image
|
Image { // Image
|
||||||
id: iconImage
|
id: iconImage
|
||||||
source: modelData.icon
|
// source: modelData.icon; Does not work for some tray icons
|
||||||
fillMode: Image.PreserveAspectCrop
|
fillMode: Image.PreserveAspectCrop
|
||||||
|
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
@@ -89,6 +89,29 @@ Row { // Workspace Row
|
|||||||
width: bar.height*0.5
|
width: bar.height*0.5
|
||||||
height: 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
|
asynchronous: true
|
||||||
cache: true
|
cache: true
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user