Improve lockscreen widget

main
Laurent 3 years ago
parent 863ee350d9
commit 762d7b62b3
  1. 4
      LaunchWidget/LaunchWidget.swift
  2. 8
      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,12 +94,18 @@ struct LockScreenCountdownView: View {
var body: some View { var body: some View {
VStack { VStack {
Text(activityName.uppercased()) let title = self.timer.displayName.uppercased()
switch self.family {
case .accessoryCircular:
Text(title)
default:
Text(title)
if let countdown = self.timer as? Countdown { if let countdown = self.timer as? Countdown {
Text(countdown.duration.minuteSecond) Text(countdown.duration.minuteSecond)
.monospaced() .monospaced()
} }
} }
}
.multilineTextAlignment(.center) .multilineTextAlignment(.center)
.foregroundColor(Color.white) .foregroundColor(Color.white)
.font(self.font) .font(self.font)

Loading…
Cancel
Save