quickshell: add monochrome app icons to volume dropdown

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

View file

@ -1500,13 +1500,47 @@ in
objects: [modelData] objects: [modelData]
} }
property string appIcon: {
let icon = modelData.properties["application.icon-name"] || "";
if (icon !== "") return icon;
let name = (modelData.properties["application.name"] || modelData.name || "").toLowerCase();
return name;
}
Row {
width: parent.width
spacing: 6
Item {
width: 14
height: 14
anchors.verticalCenter: parent.verticalCenter
visible: appIcon !== ""
Image {
id: appStreamIcon
anchors.fill: parent
source: appIcon !== "" ? "image://icon/" + appIcon : ""
sourceSize.width: 14
sourceSize.height: 14
smooth: true
visible: false
}
ColorOverlay {
anchors.fill: appStreamIcon
source: appStreamIcon
color: Theme.base05
}
}
Text { Text {
text: modelData.name || "Unknown" text: modelData.properties["application.name"] || modelData.name || "Unknown"
color: Theme.base04 color: Theme.base04
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 width: parent.width - (appIcon !== "" ? 20 : 0)
}
} }
Row { Row {