Use monospaced font for the timer

release
Laurent 3 years ago
parent 9ff2e184b6
commit 275b1f7269
  1. 11
      LeCountdown/Views/ContentView.swift

@ -18,7 +18,7 @@ struct CountdownLiveView: View {
VStack { VStack {
Text(countdown.activity?.name ?? "") Text(countdown.activity?.name ?? "")
if let dateInterval = environment.notificationDates[countdown.stringId] { if let dateInterval = environment.notificationDates[countdown.stringId] {
Text(dateInterval.end, style: .timer) Text(dateInterval.end, style: .timer).monospaced()
Button { Button {
CountdownScheduler.master.cancelCurrentNotifications(countdown: countdown) CountdownScheduler.master.cancelCurrentNotifications(countdown: countdown)
} label: { } label: {
@ -26,7 +26,7 @@ struct CountdownLiveView: View {
} }
} else { } else {
Text(countdown.duration.minuteSecond) Text(countdown.duration.minuteSecond).monospaced()
} }
} }
.font(.title2) .font(.title2)
@ -205,13 +205,6 @@ fileprivate extension Countdown {
} }
//private let itemFormatter: DateFormatter = {
// let formatter = DateFormatter()
// formatter.dateStyle = .short
// formatter.timeStyle = .medium
// return formatter
//}()
struct ContentView_Previews: PreviewProvider { struct ContentView_Previews: PreviewProvider {
static var previews: some View { static var previews: some View {
ContentView().environment(\.managedObjectContext, PersistenceController.preview.container.viewContext) ContentView().environment(\.managedObjectContext, PersistenceController.preview.container.viewContext)

Loading…
Cancel
Save