Archived
Make the countdown narrow enough for the slot it sits in
Text(style: .timer) renders 1:23:45 once more than an hour out. An accessoryCorner has room for three or four characters beside its curved label, and a circular gauge for about the same, so the live timer overlapped what it sat next to. Replaced with a compact value — "23m", "2h", "3d" — recomputed per timeline entry, which is why the timeline now carries a mark every minute for the first hour. Both corner kinds and the gauge also get lineLimit(1) and a minimum scale factor, so an unexpectedly wide value shrinks instead of colliding. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
fdae680e02
commit
b489f10c28
@@ -24,8 +24,11 @@ struct CountdownComplicationView: View {
|
||||
Gauge(value: WatchComplicationSupport.gaugeFraction(to: target, at: entry.date)) {
|
||||
Image(systemName: "calendar")
|
||||
} currentValueLabel: {
|
||||
Text(target, style: .timer)
|
||||
.font(.system(size: 12))
|
||||
Text(WatchComplicationSupport.compactCountdown(to: target, at: entry.date,
|
||||
language: entry.language))
|
||||
.font(.system(size: 13))
|
||||
.lineLimit(1)
|
||||
.minimumScaleFactor(0.6)
|
||||
}
|
||||
.gaugeStyle(.accessoryCircularCapacity)
|
||||
.widgetAccentable()
|
||||
|
||||
Reference in New Issue
Block a user