mirror of
https://github.com/phranck/TUIkit.git
synced 2026-05-21 09:50:35 +00:00
95029184e7
- Rename module, targets and products in Package.swift - Rename directories: Sources/TUIkit, TUIkitExample, Tests/TUIkitTests - Rename files: TUIkit.swift, TUIkit.docc/TUIkit.md - Update all import statements, module-qualified calls, file headers - Update doc comments, string literals and DocC articles - Update CI workflow, README, .swiftlint.yml and markdown docs - Merge platform badges into single combined badge in README - Add "Example App auslagern" task to to-dos.md
74 lines
2.0 KiB
Swift
74 lines
2.0 KiB
Swift
//
|
|
// LayoutPage.swift
|
|
// TUIkitExample
|
|
//
|
|
// Demonstrates layout system capabilities.
|
|
//
|
|
|
|
import TUIkit
|
|
|
|
/// Layout system demo page.
|
|
///
|
|
/// Shows various layout options including:
|
|
/// - VStack (vertical stacking)
|
|
/// - HStack (horizontal stacking)
|
|
/// - Spacer (flexible space)
|
|
/// - Padding and frame modifiers
|
|
struct LayoutPage: View {
|
|
var body: some View {
|
|
VStack(spacing: 1) {
|
|
HeaderView(title: "Layout System Demo")
|
|
|
|
DemoSection("VStack (Vertical)") {
|
|
// Box uses appearance default borderStyle
|
|
Box(color: .brightBlack) {
|
|
VStack(spacing: 0) {
|
|
Text("Item 1")
|
|
Text("Item 2")
|
|
Text("Item 3")
|
|
}
|
|
}
|
|
}
|
|
|
|
DemoSection("HStack (Horizontal)") {
|
|
Box(color: .brightBlack) {
|
|
HStack(spacing: 2) {
|
|
Text("Left")
|
|
Text("Center")
|
|
Text("Right")
|
|
}
|
|
}
|
|
}
|
|
|
|
DemoSection("Spacer") {
|
|
Box(color: .brightBlack) {
|
|
HStack {
|
|
Text("Start")
|
|
Spacer()
|
|
Text("End")
|
|
}
|
|
}
|
|
}
|
|
|
|
DemoSection("Padding & Frame") {
|
|
HStack(spacing: 2) {
|
|
VStack {
|
|
Text(".padding()").dim()
|
|
Text("Padded")
|
|
.padding(EdgeInsets(all: 1))
|
|
.border() // Uses appearance default
|
|
}
|
|
VStack {
|
|
Text(".frame()").dim()
|
|
Text("Framed")
|
|
.frame(width: 15, alignment: .center)
|
|
.border() // Uses appearance default
|
|
}
|
|
}
|
|
}
|
|
|
|
Spacer()
|
|
}
|
|
}
|
|
}
|