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 digitColorHex: String = AppConstants.Defaults.digitColorHex
|
||||||
var randomizeColor: Bool = false
|
var randomizeColor: Bool = false
|
||||||
var glowIntensity: Double = AppConstants.Defaults.glowIntensity
|
var glowIntensity: Double = AppConstants.Defaults.glowIntensity
|
||||||
var digitScale: Double = AppConstants.Defaults.digitScale
|
|
||||||
var stretched: Bool = true
|
|
||||||
var backgroundHex: String = AppConstants.Defaults.backgroundColorHex
|
var backgroundHex: String = AppConstants.Defaults.backgroundColorHex
|
||||||
|
|
||||||
// MARK: - Color Theme Settings
|
// MARK: - Color Theme Settings
|
||||||
@ -68,8 +66,6 @@ class ClockStyle: Codable, Equatable {
|
|||||||
case digitColorHex
|
case digitColorHex
|
||||||
case randomizeColor
|
case randomizeColor
|
||||||
case glowIntensity
|
case glowIntensity
|
||||||
case digitScale
|
|
||||||
case stretched
|
|
||||||
case backgroundHex
|
case backgroundHex
|
||||||
case selectedColorTheme
|
case selectedColorTheme
|
||||||
case nightModeEnabled
|
case nightModeEnabled
|
||||||
@ -107,8 +103,6 @@ class ClockStyle: Codable, Equatable {
|
|||||||
self.digitColorHex = try container.decodeIfPresent(String.self, forKey: .digitColorHex) ?? self.digitColorHex
|
self.digitColorHex = try container.decodeIfPresent(String.self, forKey: .digitColorHex) ?? self.digitColorHex
|
||||||
self.randomizeColor = try container.decodeIfPresent(Bool.self, forKey: .randomizeColor) ?? self.randomizeColor
|
self.randomizeColor = try container.decodeIfPresent(Bool.self, forKey: .randomizeColor) ?? self.randomizeColor
|
||||||
self.glowIntensity = try container.decodeIfPresent(Double.self, forKey: .glowIntensity) ?? self.glowIntensity
|
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.backgroundHex = try container.decodeIfPresent(String.self, forKey: .backgroundHex) ?? self.backgroundHex
|
||||||
self.selectedColorTheme = try container.decodeIfPresent(String.self, forKey: .selectedColorTheme) ?? self.selectedColorTheme
|
self.selectedColorTheme = try container.decodeIfPresent(String.self, forKey: .selectedColorTheme) ?? self.selectedColorTheme
|
||||||
self.nightModeEnabled = try container.decodeIfPresent(Bool.self, forKey: .nightModeEnabled) ?? self.nightModeEnabled
|
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(digitColorHex, forKey: .digitColorHex)
|
||||||
try container.encode(randomizeColor, forKey: .randomizeColor)
|
try container.encode(randomizeColor, forKey: .randomizeColor)
|
||||||
try container.encode(glowIntensity, forKey: .glowIntensity)
|
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(backgroundHex, forKey: .backgroundHex)
|
||||||
try container.encode(selectedColorTheme, forKey: .selectedColorTheme)
|
try container.encode(selectedColorTheme, forKey: .selectedColorTheme)
|
||||||
try container.encode(nightModeEnabled, forKey: .nightModeEnabled)
|
try container.encode(nightModeEnabled, forKey: .nightModeEnabled)
|
||||||
@ -445,8 +437,6 @@ class ClockStyle: Codable, Equatable {
|
|||||||
lhs.digitColorHex == rhs.digitColorHex &&
|
lhs.digitColorHex == rhs.digitColorHex &&
|
||||||
lhs.randomizeColor == rhs.randomizeColor &&
|
lhs.randomizeColor == rhs.randomizeColor &&
|
||||||
lhs.glowIntensity == rhs.glowIntensity &&
|
lhs.glowIntensity == rhs.glowIntensity &&
|
||||||
lhs.digitScale == rhs.digitScale &&
|
|
||||||
lhs.stretched == rhs.stretched &&
|
|
||||||
lhs.backgroundHex == rhs.backgroundHex &&
|
lhs.backgroundHex == rhs.backgroundHex &&
|
||||||
lhs.selectedColorTheme == rhs.selectedColorTheme &&
|
lhs.selectedColorTheme == rhs.selectedColorTheme &&
|
||||||
lhs.nightModeEnabled == rhs.nightModeEnabled &&
|
lhs.nightModeEnabled == rhs.nightModeEnabled &&
|
||||||
|
|||||||
@ -87,8 +87,6 @@ class ClockViewModel {
|
|||||||
style.forceHorizontalMode = newStyle.forceHorizontalMode
|
style.forceHorizontalMode = newStyle.forceHorizontalMode
|
||||||
style.digitColorHex = newStyle.digitColorHex
|
style.digitColorHex = newStyle.digitColorHex
|
||||||
style.glowIntensity = newStyle.glowIntensity
|
style.glowIntensity = newStyle.glowIntensity
|
||||||
style.digitScale = newStyle.digitScale
|
|
||||||
style.stretched = newStyle.stretched
|
|
||||||
style.clockOpacity = newStyle.clockOpacity
|
style.clockOpacity = newStyle.clockOpacity
|
||||||
style.fontFamily = newStyle.fontFamily
|
style.fontFamily = newStyle.fontFamily
|
||||||
style.fontWeight = newStyle.fontWeight
|
style.fontWeight = newStyle.fontWeight
|
||||||
|
|||||||
@ -56,7 +56,6 @@ struct ClockView: View {
|
|||||||
.padding(.trailing, symmetricInset)
|
.padding(.trailing, symmetricInset)
|
||||||
}
|
}
|
||||||
.frame(width: screenWidth, height: screenHeight)
|
.frame(width: screenWidth, height: screenHeight)
|
||||||
.border(.purple, width: 3) // Debug: Full screen ZStack
|
|
||||||
.overlay(alignment: .bottomLeading) {
|
.overlay(alignment: .bottomLeading) {
|
||||||
if Self.debugShowSafeAreas {
|
if Self.debugShowSafeAreas {
|
||||||
safeAreaDebugInfo(
|
safeAreaDebugInfo(
|
||||||
|
|||||||
@ -31,8 +31,6 @@ struct ClockDisplayContainer: View {
|
|||||||
showAmPm: style.showAmPm,
|
showAmPm: style.showAmPm,
|
||||||
digitColor: style.effectiveDigitColor,
|
digitColor: style.effectiveDigitColor,
|
||||||
glowIntensity: style.glowIntensity,
|
glowIntensity: style.glowIntensity,
|
||||||
manualScale: style.digitScale,
|
|
||||||
stretched: style.stretched,
|
|
||||||
clockOpacity: style.clockOpacity,
|
clockOpacity: style.clockOpacity,
|
||||||
fontFamily: style.fontFamily,
|
fontFamily: style.fontFamily,
|
||||||
fontWeight: style.fontWeight,
|
fontWeight: style.fontWeight,
|
||||||
|
|||||||
@ -27,25 +27,6 @@ struct AdvancedAppearanceSection: View {
|
|||||||
accentColor: AppAccent.primary
|
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(
|
SettingsSlider(
|
||||||
title: "Glow",
|
title: "Glow",
|
||||||
subtitle: "Adjust the glow intensity",
|
subtitle: "Adjust the glow intensity",
|
||||||
|
|||||||
@ -30,8 +30,6 @@ struct TimeDisplayView: View {
|
|||||||
let showAmPm: Bool
|
let showAmPm: Bool
|
||||||
let digitColor: Color
|
let digitColor: Color
|
||||||
let glowIntensity: Double
|
let glowIntensity: Double
|
||||||
let manualScale: Double
|
|
||||||
let stretched: Bool
|
|
||||||
let clockOpacity: Double
|
let clockOpacity: Double
|
||||||
let fontFamily: FontFamily
|
let fontFamily: FontFamily
|
||||||
let fontWeight: Font.Weight
|
let fontWeight: Font.Weight
|
||||||
@ -116,9 +114,6 @@ struct TimeDisplayView: View {
|
|||||||
let dotSpacing = portrait
|
let dotSpacing = portrait
|
||||||
? fontSize * Layout.dotSpacingPortraitMultiplier
|
? fontSize * Layout.dotSpacingPortraitMultiplier
|
||||||
: fontSize * Layout.dotSpacingLandscapeMultiplier
|
: 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
|
// Time display with consistent centering and stable layout
|
||||||
return Group {
|
return Group {
|
||||||
@ -179,8 +174,6 @@ struct TimeDisplayView: View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
.offset(y: portraitMode && forceHorizontalMode ? -containerSize.height * 0.10 : 0) // Push up in horizontal mode
|
.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
|
.animation(.smooth(duration: Design.Animation.standard), value: showSeconds) // Smooth animation for seconds toggle
|
||||||
.minimumScaleFactor(0.1)
|
.minimumScaleFactor(0.1)
|
||||||
.clipped() // Prevent overflow beyond bounds
|
.clipped() // Prevent overflow beyond bounds
|
||||||
@ -340,8 +333,6 @@ struct TimeDisplayView: View {
|
|||||||
showAmPm: true,
|
showAmPm: true,
|
||||||
digitColor: .white,
|
digitColor: .white,
|
||||||
glowIntensity: 0.2,
|
glowIntensity: 0.2,
|
||||||
manualScale: 1.0,
|
|
||||||
stretched: true,
|
|
||||||
clockOpacity: 1.0,
|
clockOpacity: 1.0,
|
||||||
fontFamily: .verdana,
|
fontFamily: .verdana,
|
||||||
fontWeight: .medium,
|
fontWeight: .medium,
|
||||||
|
|||||||
@ -50,7 +50,6 @@ enum AppConstants {
|
|||||||
static let digitColorHex = "#FFFFFF"
|
static let digitColorHex = "#FFFFFF"
|
||||||
static let backgroundColorHex = "#000000"
|
static let backgroundColorHex = "#000000"
|
||||||
static let glowIntensity = 0.6
|
static let glowIntensity = 0.6
|
||||||
static let digitScale = 1.0
|
|
||||||
static let clockOpacity = 0.5
|
static let clockOpacity = 0.5
|
||||||
static let overlayOpacity = 0.5
|
static let overlayOpacity = 0.5
|
||||||
static let minFontSize = 20.0
|
static let minFontSize = 20.0
|
||||||
|
|||||||
@ -236,8 +236,6 @@ private struct TestContentView: View {
|
|||||||
showAmPm: true,
|
showAmPm: true,
|
||||||
digitColor: .primary,
|
digitColor: .primary,
|
||||||
glowIntensity: 0.5,
|
glowIntensity: 0.5,
|
||||||
manualScale: 1.0,
|
|
||||||
stretched: false,
|
|
||||||
clockOpacity: 1.0,
|
clockOpacity: 1.0,
|
||||||
fontFamily: font,
|
fontFamily: font,
|
||||||
fontWeight: fontWeight,
|
fontWeight: fontWeight,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user