mirror of
https://github.com/phranck/TUIkit.git
synced 2026-06-20 09:54:37 +00:00
- StatusBar now uses theme colors by default (statusBarHighlight, statusBarForeground)
- Example App MainMenuPage uses theme colors (accent, border, foreground*)
- Example App HeaderView uses theme colors
- Theme switching ('t' key) now shows visible changes
51 lines
1.1 KiB
Swift
51 lines
1.1 KiB
Swift
//
|
|
// HeaderView.swift
|
|
// TUIKitExample
|
|
//
|
|
// A reusable header component for demo pages.
|
|
//
|
|
|
|
import TUIKit
|
|
|
|
/// A styled header with title on the left and version on the right.
|
|
///
|
|
/// Used at the top of each demo page to provide consistent branding
|
|
/// and optional subtitle.
|
|
///
|
|
/// # Example
|
|
///
|
|
/// ```swift
|
|
/// HeaderView(
|
|
/// title: "My Demo",
|
|
/// subtitle: "An optional description"
|
|
/// )
|
|
/// ```
|
|
struct HeaderView: View {
|
|
let title: String
|
|
let subtitle: String?
|
|
|
|
init(title: String, subtitle: String? = nil) {
|
|
self.title = title
|
|
self.subtitle = subtitle
|
|
}
|
|
|
|
var body: some View {
|
|
VStack {
|
|
HStack {
|
|
Text(title)
|
|
.bold()
|
|
.foregroundColor(.theme.accent)
|
|
Spacer()
|
|
Text("TUIKit v\(tuiKitVersion)")
|
|
.foregroundColor(.theme.foregroundTertiary)
|
|
}
|
|
if let sub = subtitle {
|
|
Text(sub)
|
|
.foregroundColor(.theme.foregroundSecondary)
|
|
.italic()
|
|
}
|
|
Divider(character: "═")
|
|
}
|
|
}
|
|
}
|