mirror of
https://github.com/FBukovina/Atoll.git
synced 2026-10-28 07:34:32 +00:00
Working Timer in Minimalistic View
This commit is contained in:
parent
9e8acaf9b9
commit
8a76d9e86f
4 changed files with 135 additions and 0 deletions
|
|
@ -119,6 +119,14 @@ class DynamicIslandViewModel: NSObject, ObservableObject {
|
|||
}
|
||||
.store(in: &cancellables)
|
||||
|
||||
TimerManager.shared.$activeSource
|
||||
.combineLatest(TimerManager.shared.$isTimerActive)
|
||||
.receive(on: RunLoop.main)
|
||||
.sink { [weak self] _, _ in
|
||||
self?.handleMinimalisticTimerHeightChange()
|
||||
}
|
||||
.store(in: &cancellables)
|
||||
|
||||
coordinator.$statsSecondRowExpansion
|
||||
.removeDuplicates()
|
||||
.receive(on: RunLoop.main)
|
||||
|
|
@ -140,6 +148,23 @@ class DynamicIslandViewModel: NSObject, ObservableObject {
|
|||
}
|
||||
.store(in: &cancellables)
|
||||
}
|
||||
|
||||
private func handleMinimalisticTimerHeightChange() {
|
||||
guard Defaults[.enableMinimalisticUI] else { return }
|
||||
guard notchState == .open else { return }
|
||||
let updatedTarget = calculateDynamicNotchSize()
|
||||
guard notchSize != updatedTarget else { return }
|
||||
withAnimation(.smooth) {
|
||||
notchSize = updatedTarget
|
||||
}
|
||||
if let delegate = AppDelegate.shared {
|
||||
delegate.ensureWindowSize(
|
||||
addShadowPadding(to: updatedTarget, isMinimalistic: Defaults[.enableMinimalisticUI]),
|
||||
animated: true,
|
||||
force: false
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
private func setupDetectorObserver() {
|
||||
// 1) Publisher for the user’s fullscreen detection setting
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue