Improve lockscreen widget

main
Laurent 3 years ago
parent 863ee350d9
commit 762d7b62b3
  1. 4
      LaunchWidget/LaunchWidget.swift
  2. 14
      LaunchWidget/SingleTimerView.swift

@ -99,7 +99,7 @@ struct LaunchWidgetEntryView : View {
} }
} }
.frame(maxWidth: .infinity, maxHeight: .infinity) .frame(maxWidth: .infinity, maxHeight: .infinity)
.background(Color.white.opacity(0.1)) .background(Color.white.opacity(0.2))
case .accessoryRectangular: case .accessoryRectangular:
Group { Group {
if let timer = entry.timers.first { if let timer = entry.timers.first {
@ -109,7 +109,7 @@ struct LaunchWidgetEntryView : View {
} }
} }
.frame(maxWidth: .infinity, maxHeight: .infinity) .frame(maxWidth: .infinity, maxHeight: .infinity)
.background(Color.white.opacity(0.1)) .background(Color.white.opacity(0.2))
.cornerRadius(16.0) .cornerRadius(16.0)
default: default:
MultiCountdownView(timers: entry.timers) MultiCountdownView(timers: entry.timers)

@ -94,10 +94,16 @@ struct LockScreenCountdownView: View {
var body: some View { var body: some View {
VStack { VStack {
Text(activityName.uppercased()) let title = self.timer.displayName.uppercased()
if let countdown = self.timer as? Countdown { switch self.family {
Text(countdown.duration.minuteSecond) case .accessoryCircular:
.monospaced() Text(title)
default:
Text(title)
if let countdown = self.timer as? Countdown {
Text(countdown.duration.minuteSecond)
.monospaced()
}
} }
} }
.multilineTextAlignment(.center) .multilineTextAlignment(.center)

Loading…
Cancel
Save