mirror of
https://github.com/phranck/TUIkit.git
synced 2026-06-20 09:54:37 +00:00
- MainMenuPage: Menu and featureBox now use appearance default - LayoutPage: Boxes and borders now use appearance default - OverlaysPage: Alert now uses appearance default borderStyle This allows the 'a' key shortcut to change the appearance of all components simultaneously.
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()
|
|
}
|
|
}
|
|
}
|