learning_ai_clock/ios/ChronoMindMac/MenuBarState.swift

30 lines
787 B
Swift

// Menu Bar State
// Observable state for the macOS menu bar popover
import SwiftUI
import Combine
@MainActor
final class MenuBarState: ObservableObject {
static let shared = MenuBarState()
@Published var isExpanded = false
@Published var showQuickTimer = false
@Published var quickTimerLabel = ""
@Published var quickTimerMinutes: Double = 25
private init() {}
func toggleExpanded() {
withAnimation(.easeInOut(duration: 0.2)) {
isExpanded.toggle()
}
}
func resetQuickTimer() {
quickTimerLabel = ""
quickTimerMinutes = 25
showQuickTimer = false
}
}