mirror of
https://github.com/jeremysrand/ListenerApp.git
synced 2024-06-06 09:29:29 +00:00
More updates to improve behaviour of the destinations list.
This commit is contained in:
parent
c9936e82f5
commit
2c58886439
|
@ -13,10 +13,7 @@ struct Destination: Identifiable, Hashable {
|
||||||
}
|
}
|
||||||
|
|
||||||
struct DestinationsView: View {
|
struct DestinationsView: View {
|
||||||
@State private var destinations = [
|
@State private var destinations:[Destination] = []
|
||||||
Destination(ipAddress: "192.168.1.20"),
|
|
||||||
Destination(ipAddress: "192.168.1.21")
|
|
||||||
]
|
|
||||||
@State private var editMode = EditMode.inactive
|
@State private var editMode = EditMode.inactive
|
||||||
@State private var showPopover = false
|
@State private var showPopover = false
|
||||||
@State private var newDestination = ""
|
@State private var newDestination = ""
|
||||||
|
@ -51,13 +48,25 @@ struct DestinationsView: View {
|
||||||
|
|
||||||
private var addPopover: some View {
|
private var addPopover: some View {
|
||||||
VStack {
|
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
|
TextField("New destination", text: self.$newDestination) { isEditing in
|
||||||
} onCommit: {
|
} onCommit: {
|
||||||
onAdd()
|
onAdd()
|
||||||
}
|
}
|
||||||
}
|
.padding()
|
||||||
.padding()
|
HStack {
|
||||||
|
Button("Cancel") {
|
||||||
|
self.showPopover = false
|
||||||
|
editMode = EditMode.inactive
|
||||||
|
}
|
||||||
|
.padding()
|
||||||
|
Button("Add") {
|
||||||
|
onAdd()
|
||||||
|
}
|
||||||
|
.padding()
|
||||||
|
}
|
||||||
|
}.padding()
|
||||||
}
|
}
|
||||||
|
|
||||||
private func onDelete(offsets: IndexSet) {
|
private func onDelete(offsets: IndexSet) {
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>1.0</string>
|
<string>1.0</string>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>210</string>
|
<string>239</string>
|
||||||
<key>LSApplicationCategoryType</key>
|
<key>LSApplicationCategoryType</key>
|
||||||
<string>public.app-category.utilities</string>
|
<string>public.app-category.utilities</string>
|
||||||
<key>LSRequiresIPhoneOS</key>
|
<key>LSRequiresIPhoneOS</key>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user