Explorar o código

Merge branch 'forecast-chart' of https://github.com/polscm32/Open-iAPS into forecast-chart

polscm32 aka Marvout hai 1 ano
pai
achega
e0be6b817c

+ 29 - 33
FreeAPS/Sources/Modules/Home/View/Chart/MainChartView.swift

@@ -382,51 +382,47 @@ extension MainChartView {
         if let sgv = selectedGlucose?.glucose {
             let glucoseToShow = Decimal(sgv) * conversionFactor
             VStack(alignment: .leading) {
-                Text(selectedGlucose?.date?.formatted(.dateTime.hour().minute(.twoDigits)) ?? "")
-                    .font(.body)
+                HStack {
+                    Image(systemName: "clock")
+                    Text(selectedGlucose?.date?.formatted(.dateTime.hour().minute(.twoDigits)) ?? "")
+                        .font(.body).bold()
+                }.font(.body).padding(.bottom, 5)
+
                 HStack {
                     Text(glucoseToShow.formatted(.number.precision(units == .mmolL ? .fractionLength(1) : .fractionLength(0))))
-                        .font(.body)
-                        .fontWeight(.bold)
-                        .foregroundStyle(
-                            Decimal(sgv) < lowGlucose ? Color
-                                .red : (Decimal(sgv) > highGlucose ? Color.orange : Color.primary)
-                        )
-                    Text(units.rawValue)
-                        .foregroundColor(.secondary)
-                        .font(.footnote)
+                        .bold()
+                        + Text(" \(units.rawValue)")
+                }.foregroundStyle(
+                    Decimal(sgv) < lowGlucose ? Color
+                        .red : (Decimal(sgv) > highGlucose ? Color.orange : Color.primary)
+                ).font(.body)
+
+                if let selectedIOBValue, let iob = selectedIOBValue.iob {
+                    HStack {
+                        Image(systemName: "syringe.fill").frame(width: 15)
+                        Text(bolusFormatter.string(from: iob) ?? "")
+                            .bold()
+                            + Text(NSLocalizedString(" U", comment: "Insulin unit"))
+                    }.foregroundStyle(Color.insulin).font(.body)
                 }
+
                 if let selectedCOBValue {
                     HStack {
+                        Image(systemName: "fork.knife").frame(width: 15)
                         Text(carbsFormatter.string(from: selectedCOBValue.cob as NSNumber) ?? "")
-                            .font(.body)
-                            .fontWeight(.bold)
-                            .foregroundStyle(Color.orange)
-                        Text(NSLocalizedString(" g", comment: "gram of carbs"))
-                            .foregroundStyle(Color.secondary)
-                            .font(.footnote)
-                    }
-                }
-                if let selectedIOBValue, let iob = selectedIOBValue.iob {
-                    HStack {
-                        Text(bolusFormatter.string(from: iob) ?? "")
-                            .font(.body)
-                            .fontWeight(.bold)
-                            .foregroundStyle(Color.darkerBlue)
-                        Text(NSLocalizedString(" U", comment: "Insulin unit"))
-                            .foregroundStyle(Color.secondary)
-                            .font(.footnote)
-                    }
+                            .bold()
+                            + Text(NSLocalizedString(" g", comment: "gram of carbs"))
+                    }.foregroundStyle(Color.orange).font(.body)
                 }
             }
-            .padding(6)
+            .padding()
             .background {
                 RoundedRectangle(cornerRadius: 4)
-                    .fill(Color.gray.opacity(0.7))
-                    .shadow(color: Color.darkerBlue, radius: 2)
+                    .fill(Color.chart.opacity(0.85))
+                    .shadow(color: Color.secondary, radius: 2)
                     .overlay(
                         RoundedRectangle(cornerRadius: 4)
-                            .stroke(Color.darkerBlue, lineWidth: 2)
+                            .stroke(Color.secondary, lineWidth: 2)
                     )
             }
         }

+ 2 - 2
Trio.xcworkspace/xcshareddata/swiftpm/Package.resolved

@@ -1,5 +1,5 @@
 {
-  "originHash" : "f5c836c216c4ca7d356e3777e58d6d4f9502b03f3974891349eb775f4c4cf750",
+  "originHash" : "59ac7eba66375d6eb406e758cb0b9964f4b3b0ae45c5665596f00384c32262b9",
   "pins" : [
     {
       "identity" : "cryptoswift",
@@ -49,7 +49,7 @@
     {
       "identity" : "swiftcharts",
       "kind" : "remoteSourceControl",
-      "location" : "https://github.com/ivanschuetz/SwiftCharts",
+      "location" : "https://github.com/ivanschuetz/SwiftCharts.git",
       "state" : {
         "branch" : "master",
         "revision" : "c354c1945bb35a1f01b665b22474f6db28cba4a2"