Преглед на файлове

conditionally colour popover glucose

polscm32 преди 2 години
родител
ревизия
8e1c0d6fb5
променени са 1 файла, в които са добавени 4 реда и са изтрити 0 реда
  1. 4 0
      FreeAPS/Sources/Modules/Home/View/Chart/MainChartView.swift

+ 4 - 0
FreeAPS/Sources/Modules/Home/View/Chart/MainChartView.swift

@@ -265,6 +265,10 @@ extension MainChartView {
                 HStack {
                     Text(glucoseToShow.formatted(.number.precision(units == .mmolL ? .fractionLength(1) : .fractionLength(0))))
                         .fontWeight(.bold)
+                        .foregroundStyle(
+                            Decimal(sgv) < lowGlucose ? Color
+                                .red : (Decimal(sgv) > highGlucose ? Color.orange : Color.primary)
+                        )
                     Text(units.rawValue).foregroundColor(.secondary)
                 }
             }