@@ -2,29 +2,30 @@ import Cocoa
22
33class Appearance {
44 // size
5+ static var hideThumbnails = Bool ( false )
56 static var windowPadding = CGFloat ( 18 )
6- static var interCellPadding = CGFloat ( 1 )
7- static var intraCellPadding = CGFloat ( 5 )
8- static var appIconLabelSpacing = CGFloat ( 2 )
9- static var edgeInsetsSize = CGFloat ( 5 )
10- static var cellCornerRadius = CGFloat ( 10 )
117 static var windowCornerRadius = CGFloat ( 23 )
12- static var hideThumbnails = Bool ( false )
8+ static var cellCornerRadius = CGFloat ( 10 )
9+ static var edgeInsetsSize = CGFloat ( 5 )
10+ static var maxWidthOnScreen = CGFloat ( 0.8 )
1311 static var rowsCount = CGFloat ( 0 )
14- static var windowMinWidthInRow = CGFloat ( 0 )
15- static var windowMaxWidthInRow = CGFloat ( 0 )
1612 static var iconSize = CGFloat ( 0 )
1713 static var fontHeight = CGFloat ( 0 )
18- static var maxWidthOnScreen = CGFloat ( 0.8 )
19- static var maxHeightOnScreen = CGFloat ( 0.8 )
14+ static var windowMinWidthInRow = CGFloat ( 0 )
15+ static var windowMaxWidthInRow = CGFloat ( 0 )
16+ // size: constants
17+ static let maxHeightOnScreen = CGFloat ( 0.8 )
18+ static let interCellPadding = CGFloat ( 1 )
19+ static let intraCellPadding = CGFloat ( 5 )
20+ static let appIconLabelSpacing = CGFloat ( 2 )
2021
2122 // theme
22- static var material = NSVisualEffectView . Material. dark
2323 static var fontColor = NSColor . white
2424 static var indicatedIconShadowColor : NSColor ? = . darkGray
2525 static var titleShadowColor : NSColor ? = . darkGray
26- static var imageShadowColor : NSColor ? = . gray // for icon, thumbnail and windowless images
2726 static var highlightMaterial = NSVisualEffectView . Material. selection
27+ static var material = NSVisualEffectView . Material. dark
28+ static var imageShadowColor : NSColor ? = . gray // for icon, thumbnail and windowless images
2829 static var highlightFocusedAlphaValue = 1.0
2930 static var highlightHoveredAlphaValue = 0.8
3031 static var highlightFocusedBackgroundColor = NSColor . black. withAlphaComponent ( 0.5 )
@@ -36,7 +37,12 @@ class Appearance {
3637 static var enablePanelShadow = false
3738
3839 // derived
39- static var font : NSFont { NSFont . systemFont ( ofSize: fontHeight) }
40+ static var font : NSFont {
41+ if #available( macOS 26 . 0 , * ) {
42+ return NSFont . systemFont ( ofSize: fontHeight, weight: . medium)
43+ }
44+ return NSFont . systemFont ( ofSize: fontHeight)
45+ }
4046
4147 private static var currentStyle : AppearanceStylePreference { Preferences . appearanceStyle }
4248 private static var currentSize : AppearanceSizePreference { Preferences . appearanceSize }
@@ -72,14 +78,24 @@ class Appearance {
7278 } else {
7379 lightTheme ( )
7480 }
81+ // for Liquid Glass, we don't want a shadow around the panel
82+ if #available( macOS 26 . 0 , * ) , currentStyle == . appIcons && LiquidGlassEffectView . canUsePrivateLiquidGlassLook ( ) {
83+ enablePanelShadow = false
84+ }
7585 }
7686
7787 private static func thumbnailsSize( _ isHorizontalScreen: Bool ) {
7888 hideThumbnails = false
7989 windowPadding = 18
80- cellCornerRadius = 10
8190 windowCornerRadius = 23
91+ cellCornerRadius = 10
8292 edgeInsetsSize = 12
93+ maxWidthOnScreen = 0.8
94+ if #available( macOS 26 . 0 , * ) {
95+ windowPadding = 28
96+ windowCornerRadius = 43
97+ cellCornerRadius = 18
98+ }
8399 switch currentSize {
84100 case . small:
85101 rowsCount = isHorizontalScreen ? 5 : 8
@@ -105,31 +121,47 @@ class Appearance {
105121 private static func appIconsSize( ) {
106122 hideThumbnails = true
107123 windowPadding = 25
108- cellCornerRadius = 10
109124 windowCornerRadius = 23
125+ cellCornerRadius = 10
110126 edgeInsetsSize = 5
127+ if #available( macOS 26 . 0 , * ) {
128+ edgeInsetsSize = 6
129+ }
130+ maxWidthOnScreen = 0.8
111131 windowMinWidthInRow = 0.04
112132 windowMaxWidthInRow = 0.3
113133 rowsCount = 1
114134 switch currentSize {
115135 case . small:
116136 iconSize = 88
117137 fontHeight = 13
138+ if #available( macOS 26 . 0 , * ) {
139+ windowCornerRadius = 50
140+ cellCornerRadius = 28
141+ }
118142 case . medium:
119143 iconSize = 128
120144 fontHeight = 15
145+ if #available( macOS 26 . 0 , * ) {
146+ windowCornerRadius = 55
147+ cellCornerRadius = 38
148+ }
121149 case . large:
122150 windowPadding = 28
123151 iconSize = 168
124152 fontHeight = 17
153+ if #available( macOS 26 . 0 , * ) {
154+ windowCornerRadius = 75
155+ cellCornerRadius = 48
156+ }
125157 }
126158 }
127159
128160 private static func titlesSize( _ isHorizontalScreen: Bool ) {
129161 hideThumbnails = true
130162 windowPadding = 18
131- cellCornerRadius = 10
132163 windowCornerRadius = 23
164+ cellCornerRadius = 10
133165 edgeInsetsSize = 7
134166 maxWidthOnScreen = isHorizontalScreen ? 0.6 : 0.8
135167 windowMinWidthInRow = 0.6
@@ -150,10 +182,10 @@ class Appearance {
150182
151183 private static func lightTheme( ) {
152184 fontColor = . black. withAlphaComponent ( 0.8 )
153- titleShadowColor = nil
154185 indicatedIconShadowColor = nil
155- imageShadowColor = . lightGray . withAlphaComponent ( 0.4 )
186+ titleShadowColor = nil
156187 highlightMaterial = . mediumLight
188+ imageShadowColor = . lightGray. withAlphaComponent ( 0.4 )
157189 switch currentVisibility {
158190 case . normal:
159191 material = . light
0 commit comments