diff options
| author | Arturs Artamonovs <arturs.artamonovs@protonmail.com> | 2026-08-07 02:01:40 +0100 |
|---|---|---|
| committer | Arturs Artamonovs <arturs.artamonovs@protonmail.com> | 2026-08-07 02:01:40 +0100 |
| commit | 91d0042017e6c46f2c9f5d42d438836efa6d53e4 (patch) | |
| tree | af8c2dbad8ea148e882136843634ff53c42dd20b /ShedCalc/ContentView.swift | |
| parent | dabeb1603cf146aa671dddf949788b514b983b76 (diff) | |
| download | ShedCalc-91d0042017e6c46f2c9f5d42d438836efa6d53e4.tar.gz ShedCalc-91d0042017e6c46f2c9f5d42d438836efa6d53e4.zip | |
Added 3 views. Added basic beam drawing and basic calculations for width and length + beam drawing
Diffstat (limited to 'ShedCalc/ContentView.swift')
| -rw-r--r-- | ShedCalc/ContentView.swift | 34 |
1 files changed, 28 insertions, 6 deletions
diff --git a/ShedCalc/ContentView.swift b/ShedCalc/ContentView.swift index c19fdb3..dbf31a0 100644 --- a/ShedCalc/ContentView.swift +++ b/ShedCalc/ContentView.swift @@ -10,10 +10,12 @@ import SwiftData struct ContentView: View { @Environment(\.modelContext) private var modelContext + @Query private var items: [Item] + @State private var paramModel = ParamModel() var body: some View { - NavigationSplitView { + /*NavigationSplitView { List { ForEach(items) { item in NavigationLink { @@ -34,22 +36,33 @@ struct ContentView: View { } } detail: { Text("Select an item") - } + }*/ + TabView { + Tab("Render", systemImage: "tray") { + RenderView() + } + Tab("Params", systemImage: "tray") { + ParamView() + } + Tab("BOM", systemImage: "keyboard") { + BOMView() + } + }.environment(paramModel) } private func addItem() { - withAnimation { + /*withAnimation { let newItem = Item(timestamp: Date()) modelContext.insert(newItem) - } + }*/ } private func deleteItems(offsets: IndexSet) { - withAnimation { + /*withAnimation { for index in offsets { modelContext.delete(items[index]) } - } + }*/ } } @@ -57,3 +70,12 @@ struct ContentView: View { ContentView() .modelContainer(for: Item.self, inMemory: true) } + +#Preview { + NavigationSplitView { + ContentView() + } detail: { + Text("Select an item") + } +} + |
