Sfoglia il codice sorgente

Remove "Pump suspended" text in deference to the pumpStatusHighlightMessage
Use different opacity instead of alternate color for SBR text display

Joe Moran 5 mesi fa
parent
commit
7b0f24fbc3
1 ha cambiato i file con 8 aggiunte e 12 eliminazioni
  1. 8 12
      Trio/Sources/Modules/Home/View/HomeRootView.swift

+ 8 - 12
Trio/Sources/Modules/Home/View/HomeRootView.swift

@@ -496,20 +496,16 @@ extension Home {
                         .font(.callout)
                 } else {
                     HStack {
-                        if state.apsManager?.isScheduledBasal == nil {
-                            /// The pump is not currently available (e.g., no pod) so
-                            /// display no insulin delivery info rather than "Pump suspended"
-                        } else if state.apsManager.isSuspended {
-                            Text("Pump suspended")
-                                .font(.callout).fontWeight(.bold).fontDesign(.rounded)
-                                .foregroundColor(.loopGray)
-                        } else {
+                        /// Only display the insulin delivery rate info if the pump is not
+                        /// suspended and is available (e.g., pod is paired & not faulted).
+                        let pumpAvailable = state.apsManager.isScheduledBasal != nil
+                        if !state.apsManager.isSuspended && pumpAvailable {
                             Image(systemName: "drop.circle")
                                 .font(.callout)
                                 .foregroundColor(.insulinTintColor)
                             if let basalString = self.basalString {
-                                // If running a scheduled basal, display basalString in loopGray instead of black
-                                let color: Color = state.apsManager?.isScheduledBasal == true ? .loopGray : .black
+                                /// Adjust opacity when displaying a scheduled basal rate
+                                let opacity = state.apsManager?.isScheduledBasal == true ? 0.6 : 1.0
                                 if basalString.count > 5 {
                                     Text(basalString)
                                         .font(.callout).fontWeight(.bold).fontDesign(.rounded)
@@ -517,12 +513,12 @@ extension Home {
                                         .minimumScaleFactor(0.85)
                                         .truncationMode(.tail)
                                         .allowsTightening(true)
-                                        .foregroundColor(color)
+                                        .opacity(opacity)
                                 } else {
                                     // Short strings can just display normally
                                     Text(basalString)
                                         .font(.callout).fontWeight(.bold).fontDesign(.rounded)
-                                        .foregroundColor(color)
+                                        .opacity(opacity)
                                 }
                             } else {
                                 Text("No Data")