mirror of
https://github.com/FBukovina/Atoll.git
synced 2026-10-27 15:14:33 +00:00
final version??
This commit is contained in:
parent
f04de8f54a
commit
cc09f17074
5 changed files with 51 additions and 30 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue