Compare commits

..

2 commits

4 changed files with 15 additions and 7 deletions

View file

@ -127,7 +127,7 @@ Item {
Layout.alignment: Qt.AlignVCenter
implicitSize: 36
source: Icons.getAppIcon(toplevel?.lastIpcObject.class ?? "", "")
source: Icons.getAppIcon(toplevel?.lastIpcObject.class ?? "")
}
ColumnLayout {

View file

@ -110,8 +110,8 @@ Item {
source: {
const icon = entry.modelData.properties["application.icon-name"];
if (icon)
return Icons.getAppIcon(icon, "icon-missing");
Icons.getAppIcon(entry.modelData.name, "icon-missing")
return Icons.getAppIcon(icon);
Icons.getAppIcon(entry.modelData?.name ?? "")
}
}

View file

@ -377,7 +377,7 @@ Item {
anchors.centerIn: parent
implicitSize: Math.min(48, window.width * 0.5, window.height * 0.5)
source: Icons.getAppIcon(window.ipc?.class ?? "", "")
source: Icons.getAppIcon(window.ipc?.class ?? "")
}
// Interactions

View file

@ -76,7 +76,15 @@ Singleton {
readonly property var desktopEntrySubs: ({
"gimp-3.0": ["gimp"],
"discord": ["discord", "discord-canary"]
"discord": ["discord", "discord-canary"],
// Libreoffice
"libreoffice-startcenter": ["libreoffice-startcenter", "startcenter"],
"libreoffice-writer": ["libreoffice-writer", "writer"],
"libreoffice-draw": ["libreoffice-draw", "draw"],
"libreoffice-impress": ["libreoffice-impress", "impress"],
"libreoffice-math": ["libreoffice-math", "math"],
"libreoffice-base": ["libreoffice-base", "base"],
"libreoffice-calc": ["libreoffice-calc", "calc"]
})
readonly property var categoryIcons: ({
@ -131,8 +139,8 @@ Singleton {
return DesktopEntries.applications.values.find(a => names.includes(a.id.toLowerCase())) ?? null;
}
function getAppIcon(name: string, fallback: string): string {
return Quickshell.iconPath(getDesktopEntry(name)?.icon, fallback);
function getAppIcon(name: string): string {
return Quickshell.iconPath(getDesktopEntry(name)?.icon, "icon-missing");
}
function getAppCategoryIcon(name: string, fallback: string): string {