From cb0133ceeca791a8f693288c7318d768d0d2f37d Mon Sep 17 00:00:00 2001 From: Pete Schwamb Date: Mon, 20 Oct 2025 18:03:58 -0500 Subject: [PATCH] ios26 fixes --- Loop/Views/SettingsView.swift | 49 +++++++++++++++++++---------------- 1 file changed, 26 insertions(+), 23 deletions(-) diff --git a/Loop/Views/SettingsView.swift b/Loop/Views/SettingsView.swift index 435f11cca..aa0da3313 100644 --- a/Loop/Views/SettingsView.swift +++ b/Loop/Views/SettingsView.swift @@ -50,7 +50,6 @@ public struct SettingsView: View { } case favoriteFoods - case therapySettings } } @@ -137,24 +136,6 @@ public struct SettingsView: View { } .sheet(item: $sheet) { sheet in switch sheet { - case .therapySettings: - TherapySettingsView( - mode: .settings, - viewModel: TherapySettingsViewModel( - therapySettings: viewModel.therapySettings(), - sensitivityOverridesEnabled: FeatureFlags.sensitivityOverridesEnabled, - adultChildInsulinModelSelectionEnabled: FeatureFlags.adultChildInsulinModelSelectionEnabled, - delegate: viewModel.therapySettingsViewModelDelegate - ) - ) - .environmentObject(displayGlucosePreference) - .environment(\.dismissAction, self.dismiss) - .environment(\.appName, self.appName) - .environment(\.chartColorPalette, .primary) - .environment(\.carbTintColor, self.carbTintColor) - .environment(\.glucoseTintColor, self.glucoseTintColor) - .environment(\.guidanceColors, self.guidanceColors) - .environment(\.insulinTintColor, self.insulinTintColor) case .favoriteFoods: FavoriteFoodsView() } @@ -286,15 +267,37 @@ extension SettingsView { } } } - + + private var therapySettingsView: some View { + TherapySettingsView( + mode: .settings, + viewModel: TherapySettingsViewModel( + therapySettings: viewModel.therapySettings(), + sensitivityOverridesEnabled: FeatureFlags.sensitivityOverridesEnabled, + adultChildInsulinModelSelectionEnabled: FeatureFlags.adultChildInsulinModelSelectionEnabled, + delegate: viewModel.therapySettingsViewModelDelegate + ) + ) + .environmentObject(displayGlucosePreference) + .environment(\.dismissAction, self.dismiss) + .environment(\.appName, self.appName) + .environment(\.chartColorPalette, .primary) + .environment(\.carbTintColor, self.carbTintColor) + .environment(\.glucoseTintColor, self.glucoseTintColor) + .environment(\.guidanceColors, self.guidanceColors) + .environment(\.insulinTintColor, self.insulinTintColor) + } + private var configurationSection: some View { Section(header: SectionHeader(label: NSLocalizedString("Configuration", comment: "The title of the Configuration section in settings"))) { - LargeButton(action: { sheet = .therapySettings }, - includeArrow: true, + NavigationLink(destination: therapySettingsView) { + LargeButton(action: { }, + includeArrow: false, imageView: Image("Therapy Icon"), label: NSLocalizedString("Therapy Settings", comment: "Title text for button to Therapy Settings"), descriptiveText: NSLocalizedString("Diabetes Treatment", comment: "Descriptive text for Therapy Settings")) - + } + ForEach(pluginMenuItems.filter {$0.section == .configuration}) { item in item.view }