locked the freak in for this one -

can cancel events being completed!!!!!
added a cancel to symbolpicker
and made it dip after choosing
extracted completevent into viewmodel
eventlistview is pretty full rn -- need to cleana
added color picker ot addeventview wtf why wasnt it there
This commit is contained in:
neon443
2025-06-14 21:32:11 +01:00
parent d80011ea27
commit 5dd25f1ede
7 changed files with 249 additions and 49 deletions

View File

@@ -222,6 +222,17 @@ class EventViewModel: ObservableObject, @unchecked Sendable {
saveEvents() //sync with icloud
}
func completeEvent(_ event: inout Event) {
withAnimation { event.complete.toggle() }
let eventToModify = self.events.firstIndex() { currEvent in
currEvent.id == event.id
}
if let eventToModify = eventToModify {
self.events[eventToModify] = event
self.saveEvents()
}
}
func removeEvent(at index: IndexSet) {
events.remove(atOffsets: index)
saveEvents() //sync local and icl

View File

@@ -14,6 +14,7 @@ struct SymbolsPicker: View {
@FocusState var searchfocuesd: Bool
@State var searchInput: String = ""
@Environment(\.dismiss) var dismiss
var symbols: [String] {
return symbolsLoader.getSymbols(searchInput)
@@ -45,6 +46,8 @@ struct SymbolsPicker: View {
ForEach(symbols, id: \.self) { symbol in
Button() {
selection = symbol
searchInput = ""
dismiss()
} label: {
VStack {
Image(systemName: symbol)
@@ -62,7 +65,15 @@ struct SymbolsPicker: View {
}
}
}
.searchable(text: $searchInput)
}
.searchable(text: $searchInput)
.toolbar {
ToolbarItem(placement: .cancellationAction) {
Button("Cancel") {
searchInput = ""
dismiss()
}
}
}
}
}