mirror of
https://github.com/FBukovina/Atoll.git
synced 2026-10-27 23:24:32 +00:00
Able to detectgit add .
This commit is contained in:
parent
7bf67056f7
commit
91dc22acf4
9 changed files with 1144 additions and 64 deletions
|
|
@ -41,6 +41,7 @@ struct TimerControlOverlay: View {
|
|||
.buttonStyle(.plain)
|
||||
.contentShape(RoundedRectangle(cornerRadius: 10, style: .continuous))
|
||||
.help(helpText)
|
||||
.disabled(!timerManager.allowsManualInteraction)
|
||||
|
||||
Button(action: stopTimer) {
|
||||
Image(systemName: "stop.fill")
|
||||
|
|
@ -51,6 +52,7 @@ struct TimerControlOverlay: View {
|
|||
.buttonStyle(.plain)
|
||||
.contentShape(RoundedRectangle(cornerRadius: 10, style: .continuous))
|
||||
.help("Stop")
|
||||
.disabled(!timerManager.allowsManualInteraction)
|
||||
}
|
||||
.padding(.horizontal, 12)
|
||||
.frame(height: notchHeight)
|
||||
|
|
@ -66,6 +68,7 @@ struct TimerControlOverlay: View {
|
|||
}
|
||||
|
||||
private func togglePause() {
|
||||
guard timerManager.allowsManualInteraction else { return }
|
||||
if timerManager.isPaused {
|
||||
timerManager.resumeTimer()
|
||||
} else {
|
||||
|
|
@ -74,6 +77,10 @@ struct TimerControlOverlay: View {
|
|||
}
|
||||
|
||||
private func stopTimer() {
|
||||
guard timerManager.allowsManualInteraction else {
|
||||
timerManager.endExternalTimer(triggerSmoothClose: false)
|
||||
return
|
||||
}
|
||||
#if os(macOS)
|
||||
TimerControlWindowManager.shared.hide(animated: true)
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -158,6 +158,7 @@ private struct ActiveTimerSection: View {
|
|||
.labelStyle(.titleAndIcon)
|
||||
}
|
||||
.buttonStyle(.bordered)
|
||||
.disabled(!timerManager.allowsManualInteraction)
|
||||
|
||||
Button(role: .destructive, action: stopTimer) {
|
||||
Label("Stop", systemImage: "stop.fill")
|
||||
|
|
@ -165,6 +166,7 @@ private struct ActiveTimerSection: View {
|
|||
.labelStyle(.titleAndIcon)
|
||||
}
|
||||
.buttonStyle(.borderedProminent)
|
||||
.disabled(!timerManager.allowsManualInteraction)
|
||||
}
|
||||
}
|
||||
.frame(maxWidth: .infinity, alignment: .leading)
|
||||
|
|
@ -175,6 +177,7 @@ private struct ActiveTimerSection: View {
|
|||
}
|
||||
|
||||
private func togglePause() {
|
||||
guard timerManager.allowsManualInteraction else { return }
|
||||
withAnimation(.smooth) {
|
||||
if timerManager.isPaused {
|
||||
timerManager.resumeTimer()
|
||||
|
|
@ -185,6 +188,10 @@ private struct ActiveTimerSection: View {
|
|||
}
|
||||
|
||||
private func stopTimer() {
|
||||
guard timerManager.allowsManualInteraction else {
|
||||
timerManager.endExternalTimer(triggerSmoothClose: false)
|
||||
return
|
||||
}
|
||||
withAnimation(.smooth) {
|
||||
timerManager.stopTimer()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue