quickshell: fix app icons with Quickshell.iconPath
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
319314c194
commit
3068492aa7
1 changed files with 8 additions and 13 deletions
|
|
@ -1501,14 +1501,7 @@ in
|
||||||
}
|
}
|
||||||
|
|
||||||
property string appIconName: modelData.properties["application.icon-name"] || ""
|
property string appIconName: modelData.properties["application.icon-name"] || ""
|
||||||
|
property string appIconPath: appIconName !== "" ? (Quickshell.iconPath(appIconName) || "") : ""
|
||||||
Component.onCompleted: {
|
|
||||||
let props = modelData.properties;
|
|
||||||
console.log("Stream:", modelData.name,
|
|
||||||
"icon-name:", props["application.icon-name"],
|
|
||||||
"app-name:", props["application.name"],
|
|
||||||
"iconPath:", appIconName !== "" ? Quickshell.iconPath(appIconName) : "none");
|
|
||||||
}
|
|
||||||
|
|
||||||
Row {
|
Row {
|
||||||
width: parent.width
|
width: parent.width
|
||||||
|
|
@ -1518,13 +1511,15 @@ in
|
||||||
width: 14
|
width: 14
|
||||||
height: 14
|
height: 14
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
visible: appIconName !== ""
|
visible: appIconPath !== ""
|
||||||
|
|
||||||
IconImage {
|
Image {
|
||||||
id: appStreamIcon
|
id: appStreamIcon
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
implicitSize: 14
|
source: appIconPath
|
||||||
icon: appIconName
|
sourceSize.width: 14
|
||||||
|
sourceSize.height: 14
|
||||||
|
smooth: true
|
||||||
visible: false
|
visible: false
|
||||||
}
|
}
|
||||||
ColorOverlay {
|
ColorOverlay {
|
||||||
|
|
@ -1540,7 +1535,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 - (appIconName !== "" ? 20 : 0)
|
width: parent.width - (appIconPath !== "" ? 20 : 0)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue