Просмотр исходного кода

conditionally colour popover glucose

polscm32 2 лет назад
Родитель
Сommit
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)
                 }
             }