Compare commits

..

No commits in common. "24d4c6cc3bc3dd52d5921511d90bf887e42fc7df" and "03d8b5983e851fb6e4b87b8bdc932162bdb2e5ae" have entirely different histories.

4 changed files with 7 additions and 15 deletions

View file

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

View file

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

View file

@ -377,7 +377,7 @@ Item {
anchors.centerIn: parent anchors.centerIn: parent
implicitSize: Math.min(48, window.width * 0.5, window.height * 0.5) 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 // Interactions

View file

@ -76,15 +76,7 @@ Singleton {
readonly property var desktopEntrySubs: ({ readonly property var desktopEntrySubs: ({
"gimp-3.0": ["gimp"], "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: ({ readonly property var categoryIcons: ({
@ -139,8 +131,8 @@ Singleton {
return DesktopEntries.applications.values.find(a => names.includes(a.id.toLowerCase())) ?? null; return DesktopEntries.applications.values.find(a => names.includes(a.id.toLowerCase())) ?? null;
} }
function getAppIcon(name: string): string { function getAppIcon(name: string, fallback: string): string {
return Quickshell.iconPath(getDesktopEntry(name)?.icon, "icon-missing"); return Quickshell.iconPath(getDesktopEntry(name)?.icon, fallback);
} }
function getAppCategoryIcon(name: string, fallback: string): string { function getAppCategoryIcon(name: string, fallback: string): string {