Signed-off-by: Matt Bruce <mbrucedogs@gmail.com>
This commit is contained in:
parent
3190d610f3
commit
0188d681a9
@ -18,8 +18,18 @@ struct ClockDisplayContainer: View {
|
|||||||
// MARK: - Body
|
// MARK: - Body
|
||||||
var body: some View {
|
var body: some View {
|
||||||
GeometryReader { geometry in
|
GeometryReader { geometry in
|
||||||
ZStack {
|
let isPortrait = geometry.size.height >= geometry.size.width
|
||||||
// Time display - fills entire available space
|
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(
|
TimeDisplayView(
|
||||||
date: currentTime,
|
date: currentTime,
|
||||||
use24Hour: style.use24Hour,
|
use24Hour: style.use24Hour,
|
||||||
@ -35,6 +45,8 @@ struct ClockDisplayContainer: View {
|
|||||||
fontDesign: style.fontDesign
|
fontDesign: style.fontDesign
|
||||||
)
|
)
|
||||||
.transition(.opacity)
|
.transition(.opacity)
|
||||||
|
|
||||||
|
Spacer()
|
||||||
}
|
}
|
||||||
.scaleEffect(isDisplayMode ? 1.0 : 0.995)
|
.scaleEffect(isDisplayMode ? 1.0 : 0.995)
|
||||||
.animation(UIConstants.AnimationCurves.smooth, value: isDisplayMode)
|
.animation(UIConstants.AnimationCurves.smooth, value: isDisplayMode)
|
||||||
|
|||||||
@ -217,12 +217,6 @@ struct TimeDisplayView: View {
|
|||||||
.animation(UIConstants.AnimationCurves.smooth, value: showSeconds) // Smooth animation for seconds toggle
|
.animation(UIConstants.AnimationCurves.smooth, value: showSeconds) // Smooth animation for seconds toggle
|
||||||
.minimumScaleFactor(0.1)
|
.minimumScaleFactor(0.1)
|
||||||
.clipped() // Prevent overflow beyond bounds
|
.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)
|
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
||||||
.onOrientationChange() // Force updates on orientation changes
|
.onOrientationChange() // Force updates on orientation changes
|
||||||
@ -339,7 +333,6 @@ struct TimeDisplayView: View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
.frame(width: totalWidth, alignment: .center)
|
.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
|
// Calculate width of text for the given font - this ensures consistent width
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user