Laurent 3 years ago
parent 1df168f4a8
commit 97b3e5aca9
  1. 4
      LeCountdown/Views/ContentView.swift
  2. 8
      LeCountdown/Views/Countdown/CountdownDialView.swift
  3. 6
      LeCountdown/Views/DialView.swift
  4. 2
      LeCountdown/Views/LiveTimerListView.swift

@ -86,8 +86,8 @@ struct ContentView<T : AbstractTimer>: View {
.environment(\.managedObjectContext, viewContext)
.environmentObject(conductor)
.padding(.horizontal, 12.0)
.foregroundColor(.white)
.background(Color(white: 0.1))
.foregroundColor(.black)
.background(Color(white: 0.9))
.cornerRadius(32.0, corners: [.topRight, .topLeft])
}
}

@ -13,12 +13,14 @@ struct CountdownDialView: View {
@ObservedObject var countdown: Countdown
@State var isEditing: Bool
var body: some View {
HStack {
VStack(alignment: .leading) {
Text(countdown.activity?.name?.uppercased() ?? "")
.foregroundColor(.black)
.foregroundColor(isEditing ? .white : .black)
.multilineTextAlignment(.leading)
Text(countdown.duration.minuteSecond)
.fontWeight(.semibold)
@ -32,6 +34,8 @@ struct CountdownDialView: View {
struct CountdownLiveView_Previews: PreviewProvider {
static var previews: some View {
CountdownDialView(countdown: Countdown.fake(context: PersistenceController.preview.container.viewContext)).background(.cyan).environmentObject(Conductor.maestro)
CountdownDialView(countdown: Countdown.fake(context: PersistenceController.preview.container.viewContext), isEditing: false)
.background(.cyan)
.environmentObject(Conductor.maestro)
}
}

@ -36,7 +36,6 @@ struct DialView: View {
}
}
case true:
NavigationLink {
self._editView(timer: timer, isPresented: $boringContext.isShowingNewData)
} label: {
@ -48,8 +47,7 @@ struct DialView: View {
}
}
}
.background(Color(white: 0.95))
}.background(Color(white: self.isEditingBinding.wrappedValue ? 0.1 : 0.95))
.frame(width: frameSize, height: 80.0)
.cornerRadius(20.0)
}
@ -59,7 +57,7 @@ struct DialView: View {
Group {
switch self.timer {
case let countdown as Countdown:
CountdownDialView(countdown: countdown)
CountdownDialView(countdown: countdown, isEditing: self.isEditingBinding.wrappedValue)
.environmentObject(Conductor.maestro)
case let alarm as Alarm:
AlarmDialView(alarm: alarm)

@ -190,8 +190,6 @@ struct LiveTimerListView: View {
var body: some View {
// ScrollView {
VStack {
ForEach(conductor.liveTimers) { liveTimer in

Loading…
Cancel
Save