TheNoiseClock/TheNoiseClock/Features/Clock/Views/Components/Settings/BasicDisplaySection.swift

91 lines
3.2 KiB
Swift
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//
// BasicDisplaySection.swift
// TheNoiseClock
//
// Created by Matt Bruce on 9/7/25.
//
import SwiftUI
import Bedrock
struct BasicDisplaySection: View {
@Binding var style: ClockStyle
var body: some View {
VStack(alignment: .leading, spacing: Design.Spacing.small) {
SettingsSectionHeader(
title: "Display",
systemImage: "display",
accentColor: AppAccent.primary
)
SettingsCard(backgroundColor: AppSurface.card, borderColor: AppBorder.subtle) {
VStack(spacing: 0) {
SettingsToggle(
title: "24Hour Format",
subtitle: "Use military time",
isOn: $style.use24Hour,
accentColor: AppAccent.primary
)
Rectangle()
.fill(AppBorder.subtle)
.frame(height: 1)
.padding(.horizontal, Design.Spacing.medium)
SettingsToggle(
title: "Show Seconds",
subtitle: "Display seconds in the clock",
isOn: $style.showSeconds,
accentColor: AppAccent.primary
)
if !style.use24Hour {
Rectangle()
.fill(AppBorder.subtle)
.frame(height: 1)
.padding(.horizontal, Design.Spacing.medium)
SettingsToggle(
title: "Show AM/PM",
subtitle: "Add an AM/PM indicator",
isOn: $style.showAmPm,
accentColor: AppAccent.primary
)
}
Rectangle()
.fill(AppBorder.subtle)
.frame(height: 1)
.padding(.horizontal, Design.Spacing.medium)
SettingsToggle(
title: "Auto Brightness",
subtitle: "Adapt brightness to ambient light",
isOn: $style.autoBrightness,
accentColor: AppAccent.primary
)
if UIDevice.current.orientation.isPortrait || UIDevice.current.orientation == .unknown {
Rectangle()
.fill(AppBorder.subtle)
.frame(height: 1)
.padding(.horizontal, Design.Spacing.medium)
SettingsToggle(
title: "Horizontal Mode",
subtitle: "Force a wide layout in portrait",
isOn: $style.forceHorizontalMode,
accentColor: AppAccent.primary
)
}
}
}
Text("Basic display settings for your clock.")
.font(.caption)
.foregroundStyle(AppTextColors.tertiary)
}
}
}