|
|
@@ -22,9 +22,8 @@ struct TaskView: View {
|
|
|
var body: some View {
|
|
|
VStack {
|
|
|
HStack {
|
|
|
- if !task.category.isEmpty {
|
|
|
- let grp = $allGroups.first(where: { $0.name.wrappedValue == task.category })
|
|
|
- ColorPicker("", selection: grp!.color).disabled(true).scaledToFit()
|
|
|
+ if let grp = $allGroups.first(where: { $0.name.wrappedValue == task.category }) {
|
|
|
+ ColorPicker("", selection: grp.color).disabled(true).scaledToFit()
|
|
|
}
|
|
|
Image(systemName: task.status.label)
|
|
|
.frame(width: 20)
|
|
|
@@ -55,10 +54,8 @@ struct TaskView: View {
|
|
|
HStack {
|
|
|
TagBarView(task: $task)
|
|
|
.font(.footnote)
|
|
|
- .focused($isFocused)
|
|
|
.padding(.leading, 30)
|
|
|
VisibilityTapper(hideToggle: $hideTags)
|
|
|
- .focused($isFocused)
|
|
|
if isFocused {
|
|
|
Picker("", selection: $task.category) {
|
|
|
Text(empty.name).tag("")
|
|
|
@@ -67,20 +64,17 @@ struct TaskView: View {
|
|
|
}
|
|
|
}
|
|
|
.fixedSize(horizontal: true, vertical: false)
|
|
|
- .focused($isFocused)
|
|
|
}
|
|
|
- }
|
|
|
+ }.focused($isFocused)
|
|
|
}
|
|
|
|
|
|
if isFocused || !(hideNotes || task.notes.isEmpty) {
|
|
|
HStack {
|
|
|
TextField("Notes", text: $task.notes, axis: .vertical)
|
|
|
.font(.footnote)
|
|
|
- .focused($isFocused)
|
|
|
.padding(.leading, 30)
|
|
|
VisibilityTapper(hideToggle: $hideNotes)
|
|
|
- .focused($isFocused)
|
|
|
- }
|
|
|
+ }.focused($isFocused)
|
|
|
}
|
|
|
|
|
|
VStack {
|