From 0188d681a9d4b97f14f1cf86ce1135b4eb476807 Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Mon, 8 Sep 2025 12:21:04 -0500 Subject: [PATCH] Signed-off-by: Matt Bruce --- .../Clock/Components/ClockDisplayContainer.swift | 16 ++++++++++++++-- .../Views/Clock/Components/TimeDisplayView.swift | 7 ------- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/TheNoiseClock/Views/Clock/Components/ClockDisplayContainer.swift b/TheNoiseClock/Views/Clock/Components/ClockDisplayContainer.swift index 2ad15b1..57dcf03 100644 --- a/TheNoiseClock/Views/Clock/Components/ClockDisplayContainer.swift +++ b/TheNoiseClock/Views/Clock/Components/ClockDisplayContainer.swift @@ -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) diff --git a/TheNoiseClock/Views/Clock/Components/TimeDisplayView.swift b/TheNoiseClock/Views/Clock/Components/TimeDisplayView.swift index ec068f6..6b81631 100644 --- a/TheNoiseClock/Views/Clock/Components/TimeDisplayView.swift +++ b/TheNoiseClock/Views/Clock/Components/TimeDisplayView.swift @@ -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