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

Merge branch 'trio/settings-refactor' of github.com:dnzxy/Open-iAPS into marvout-small-fixes

Deniz Cengiz 1 год назад
Родитель
Сommit
abb9412796

+ 7 - 2
FreeAPS/Sources/Modules/Home/View/HomeRootView.swift

@@ -950,8 +950,13 @@ extension Home {
                         Text("Invalid CGM reading (HIGH).").font(.callout).bold().foregroundColor(.loopRed).padding(.top, 8)
                         Text("SMBs and High Temps Disabled.").font(.caption).foregroundColor(.white).padding(.bottom, 4)
                     } else {
-                        TagCloudView(tags: determination.reasonParts, shouldParseToMmolL: state.units == .mmolL)
-                            .animation(.none, value: false)
+                        let tags = !state.isSmoothingEnabled ? determination.reasonParts : determination
+                            .reasonParts + ["Smoothing: On"]
+                        TagCloudView(
+                            tags: tags,
+                            shouldParseToMmolL: state.units == .mmolL
+                        )
+                        .animation(.none, value: false)
 
                         Text(
                             self

+ 2 - 1
FreeAPS/Sources/Modules/Settings/SettingItems.swift

@@ -190,7 +190,8 @@ enum SettingItems {
                 "Override HbA1c Unit",
                 "Standing / Laying TIR Chart",
                 "Show Carbs Required Badge",
-                "Carbs Required Threshold"
+                "Carbs Required Threshold",
+                "Forecast Display Type"
             ],
             path: ["Features", "User Interface"]
         ),

+ 7 - 2
FreeAPS/Sources/Views/TagCloudView.swift

@@ -71,6 +71,8 @@ struct TagCloudView: View {
                 return .red
             case textTag where textTag.contains("SMB Ratio"):
                 return .orange
+            case textTag where textTag.contains("Smoothing: On"):
+                return .white
             default:
                 return .insulin
             }
@@ -84,7 +86,7 @@ struct TagCloudView: View {
                 .padding(.horizontal, 4)
                 .font(.subheadline)
                 .background(colorOfTag.opacity(0.8))
-                .foregroundColor(Color.white)
+                .foregroundColor(textTag.contains("Smoothing: On") ? Color.black : Color.white)
                 .cornerRadius(2)
         }
     }
@@ -189,7 +191,10 @@ struct TestTagCloudView: View {
             Text("Some other text")
             Divider()
             Text("Some other cloud")
-            TagCloudView(tags: ["Apple", "Google", "Amazon", "Microsoft", "Oracle", "Facebook"], shouldParseToMmolL: false)
+            TagCloudView(
+                tags: ["Apple", "Google", "Amazon", "Microsoft", "Oracle", "Facebook"],
+                shouldParseToMmolL: false
+            )
         }
     }
 }