More updates to improve behaviour of the destinations list.

This commit is contained in:
Jeremy Rand 2021-11-02 23:39:57 -04:00
parent c9936e82f5
commit 2c58886439
2 changed files with 17 additions and 8 deletions

View File

@ -13,10 +13,7 @@ struct Destination: Identifiable, Hashable {
}
struct DestinationsView: View {
@State private var destinations = [
Destination(ipAddress: "192.168.1.20"),
Destination(ipAddress: "192.168.1.21")
]
@State private var destinations:[Destination] = []
@State private var editMode = EditMode.inactive
@State private var showPopover = false
@State private var newDestination = ""
@ -51,13 +48,25 @@ struct DestinationsView: View {
private var addPopover: some View {
VStack {
Text("Enter the hostname or\nIP address of your GS:")
Text("Enter the hostname or IP address of your GS:")
.font(.title2)
TextField("New destination", text: self.$newDestination) { isEditing in
} onCommit: {
onAdd()
}
}
.padding()
.padding()
HStack {
Button("Cancel") {
self.showPopover = false
editMode = EditMode.inactive
}
.padding()
Button("Add") {
onAdd()
}
.padding()
}
}.padding()
}
private func onDelete(offsets: IndexSet) {

View File

@ -19,7 +19,7 @@
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>210</string>
<string>239</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.utilities</string>
<key>LSRequiresIPhoneOS</key>