Преглед на файлове

reformat hint for HBT when adjusting Slider

Robert преди 1 година
родител
ревизия
050728e31e
променени са 1 файла, в които са добавени 13 реда и са изтрити 9 реда
  1. 13 9
      FreeAPS/Sources/Modules/OverrideConfig/View/AddTempTargetForm.swift

+ 13 - 9
FreeAPS/Sources/Modules/OverrideConfig/View/AddTempTargetForm.swift

@@ -114,7 +114,7 @@ struct AddTempTargetForm: View {
                     Text("Target")
                     Spacer()
                     TextFieldWithToolBar(text: $state.tempTargetTarget, placeholder: "0", numberFormatter: glucoseFormatter)
-                        .onChange(of: state.tempTargetTarget) { newValue in
+                        .onChange(of: state.tempTargetTarget) { _ in
                             state.percentage = Double(state.computeAdjustedPercentage() * 100)
                         }
                     Text(state.units.rawValue).foregroundColor(.secondary)
@@ -230,14 +230,18 @@ struct AddTempTargetForm: View {
                         .disabled(!isSliderEnabled)
 
                         Divider()
-                        Text(
-                            state
-                                .units == .mgdL ?
-                                "Half Basal Exercise Target at: \(state.computeHalfBasalTarget().formatted(.number.precision(.fractionLength(0)))) mg/dl" :
-                                "Half Basal Exercise Target at: \(state.computeHalfBasalTarget().asMmolL.formatted(.number.grouping(.never).rounded().precision(.fractionLength(1)))) mmol/L"
-                        )
-                        .foregroundColor(.secondary)
-                        .font(.caption).italic()
+                        HStack {
+                            Text(
+                                state
+                                    .units == .mgdL ?
+                                    "Half Basal Exercise Target at: \(state.computeHalfBasalTarget().formatted(.number.precision(.fractionLength(0)))) mg/dl" :
+                                    "Half Basal Exercise Target at: \(state.computeHalfBasalTarget().asMmolL.formatted(.number.grouping(.never).rounded().precision(.fractionLength(1)))) mmol/L"
+                            )
+                            .lineLimit(1)
+                            .minimumScaleFactor(0.5)
+                            .foregroundColor(.secondary)
+                            Spacer()
+                        }
                     }
                 }.listRowBackground(Color.chart)
             }