quickshell: use Quickshell.iconPath for app stream icons

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
rope 2026-05-27 09:34:15 +01:00
parent 9e636e92d5
commit d5a3d1e389

View file

@ -1500,11 +1500,11 @@ in
objects: [modelData] objects: [modelData]
} }
property string appIcon: { property string appIconPath: {
let icon = modelData.properties["application.icon-name"] || ""; let icon = modelData.properties["application.icon-name"] || "";
if (icon !== "") return icon; if (icon === "") icon = (modelData.properties["application.name"] || modelData.name || "").toLowerCase();
let name = (modelData.properties["application.name"] || modelData.name || "").toLowerCase(); if (icon === "") return "";
return name; return Quickshell.iconPath(icon, true) || "";
} }
Row { Row {
@ -1515,12 +1515,12 @@ in
width: 14 width: 14
height: 14 height: 14
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
visible: appIcon !== "" visible: appIconPath !== ""
Image { Image {
id: appStreamIcon id: appStreamIcon
anchors.fill: parent anchors.fill: parent
source: appIcon !== "" ? "image://icon/" + appIcon : "" source: appIconPath
sourceSize.width: 14 sourceSize.width: 14
sourceSize.height: 14 sourceSize.height: 14
smooth: true smooth: true
@ -1539,7 +1539,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 - (appIcon !== "" ? 20 : 0) width: parent.width - (appIconPath !== "" ? 20 : 0)
} }
} }