quickshell: debug app icons with IconImage + logging

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
rope 2026-05-27 09:36:07 +01:00
parent d5a3d1e389
commit 319314c194

View file

@ -1500,11 +1500,14 @@ in
objects: [modelData] objects: [modelData]
} }
property string appIconPath: { property string appIconName: modelData.properties["application.icon-name"] || ""
let icon = modelData.properties["application.icon-name"] || "";
if (icon === "") icon = (modelData.properties["application.name"] || modelData.name || "").toLowerCase(); Component.onCompleted: {
if (icon === "") return ""; let props = modelData.properties;
return Quickshell.iconPath(icon, true) || ""; console.log("Stream:", modelData.name,
"icon-name:", props["application.icon-name"],
"app-name:", props["application.name"],
"iconPath:", appIconName !== "" ? Quickshell.iconPath(appIconName) : "none");
} }
Row { Row {
@ -1515,15 +1518,13 @@ in
width: 14 width: 14
height: 14 height: 14
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
visible: appIconPath !== "" visible: appIconName !== ""
Image { IconImage {
id: appStreamIcon id: appStreamIcon
anchors.fill: parent anchors.fill: parent
source: appIconPath implicitSize: 14
sourceSize.width: 14 icon: appIconName
sourceSize.height: 14
smooth: true
visible: false visible: false
} }
ColorOverlay { ColorOverlay {
@ -1539,7 +1540,7 @@ in
font.family: "FiraMono Nerd Font" font.family: "FiraMono Nerd Font"
font.pixelSize: 11 font.pixelSize: 11
elide: Text.ElideRight elide: Text.ElideRight
width: parent.width - (appIconPath !== "" ? 20 : 0) width: parent.width - (appIconName !== "" ? 20 : 0)
} }
} }