final version??

This commit is contained in:
delli 2026-04-23 15:46:49 +02:00
commit cc09f17074
5 changed files with 51 additions and 30 deletions

View file

@ -45,10 +45,6 @@ struct LockScreenTimerWidget: View {
}
}
private func displayFont(size: CGFloat) -> Font {
.system(size: size, weight: .semibold, design: .rounded)
}
private var hasHoursComponent: Bool {
abs(timerManager.remainingTime) >= 3600
}
@ -57,12 +53,6 @@ struct LockScreenTimerWidget: View {
abs(timerManager.remainingTime) >= 36_000 // 10 hours or more
}
private var titleFrameWidth: CGFloat {
if hasDoubleDigitHours { return 60 }
if hasHoursComponent { return 80 }
return 110
}
private var countdownFrameWidth: CGFloat {
if hasDoubleDigitHours { return 200 }
if hasHoursComponent { return 185 }
@ -74,10 +64,6 @@ struct LockScreenTimerWidget: View {
return .system(size: baseSize, weight: .bold, design: .rounded)
}
private var timerLabel: String {
timerManager.timerName.isEmpty ? "Timer" : timerManager.timerName
}
private var countdownText: String {
timerManager.formattedRemainingTime()
}
@ -260,19 +246,6 @@ struct LockScreenTimerWidget: View {
.layoutPriority(2)
}
private var titleSection: some View {
MarqueeText(
.constant(timerLabel),
font: displayFont(size: 15),
nsFont: .title3,
textColor: accentColor,
minDuration: 0.16,
frameWidth: titleFrameWidth
)
.frame(maxWidth: .infinity, alignment: .center)
.layoutPriority(0)
}
private var accentRibbon: some View {
Capsule()
.fill(accentGradient)