add success haptic and indentation

This commit is contained in:
neon443
2025-06-15 21:24:15 +01:00
parent 5ec16dd67a
commit e4107a2faa
2 changed files with 11 additions and 8 deletions

View File

@@ -14,7 +14,7 @@ struct ContentView: View {
@State private var showAddEventView: Bool = false
@State private var symbolSearchInput: String = ""
var body: some View {
var body: some View {
NavigationSplitView {
List {
NavigationLink {
@@ -77,7 +77,7 @@ struct ContentView: View {
Label("New", systemImage: "plus")
}
}
}
}
}
#Preview {

View File

@@ -43,6 +43,9 @@ struct CompleteEventButton: View {
if progress >= 1 {
withAnimation { completeInProgress = false }
viewModel.completeEvent(&event)
#if canImport(UIKit)
UINotificationFeedbackGenerator().notificationOccurred(.success)
#endif
timer.invalidate()
progress = 0
}
@@ -50,7 +53,7 @@ struct CompleteEventButton: View {
RunLoop.main.add(timer!, forMode: .common)
}
var body: some View {
var body: some View {
Group {
if completeInProgress {
ZStack {
@@ -86,7 +89,7 @@ struct CompleteEventButton: View {
.spring(response: 0.2, dampingFraction: 0.75, blendDuration: 2),
value: largeTick
)
}
}
}
struct CircularProgressView: View {
@@ -103,10 +106,10 @@ struct CircularProgressView: View {
.stroke(
.one,
lineWidth: 5
// style: StrokeStyle(
// lineWidth: 5,
// lineCap: .round
// )
// style: StrokeStyle(
// lineWidth: 5,
// lineCap: .round
// )
)
.rotationEffect(.degrees(-90))
}