Signed-off-by: Matt Bruce <mbrucedogs@gmail.com>
This commit is contained in:
parent
7338c576e8
commit
b630996db2
@ -23,8 +23,6 @@ class ClockStyle: Codable, Equatable {
|
||||
var digitColorHex: String = AppConstants.Defaults.digitColorHex
|
||||
var randomizeColor: Bool = false
|
||||
var glowIntensity: Double = AppConstants.Defaults.glowIntensity
|
||||
var digitScale: Double = AppConstants.Defaults.digitScale
|
||||
var stretched: Bool = true
|
||||
var backgroundHex: String = AppConstants.Defaults.backgroundColorHex
|
||||
|
||||
// MARK: - Color Theme Settings
|
||||
@ -68,8 +66,6 @@ class ClockStyle: Codable, Equatable {
|
||||
case digitColorHex
|
||||
case randomizeColor
|
||||
case glowIntensity
|
||||
case digitScale
|
||||
case stretched
|
||||
case backgroundHex
|
||||
case selectedColorTheme
|
||||
case nightModeEnabled
|
||||
@ -107,8 +103,6 @@ class ClockStyle: Codable, Equatable {
|
||||
self.digitColorHex = try container.decodeIfPresent(String.self, forKey: .digitColorHex) ?? self.digitColorHex
|
||||
self.randomizeColor = try container.decodeIfPresent(Bool.self, forKey: .randomizeColor) ?? self.randomizeColor
|
||||
self.glowIntensity = try container.decodeIfPresent(Double.self, forKey: .glowIntensity) ?? self.glowIntensity
|
||||
self.digitScale = try container.decodeIfPresent(Double.self, forKey: .digitScale) ?? self.digitScale
|
||||
self.stretched = try container.decodeIfPresent(Bool.self, forKey: .stretched) ?? self.stretched
|
||||
self.backgroundHex = try container.decodeIfPresent(String.self, forKey: .backgroundHex) ?? self.backgroundHex
|
||||
self.selectedColorTheme = try container.decodeIfPresent(String.self, forKey: .selectedColorTheme) ?? self.selectedColorTheme
|
||||
self.nightModeEnabled = try container.decodeIfPresent(Bool.self, forKey: .nightModeEnabled) ?? self.nightModeEnabled
|
||||
@ -151,8 +145,6 @@ class ClockStyle: Codable, Equatable {
|
||||
try container.encode(digitColorHex, forKey: .digitColorHex)
|
||||
try container.encode(randomizeColor, forKey: .randomizeColor)
|
||||
try container.encode(glowIntensity, forKey: .glowIntensity)
|
||||
try container.encode(digitScale, forKey: .digitScale)
|
||||
try container.encode(stretched, forKey: .stretched)
|
||||
try container.encode(backgroundHex, forKey: .backgroundHex)
|
||||
try container.encode(selectedColorTheme, forKey: .selectedColorTheme)
|
||||
try container.encode(nightModeEnabled, forKey: .nightModeEnabled)
|
||||
@ -445,8 +437,6 @@ class ClockStyle: Codable, Equatable {
|
||||
lhs.digitColorHex == rhs.digitColorHex &&
|
||||
lhs.randomizeColor == rhs.randomizeColor &&
|
||||
lhs.glowIntensity == rhs.glowIntensity &&
|
||||
lhs.digitScale == rhs.digitScale &&
|
||||
lhs.stretched == rhs.stretched &&
|
||||
lhs.backgroundHex == rhs.backgroundHex &&
|
||||
lhs.selectedColorTheme == rhs.selectedColorTheme &&
|
||||
lhs.nightModeEnabled == rhs.nightModeEnabled &&
|
||||
|
||||
@ -87,8 +87,6 @@ class ClockViewModel {
|
||||
style.forceHorizontalMode = newStyle.forceHorizontalMode
|
||||
style.digitColorHex = newStyle.digitColorHex
|
||||
style.glowIntensity = newStyle.glowIntensity
|
||||
style.digitScale = newStyle.digitScale
|
||||
style.stretched = newStyle.stretched
|
||||
style.clockOpacity = newStyle.clockOpacity
|
||||
style.fontFamily = newStyle.fontFamily
|
||||
style.fontWeight = newStyle.fontWeight
|
||||
|
||||
@ -56,7 +56,6 @@ struct ClockView: View {
|
||||
.padding(.trailing, symmetricInset)
|
||||
}
|
||||
.frame(width: screenWidth, height: screenHeight)
|
||||
.border(.purple, width: 3) // Debug: Full screen ZStack
|
||||
.overlay(alignment: .bottomLeading) {
|
||||
if Self.debugShowSafeAreas {
|
||||
safeAreaDebugInfo(
|
||||
|
||||
@ -31,8 +31,6 @@ struct ClockDisplayContainer: View {
|
||||
showAmPm: style.showAmPm,
|
||||
digitColor: style.effectiveDigitColor,
|
||||
glowIntensity: style.glowIntensity,
|
||||
manualScale: style.digitScale,
|
||||
stretched: style.stretched,
|
||||
clockOpacity: style.clockOpacity,
|
||||
fontFamily: style.fontFamily,
|
||||
fontWeight: style.fontWeight,
|
||||
|
||||
@ -27,25 +27,6 @@ struct AdvancedAppearanceSection: View {
|
||||
accentColor: AppAccent.primary
|
||||
)
|
||||
|
||||
SettingsToggle(
|
||||
title: "Stretched (Auto‑Fit)",
|
||||
subtitle: "Fit the clock to available space",
|
||||
isOn: $style.stretched,
|
||||
accentColor: AppAccent.primary
|
||||
)
|
||||
|
||||
if !style.stretched {
|
||||
SettingsSlider(
|
||||
title: "Size",
|
||||
subtitle: "Manual scaling when auto‑fit is off",
|
||||
value: $style.digitScale,
|
||||
in: 0.0...1.0,
|
||||
step: 0.01,
|
||||
format: SliderFormat.percentage,
|
||||
accentColor: AppAccent.primary
|
||||
)
|
||||
}
|
||||
|
||||
SettingsSlider(
|
||||
title: "Glow",
|
||||
subtitle: "Adjust the glow intensity",
|
||||
|
||||
@ -30,8 +30,6 @@ struct TimeDisplayView: View {
|
||||
let showAmPm: Bool
|
||||
let digitColor: Color
|
||||
let glowIntensity: Double
|
||||
let manualScale: Double
|
||||
let stretched: Bool
|
||||
let clockOpacity: Double
|
||||
let fontFamily: FontFamily
|
||||
let fontWeight: Font.Weight
|
||||
@ -116,9 +114,6 @@ struct TimeDisplayView: View {
|
||||
let dotSpacing = portrait
|
||||
? fontSize * Layout.dotSpacingPortraitMultiplier
|
||||
: fontSize * Layout.dotSpacingLandscapeMultiplier
|
||||
|
||||
// Simple scaling - let the content size naturally and apply manual scale
|
||||
let finalScale = stretched ? 1.0 : CGFloat(max(0.1, min(manualScale, 1.0)))
|
||||
|
||||
// Time display with consistent centering and stable layout
|
||||
return Group {
|
||||
@ -179,8 +174,6 @@ struct TimeDisplayView: View {
|
||||
}
|
||||
}
|
||||
.offset(y: portraitMode && forceHorizontalMode ? -containerSize.height * 0.10 : 0) // Push up in horizontal mode
|
||||
.scaleEffect(finalScale, anchor: .center)
|
||||
.animation(.smooth(duration: Design.Animation.standard), value: finalScale)
|
||||
.animation(.smooth(duration: Design.Animation.standard), value: showSeconds) // Smooth animation for seconds toggle
|
||||
.minimumScaleFactor(0.1)
|
||||
.clipped() // Prevent overflow beyond bounds
|
||||
@ -340,8 +333,6 @@ struct TimeDisplayView: View {
|
||||
showAmPm: true,
|
||||
digitColor: .white,
|
||||
glowIntensity: 0.2,
|
||||
manualScale: 1.0,
|
||||
stretched: true,
|
||||
clockOpacity: 1.0,
|
||||
fontFamily: .verdana,
|
||||
fontWeight: .medium,
|
||||
|
||||
@ -50,7 +50,6 @@ enum AppConstants {
|
||||
static let digitColorHex = "#FFFFFF"
|
||||
static let backgroundColorHex = "#000000"
|
||||
static let glowIntensity = 0.6
|
||||
static let digitScale = 1.0
|
||||
static let clockOpacity = 0.5
|
||||
static let overlayOpacity = 0.5
|
||||
static let minFontSize = 20.0
|
||||
|
||||
@ -236,8 +236,6 @@ private struct TestContentView: View {
|
||||
showAmPm: true,
|
||||
digitColor: .primary,
|
||||
glowIntensity: 0.5,
|
||||
manualScale: 1.0,
|
||||
stretched: false,
|
||||
clockOpacity: 1.0,
|
||||
fontFamily: font,
|
||||
fontWeight: fontWeight,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user