From 6ab97d2dfe563c2c43c2519b2e6f22494572045c Mon Sep 17 00:00:00 2001 From: Arturs Artamonovs Date: Fri, 19 Jul 2024 10:50:06 +0100 Subject: Add network configuration windows in LearnMapKit --- LearnMapKit/NetConfigView.swift | 45 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 LearnMapKit/NetConfigView.swift (limited to 'LearnMapKit/NetConfigView.swift') diff --git a/LearnMapKit/NetConfigView.swift b/LearnMapKit/NetConfigView.swift new file mode 100644 index 0000000..06fc5c2 --- /dev/null +++ b/LearnMapKit/NetConfigView.swift @@ -0,0 +1,45 @@ +// +// NetConfigView.swift +// LearnMapKit +// +// Created by Jacky Jack on 19/07/2024. +// + +import SwiftUI + +struct NetConfigView: View { + @State private var server_name: String = "" + @State private var server_port: String = "" + @Environment(\.dismissWindow) private var dismissWindow + + var body: some View { + VStack { + HStack { + Text("Server") + TextField("Server", text: $server_name) + } + HStack { + Text("Port") + TextField("Port", text: $server_port) + } + HStack { + Button(action:{ + print("Cancel") + dismissWindow(id:"net-config") + }) { + Text("Cancel") + } + Button(action: { + print("Save config") + dismissWindow(id:"net-config") + }) { + Text("Save") + } + } + } + } +} + +#Preview { + NetConfigView() +} -- cgit v1.2.3