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

View File

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