@@ -30,16 +30,28 @@ class Application: NSObject {
3030 kAXApplicationShownNotification,
3131 ]
3232
33- static func appIconWithoutPadding( _ icon: NSImage ? ) -> CGImage ? {
33+ private static let appIconPadding : CGFloat = {
34+ // Tahoe redesigned app icons. Keeping their rounded look, and reducing their size; we trim that padding
35+ if #available( macOS 26 . 0 , * ) {
36+ return 84
37+ }
38+ // Big Sur redesigned app icons. A big change from square icons to rounded icons, and reducing their size; we trim that padding
39+ if #available( macOS 11 . 0 , * ) {
40+ return 24
41+ }
42+ return 0
43+ } ( )
44+
45+ private static func appIconWithoutPadding( _ icon: NSImage ? ) -> CGImage ? {
3446 guard let icon else { return nil }
3547 // we can render the icon quite big (e.g. windowless app icon), so we store it high-res
3648 let iconWidth = CGFloat ( 1024 )
3749 // NSRunningApplication.icon returns icons with padding; we remove it manually
38- let paddingToRemove = CGFloat ( 84 )
39- let croppedSize = iconWidth - paddingToRemove * 2
50+
51+ let croppedSize = iconWidth - appIconPadding * 2
4052 return icon
4153 . appIconFixedSize ( NSSize ( width: iconWidth, height: iconWidth) ) ?
42- . cropping ( to: CGRect ( x: paddingToRemove , y: paddingToRemove , width: croppedSize, height: croppedSize) . integral)
54+ . cropping ( to: CGRect ( x: appIconPadding , y: appIconPadding , width: croppedSize, height: croppedSize) . integral)
4355 }
4456
4557 init ( _ runningApplication: NSRunningApplication ) {
0 commit comments