Support getting app icon from asset catalog

This commit is contained in:
Charles Srstka authored and Kornel committed 2020-12-10 08:56:53 +00:00
1 parent eac4522817
commit 238fd42bb3
1 file changed
+6
+6
View File
@@ -22,6 +22,12 @@
NSURL *iconURL = [SUBundleIcon iconURLForHost:host];
NSImage *icon = (iconURL == nil) ? nil : [[NSImage alloc] initWithContentsOfURL:iconURL];
// Get icon from asset catalog if no explicit filename is provided.
if (!icon) {
icon = [host.bundle imageForResource:@SPARKLE_ICON_NAME];
}
// Use a default icon if none is defined.
if (!icon) {
// this asumption may not be correct (eg. even though we're not the main bundle, it could be still be a regular app)