|
|
@@ -10,7 +10,10 @@ import SwiftUI
|
|
|
struct TaskView: View {
|
|
|
@Binding var task: Task
|
|
|
@State private var showTags: Bool = false
|
|
|
+ @State private var hideTags: Bool = false
|
|
|
+
|
|
|
@State private var showNotes: Bool = false
|
|
|
+ @State private var hideNotes: Bool = false
|
|
|
|
|
|
var body: some View {
|
|
|
VStack {
|
|
|
@@ -22,19 +25,27 @@ struct TaskView: View {
|
|
|
}.scaledToFit()
|
|
|
TextField("Task Name", text: $task.name)
|
|
|
}
|
|
|
+
|
|
|
if showTags {
|
|
|
- TagBarView(tags: $task.tags)
|
|
|
- .font(.footnote)
|
|
|
- .padding(.leading, 30)
|
|
|
+ HStack {
|
|
|
+ TagBarView(tags: $task.tags)
|
|
|
+ .font(.footnote)
|
|
|
+ .padding(.leading, 30)
|
|
|
+ ShowHideTapper(shown: $showTags, hideToggle: $hideTags)
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
if showNotes {
|
|
|
- TextField("Notes", text: $task.notes)
|
|
|
- .font(.footnote)
|
|
|
- .padding(.leading, 30)
|
|
|
+ HStack {
|
|
|
+ TextField("Notes", text: $task.notes)
|
|
|
+ .font(.footnote)
|
|
|
+ .padding(.leading, 30)
|
|
|
+ ShowHideTapper(shown: $showNotes, hideToggle: $hideNotes)
|
|
|
+ }
|
|
|
}
|
|
|
}.onHover { yes in
|
|
|
- showTags = yes || !task.tags.isEmpty
|
|
|
- showNotes = yes || !task.notes.isEmpty
|
|
|
+ showTags = yes || !(hideTags || task.tags.isEmpty)
|
|
|
+ showNotes = yes || !(hideNotes || task.notes.isEmpty)
|
|
|
}
|
|
|
}
|
|
|
}
|