diff --git a/src/api-wrappers/HelperExtensions.swift b/src/api-wrappers/HelperExtensions.swift index b12001df..3254c1c6 100644 --- a/src/api-wrappers/HelperExtensions.swift +++ b/src/api-wrappers/HelperExtensions.swift @@ -161,3 +161,15 @@ extension NSControl { } } } + +extension NSImage { + // copy and resize an image using high quality interpolation + func resizedCopy(_ width: CGFloat, _ height: CGFloat) -> NSImage { + let img = NSImage(size: CGSize(width: width, height: height)) + img.lockFocus() + NSGraphicsContext.current?.imageInterpolation = .high + draw(in: NSMakeRect(0, 0, width, height), from: NSMakeRect(0, 0, size.width, size.height), operation: .copy, fraction: 1) + img.unlockFocus() + return img + } +} diff --git a/src/ui/FeedbackWindow.swift b/src/ui/FeedbackWindow.swift index a8667b08..5b7eca84 100644 --- a/src/ui/FeedbackWindow.swift +++ b/src/ui/FeedbackWindow.swift @@ -26,8 +26,8 @@ class FeedbackWindow: NSWindow { } private func setupView() { - let appIcon = NSImageView(image: App.shared.applicationIconImage) - appIcon.fit(80, 80) + let appIcon = NSImageView(image: NSImage(named: "app-icon")!.resizedCopy(80, 80)) + appIcon.imageScaling = .scaleNone let appText = NSStackView(views: [ BoldLabel(NSLocalizedString("Share improvement ideas, or report bugs", comment: "")), HyperlinkLabel(NSLocalizedString("View existing discussions", comment: ""), App.repository + "/issues"), diff --git a/src/ui/preferences-window/tabs/AboutTab.swift b/src/ui/preferences-window/tabs/AboutTab.swift index c716ff0e..98d53faa 100644 --- a/src/ui/preferences-window/tabs/AboutTab.swift +++ b/src/ui/preferences-window/tabs/AboutTab.swift @@ -6,8 +6,8 @@ class AboutTab: NSObject { } static func makeView() -> NSGridView { - let appIcon = NSImageView(image: App.shared.applicationIconImage) - appIcon.fit(150, 150) + let appIcon = NSImageView(image: NSImage(named: "app-icon")!.resizedCopy(150, 150)) + appIcon.imageScaling = .scaleNone let appText = NSStackView(views: [ BoldLabel(App.name), NSTextField(wrappingLabelWithString: NSLocalizedString("Version", comment: "") + " " + App.version),