Show the selected routine as a symbol-and-color preview in the form
The Routine row now renders the selection like the picker list's rows (tinted symbol + name); with nothing selected it reads "Please select" in secondary style.
This commit is contained in:
@@ -180,10 +180,19 @@ struct ScheduleAddEditView: View {
|
||||
RoutinePickerList(routines: routines, currentID: selectedRoutine?.id,
|
||||
selectedID: $routineID)
|
||||
} label: {
|
||||
HStack {
|
||||
Text("Routine")
|
||||
Spacer()
|
||||
Text(selectedRoutine?.name ?? "Choose…")
|
||||
// The row is the selection's preview — the routine's own symbol and
|
||||
// color, matching the picker list's rows.
|
||||
if let routine = selectedRoutine {
|
||||
HStack(spacing: 12) {
|
||||
Image(systemName: routine.systemImage)
|
||||
.font(.title3)
|
||||
.foregroundStyle(Color.color(from: routine.color))
|
||||
.frame(width: 32)
|
||||
Text(routine.name)
|
||||
.foregroundStyle(.primary)
|
||||
}
|
||||
} else {
|
||||
Text("Please select")
|
||||
.foregroundStyle(.secondary)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user