From 91d0042017e6c46f2c9f5d42d438836efa6d53e4 Mon Sep 17 00:00:00 2001 From: Arturs Artamonovs Date: Fri, 7 Aug 2026 02:01:40 +0100 Subject: Added 3 views. Added basic beam drawing and basic calculations for width and length + beam drawing --- ShedCalc/ContentView.swift | 34 ++++++++++++++++++++++++++++------ 1 file changed, 28 insertions(+), 6 deletions(-) (limited to 'ShedCalc/ContentView.swift') 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") + } +} + -- cgit v1.2.3