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) .environment(\.managedObjectContext, viewContext)
.environmentObject(conductor) .environmentObject(conductor)
.padding(.horizontal, 12.0) .padding(.horizontal, 12.0)
.foregroundColor(.white) .foregroundColor(.black)
.background(Color(white: 0.1)) .background(Color(white: 0.9))
.cornerRadius(32.0, corners: [.topRight, .topLeft]) .cornerRadius(32.0, corners: [.topRight, .topLeft])
} }
} }

@ -13,12 +13,14 @@ struct CountdownDialView: View {
@ObservedObject var countdown: Countdown @ObservedObject var countdown: Countdown
@State var isEditing: Bool
var body: some View { var body: some View {
HStack { HStack {
VStack(alignment: .leading) { VStack(alignment: .leading) {
Text(countdown.activity?.name?.uppercased() ?? "") Text(countdown.activity?.name?.uppercased() ?? "")
.foregroundColor(.black) .foregroundColor(isEditing ? .white : .black)
.multilineTextAlignment(.leading) .multilineTextAlignment(.leading)
Text(countdown.duration.minuteSecond) Text(countdown.duration.minuteSecond)
.fontWeight(.semibold) .fontWeight(.semibold)
@ -32,6 +34,8 @@ struct CountdownDialView: View {
struct CountdownLiveView_Previews: PreviewProvider { struct CountdownLiveView_Previews: PreviewProvider {
static var previews: some View { 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: case true:
NavigationLink { NavigationLink {
self._editView(timer: timer, isPresented: $boringContext.isShowingNewData) self._editView(timer: timer, isPresented: $boringContext.isShowingNewData)
} label: { } label: {
@ -48,8 +47,7 @@ struct DialView: View {
} }
} }
} }.background(Color(white: self.isEditingBinding.wrappedValue ? 0.1 : 0.95))
.background(Color(white: 0.95))
.frame(width: frameSize, height: 80.0) .frame(width: frameSize, height: 80.0)
.cornerRadius(20.0) .cornerRadius(20.0)
} }
@ -59,7 +57,7 @@ struct DialView: View {
Group { Group {
switch self.timer { switch self.timer {
case let countdown as Countdown: case let countdown as Countdown:
CountdownDialView(countdown: countdown) CountdownDialView(countdown: countdown, isEditing: self.isEditingBinding.wrappedValue)
.environmentObject(Conductor.maestro) .environmentObject(Conductor.maestro)
case let alarm as Alarm: case let alarm as Alarm:
AlarmDialView(alarm: alarm) AlarmDialView(alarm: alarm)

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

Loading…
Cancel
Save