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

Adjust Max IOB warning in bolus calc popup

Mike Plante 1 год назад
Родитель
Сommit
145203c8ec

+ 5 - 2
Trio/Sources/Localizations/Main/Localizable.xcstrings

@@ -5707,12 +5707,12 @@
         }
       }
     },
-    "%@ - %@ = %@ U" : {
+    "%@ - %@" : {
       "localizations" : {
         "en" : {
           "stringUnit" : {
             "state" : "new",
-            "value" : "%1$@ - %2$@ = %3$@ U"
+            "value" : "%1$@ - %2$@"
           }
         }
       }
@@ -33112,6 +33112,9 @@
         }
       }
     },
+    "Available IOB = %@ U" : {
+
+    },
     "Available Layouts:" : {
       "localizations" : {
         "ar" : {

+ 4 - 4
Trio/Sources/Modules/Treatments/View/PopupView.swift

@@ -445,7 +445,7 @@ struct PopupView: View {
         GridRow(alignment: .top) {
             Text("Limits").foregroundColor(.secondary)
 
-            VStack {
+            VStack(alignment: .leading) {
                 let iobAvailable: Decimal = state.maxIOB - state.iob
                 if state.factoredInsulin < 0 {
                     Text("No insulin recommended.")
@@ -457,9 +457,9 @@ struct PopupView: View {
                     Text("Max Bolus = \(insulinFormatter(state.maxBolus)) U")
                 } else if state.factoredInsulin > iobAvailable {
                     let iobFormatted = state.iob < 0 ? "(" + insulinFormatter(state.iob) + ")" : insulinFormatter(state.iob)
-                    Text(
-                        "\(insulinFormatter(state.maxIOB)) - \(iobFormatted) = \(insulinFormatter(iobAvailable)) U"
-                    )
+                    Text("Available IOB = \(insulinFormatter(iobAvailable)) U")
+                    Text("\(insulinFormatter(state.maxIOB)) - \(iobFormatted)")
+                        .foregroundColor(.secondary)
                     Text("Max IOB - Current IOB")
                         .font(.caption)
                         .foregroundColor(.secondary)