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]
} }
Text { property string appIcon: {
text: modelData.name || "Unknown" let icon = modelData.properties["application.icon-name"] || "";
color: Theme.base04 if (icon !== "") return icon;
font.family: "FiraMono Nerd Font" let name = (modelData.properties["application.name"] || modelData.name || "").toLowerCase();
font.pixelSize: 11 return name;
elide: Text.ElideRight }
Row {
width: parent.width 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: modelData.properties["application.name"] || modelData.name || "Unknown"
color: Theme.base04
font.family: "FiraMono Nerd Font"
font.pixelSize: 11
elide: Text.ElideRight
width: parent.width - (appIcon !== "" ? 20 : 0)
}
} }
Row { Row {