From 97b3e5aca9c6488b2961475052f5ad619d818677 Mon Sep 17 00:00:00 2001 From: Laurent Date: Tue, 14 Mar 2023 14:27:34 +0100 Subject: [PATCH] Fixes --- LeCountdown/Views/ContentView.swift | 4 ++-- LeCountdown/Views/Countdown/CountdownDialView.swift | 8 ++++++-- LeCountdown/Views/DialView.swift | 6 ++---- LeCountdown/Views/LiveTimerListView.swift | 2 -- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/LeCountdown/Views/ContentView.swift b/LeCountdown/Views/ContentView.swift index 3bf6bb9..13d93ad 100644 --- a/LeCountdown/Views/ContentView.swift +++ b/LeCountdown/Views/ContentView.swift @@ -86,8 +86,8 @@ struct ContentView: 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]) } } diff --git a/LeCountdown/Views/Countdown/CountdownDialView.swift b/LeCountdown/Views/Countdown/CountdownDialView.swift index ecec531..8c36a33 100644 --- a/LeCountdown/Views/Countdown/CountdownDialView.swift +++ b/LeCountdown/Views/Countdown/CountdownDialView.swift @@ -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) } } diff --git a/LeCountdown/Views/DialView.swift b/LeCountdown/Views/DialView.swift index 5ce60a9..adb2158 100644 --- a/LeCountdown/Views/DialView.swift +++ b/LeCountdown/Views/DialView.swift @@ -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) diff --git a/LeCountdown/Views/LiveTimerListView.swift b/LeCountdown/Views/LiveTimerListView.swift index 3188b57..fe69279 100644 --- a/LeCountdown/Views/LiveTimerListView.swift +++ b/LeCountdown/Views/LiveTimerListView.swift @@ -190,8 +190,6 @@ struct LiveTimerListView: View { var body: some View { - // ScrollView { - VStack { ForEach(conductor.liveTimers) { liveTimer in