Signed-off-by: Matt Bruce <mbrucedogs@gmail.com>

This commit is contained in:
Matt Bruce 2025-09-08 12:21:04 -05:00
parent 3190d610f3
commit 0188d681a9
2 changed files with 14 additions and 9 deletions

View File

@ -18,8 +18,18 @@ struct ClockDisplayContainer: View {
// MARK: - Body
var body: some View {
GeometryReader { geometry in
ZStack {
// Time display - fills entire available space
let isPortrait = geometry.size.height >= geometry.size.width
let hasOverlay = style.showBattery || style.showDate
let topSpacing = hasOverlay ? (isPortrait ? UIConstants.Spacing.huge : UIConstants.Spacing.large) : 0
VStack(spacing: 0) {
// Top spacing to account for overlay
if hasOverlay {
Spacer()
.frame(height: topSpacing)
}
// Time display - fills remaining space
TimeDisplayView(
date: currentTime,
use24Hour: style.use24Hour,
@ -35,6 +45,8 @@ struct ClockDisplayContainer: View {
fontDesign: style.fontDesign
)
.transition(.opacity)
Spacer()
}
.scaleEffect(isDisplayMode ? 1.0 : 0.995)
.animation(UIConstants.AnimationCurves.smooth, value: isDisplayMode)

View File

@ -217,12 +217,6 @@ struct TimeDisplayView: View {
.animation(UIConstants.AnimationCurves.smooth, value: showSeconds) // Smooth animation for seconds toggle
.minimumScaleFactor(0.1)
.clipped() // Prevent overflow beyond bounds
.overlay(
// Debug border to visualize actual bounds
Rectangle()
.stroke(Color.red, lineWidth: 2)
.opacity(0.5)
)
}
.frame(maxWidth: .infinity, maxHeight: .infinity)
.onOrientationChange() // Force updates on orientation changes
@ -339,7 +333,6 @@ struct TimeDisplayView: View {
}
}
.frame(width: totalWidth, alignment: .center)
.border(Color.blue.opacity(0.5), width: 1)
}
// Calculate width of text for the given font - this ensures consistent width