Yep. AI rewrote the whole thing.

This commit is contained in:
2026-03-13 03:24:24 +11:00
parent e4719cb9f4
commit fe6c7d8c12
47 changed files with 5348 additions and 1182 deletions

View File

@@ -27,18 +27,16 @@ extension NSScreen {
/// Computes the closed-state notch size for this screen,
/// respecting the user's height mode and custom height preferences.
func closedNotchSize() -> CGSize {
let height = closedNotchHeight()
func closedNotchSize(using settings: AppSettings.DisplaySettings) -> CGSize {
let height = closedNotchHeight(using: settings)
let width = closedNotchWidth()
return CGSize(width: width, height: height)
}
/// Height of the closed notch bar, determined by the user's chosen mode.
private func closedNotchHeight() -> CGFloat {
let defaults = UserDefaults.standard
private func closedNotchHeight(using settings: AppSettings.DisplaySettings) -> CGFloat {
if hasNotch {
let mode = NotchHeightMode(rawValue: defaults.integer(forKey: NotchSettings.Keys.notchHeightMode))
let mode = NotchHeightMode(rawValue: settings.notchHeightMode)
?? .matchRealNotchSize
switch mode {
case .matchRealNotchSize:
@@ -46,16 +44,16 @@ extension NSScreen {
case .matchMenuBar:
return menuBarHeight()
case .custom:
return defaults.double(forKey: NotchSettings.Keys.notchHeight)
return settings.notchHeight
}
} else {
let mode = NonNotchHeightMode(rawValue: defaults.integer(forKey: NotchSettings.Keys.nonNotchHeightMode))
let mode = NonNotchHeightMode(rawValue: settings.nonNotchHeightMode)
?? .matchMenuBar
switch mode {
case .matchMenuBar:
return menuBarHeight()
case .custom:
return defaults.double(forKey: NotchSettings.Keys.nonNotchHeight)
return settings.nonNotchHeight
}
}
}