Worked on custom notch width

This commit is contained in:
Hariharan Mudaliar 2025-12-02 17:17:03 +05:30
commit 75110a92d2
6 changed files with 107 additions and 1 deletions

View file

@ -147,6 +147,29 @@ class DynamicIslandViewModel: NSObject, ObservableObject {
}
}
.store(in: &cancellables)
Defaults.publisher(.openNotchWidth, options: [])
.map { $0.newValue }
.removeDuplicates()
.receive(on: RunLoop.main)
.sink { [weak self] _ in
guard let self else { return }
guard self.notchState == .open else { return }
guard !Defaults[.enableMinimalisticUI] else { return }
let updatedTarget = self.calculateDynamicNotchSize()
guard self.notchSize != updatedTarget else { return }
withAnimation(.smooth) {
self.notchSize = updatedTarget
}
if let delegate = AppDelegate.shared {
delegate.ensureWindowSize(
addShadowPadding(to: updatedTarget, isMinimalistic: false),
animated: true,
force: false
)
}
}
.store(in: &cancellables)
}
private func handleMinimalisticTimerHeightChange() {