Sfoglia il codice sorgente

move toggles back in the same line as infos

polscm32 2 anni fa
parent
commit
26db808049

+ 24 - 28
FreeAPS/Sources/Modules/Bolus/View/AlternativeBolusCalcRootView.swift

@@ -399,36 +399,32 @@ extension Bolus {
                             .font(.footnote)
                             .buttonStyle(PlainButtonStyle())
                             .frame(maxWidth: .infinity, alignment: .leading)
-                    }
-
-                    if state.sweetMeals || state.fattyMeals {
-                        HStack {
-                            if state.fattyMeals {
-                                Spacer()
-                                Toggle(isOn: $state.useFattyMealCorrectionFactor) {
-                                    Text("Fatty Meal")
-                                }
-                                .toggleStyle(CheckboxToggleStyle())
-                                .font(.footnote)
-                                .onChange(of: state.useFattyMealCorrectionFactor) { _ in
-                                    state.insulinCalculated = state.calculateInsulin()
-                                    if state.useFattyMealCorrectionFactor {
-                                        state.useSuperBolus = false
-                                    }
-                                }
+                        
+                        if state.fattyMeals {
+                            Spacer()
+                            Toggle(isOn: $state.useFattyMealCorrectionFactor) {
+                                Text("Fatty Meal")
                             }
-                            if state.sweetMeals {
-                                Spacer()
-                                Toggle(isOn: $state.useSuperBolus) {
-                                    Text("Super Bolus")
+                            .toggleStyle(CheckboxToggleStyle())
+                            .font(.footnote)
+                            .onChange(of: state.useFattyMealCorrectionFactor) { _ in
+                                state.insulinCalculated = state.calculateInsulin()
+                                if state.useFattyMealCorrectionFactor {
+                                    state.useSuperBolus = false
                                 }
-                                .toggleStyle(CheckboxToggleStyle())
-                                .font(.footnote)
-                                .onChange(of: state.useSuperBolus) { _ in
-                                    state.insulinCalculated = state.calculateInsulin()
-                                    if state.useSuperBolus {
-                                        state.useFattyMealCorrectionFactor = false
-                                    }
+                            }
+                        }
+                        if state.sweetMeals {
+                            Spacer()
+                            Toggle(isOn: $state.useSuperBolus) {
+                                Text("Super Bolus")
+                            }
+                            .toggleStyle(CheckboxToggleStyle())
+                            .font(.footnote)
+                            .onChange(of: state.useSuperBolus) { _ in
+                                state.insulinCalculated = state.calculateInsulin()
+                                if state.useSuperBolus {
+                                    state.useFattyMealCorrectionFactor = false
                                 }
                             }
                         }