Jelajahi Sumber

Different color on vertical current time line depending on light mode or dark mode (light mode: black, dark mode: white)

(cherry picked from commit 0921a851abbefc84c5dd48cc1bcb49134e70735c)
Jon Mårtensson 5 tahun lalu
induk
melakukan
521f011a18

+ 5 - 2
FreeAPS/Sources/Modules/Home/View/Chart/MainChartView.swift

@@ -166,7 +166,6 @@ struct MainChartView: View {
             tempBasalPath.fill(Color.tempBasal.opacity(0.5)).scaleEffect(x: 1, y: -1)
             tempBasalPath.stroke(Color.tempBasal, lineWidth: 1).scaleEffect(x: 1, y: -1)
             regularBasalPath.stroke(Color.tempBasal, style: StrokeStyle(lineWidth: 1, dash: [3])).scaleEffect(x: 1, y: -1)
-//           regularBasalPath.stroke(style: StrokeStyle(lineWidth: 1, dash: [3]))
         }
         .frame(width: fullGlucoseWidth(viewWidth: fullSize.width) + additionalWidth(viewWidth: fullSize.width))
         .frame(maxHeight: Config.basalHeight)
@@ -204,6 +203,8 @@ struct MainChartView: View {
         .frame(width: fullGlucoseWidth(viewWidth: fullSize.width) + additionalWidth(viewWidth: fullSize.width))
     }
 
+    @Environment(\.colorScheme) var colorScheme
+
     private func xGridView(fullSize: CGSize) -> some View {
         ZStack {
             Path { path in
@@ -222,7 +223,9 @@ struct MainChartView: View {
                 path.move(to: CGPoint(x: x, y: 0))
                 path.addLine(to: CGPoint(x: x, y: fullSize.height - 20))
             }
-            .stroke(Color.secondary, style: StrokeStyle(lineWidth: 0.5, dash: [5]))
+            .stroke(colorScheme == .dark ? Color.white : Color.black,                             // current time as vertical line
+            style: StrokeStyle(lineWidth: 0.5, dash: [2])
+            )
         }
     }