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

Reduce changes to be as minimal to achieve wanted look

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

+ 14 - 14
FreeAPS/Sources/Modules/Adjustments/View/AdjustmentsRootView.swift

@@ -429,16 +429,16 @@ extension Adjustments {
                                 // Cancel ALL active Override
                                 await state.disableAllActiveOverrides(createOverrideRunEntry: true)
                             }
-                        }) {
+                        }, label: {
                             Text("Stop Override")
                                 .frame(maxWidth: .infinity, maxHeight: .infinity)
                                 .padding(10)
-                        }
-                        .frame(width: UIScreen.main.bounds.width * 0.9, height: 40)
-                        .background(state.isEnabled ? Color(.systemRed) : Color(.systemGray4))
-                        .clipShape(RoundedRectangle(cornerRadius: 8))
-                        .disabled(!state.isEnabled)
-                        .tint(.white)
+                        })
+                            .frame(width: UIScreen.main.bounds.width * 0.9, height: 40, alignment: .center)
+                            .disabled(!state.isEnabled)
+                            .background(!state.isEnabled ? Color(.systemGray4) : Color(.systemRed))
+                            .tint(.white)
+                            .clipShape(RoundedRectangle(cornerRadius: 8))
                     case .tempTargets:
                         Button(action: {
                             Task {
@@ -448,16 +448,16 @@ extension Adjustments {
                                 // Update View
                                 state.updateLatestTempTargetConfiguration()
                             }
-                        }) {
+                        }, label: {
                             Text("Stop Temp Target")
                                 .frame(maxWidth: .infinity, maxHeight: .infinity)
                                 .padding(10)
-                        }
-                        .frame(width: UIScreen.main.bounds.width * 0.9, height: 40)
-                        .background(state.isTempTargetEnabled ? Color(.systemRed) : Color(.systemGray4))
-                        .clipShape(RoundedRectangle(cornerRadius: 8))
-                        .disabled(!state.isTempTargetEnabled)
-                        .tint(.white)
+                        })
+                            .frame(width: UIScreen.main.bounds.width * 0.9, height: 40, alignment: .center)
+                            .disabled(!state.isTempTargetEnabled)
+                            .background(!state.isTempTargetEnabled ? Color(.systemGray4) : Color(.systemRed))
+                            .tint(.white)
+                            .clipShape(RoundedRectangle(cornerRadius: 8))
                     }
                 }
                 .padding(5)

+ 41 - 0
FreeAPS/Sources/Modules/Adjustments/View/Overrides/OverrideHelpView.swift

@@ -0,0 +1,41 @@
+NavigationStack {
+                    List {
+                        VStack(alignment: .leading, spacing: 10) {
+                            VStack(alignment: .leading, spacing: 0) {
+                                Text("This feature can be used to override these therapy settings for a chosen length of time:")
+                                    .fixedSize(horizontal: false, vertical: true)
+                                Text("• Basal Rate")
+                                Text("  ◦ Insulin Sensitivity")
+                                Text("  ◦ Carb Ratio")
+                                Text("• Glucose Target")
+                            }
+                            Text(
+                                "There are also options to override your Max SMB Minutes and Max UAM SMB Minutes, as well as to disable SMBs."
+                            )
+                            Text(
+                                "Select \"Start Override\" to immediately start using the Override, or select \"Save as Preset\" to be able to easily start the Override at a later time."
+                            )
+                            Text(
+                                "If an active override preset is edited, the changes will also apply to the currently running override. However, if you edit the currently running override directly, the preset stays unchanged."
+                            )
+                            Text(
+                                "If using Dynamic ISF (without Sigmoid), overriding your ISF will only adjust the limits of the ISF the algorithm is allowed to set."
+                            )
+                            Text(
+                                "If using Dynamic ISF (with Sigmoid), overriding your ISF will adjust the ISF used at your glucose target which extends to the ISF used at other glucose. Overriding your glucose target will change glucose level your ISF will be set to your profile ISF. Both of these can be combined in a single Override."
+                            )
+                        }
+                    }
+                    .padding(.trailing, 10)
+                    .navigationBarTitle("Help", displayMode: .inline)
+
+                    Button { state.isHelpSheetPresented.toggle() }
+                    label: { Text("Got it!").frame(maxWidth: .infinity, alignment: .center) }
+                        .buttonStyle(.bordered)
+                        .padding(.top)
+                }
+                .padding()
+                .presentationDetents(
+                    [.fraction(0.9), .large],
+                    selection: $state.helpSheetDetent
+                )

+ 31 - 0
FreeAPS/Sources/Modules/Adjustments/View/TempTargets/TempTargetHelpView.swift

@@ -0,0 +1,31 @@
+NavigationStack {
+                    List {
+                        VStack(alignment: .leading, spacing: 10) {
+                            Text(
+                                "A Temporary Target replaces the current Target Glucose specified in Therapy settings."
+                            )
+                            Text(
+                                "Depending on the Algorithm > Target Behavior settings, these temporary glucose targets can also raise Insulin Sensitivity for high targets or lower sensitivity for low targets."
+                            )
+                            Text(
+                                "Furthermore, you could adjust that sensitivity change independently from the Half Basal Exercise Target specified in Algorithm > Target Behavior settings by deliberatly setting a customized Insulin Percentage for a Temp Target."
+                            )
+                            Text(
+                                "A pre-condition to have Temp Targets adjust Sensitivity is that the respective Target Behavior settings High Temp Target Raises Sensitivity or Low Temp Target Lowers Sensitivity are set to enabled!"
+                            )
+                        }
+                    }
+                    .padding(.trailing, 10)
+                    .navigationBarTitle("Help", displayMode: .inline)
+
+                    Button { state.isHelpSheetPresented.toggle() }
+                    label: { Text("Got it!").frame(maxWidth: .infinity, alignment: .center) }
+                        .buttonStyle(.bordered)
+                        .padding(.top)
+                }
+                .padding()
+                .presentationDetents(
+                    [.fraction(0.9), .large],
+                    selection: $state.helpSheetDetent
+                )
+            }