소스 검색

Fix coloring for NS setting views for sections; settings still WIP

Deniz Cengiz 1 년 전
부모
커밋
23d901211a

+ 27 - 22
FreeAPS/Sources/Modules/NightscoutConfig/View/NightscoutConfigRootView.swift

@@ -45,9 +45,11 @@ extension NightscoutConfig {
 
 
         var body: some View {
         var body: some View {
             Form {
             Form {
-                NavigationLink("Connect", destination: NightscoutConnectView(state: state))
-                NavigationLink("Upload", destination: NightscoutUploadView(state: state))
-                NavigationLink("Fetch and Remote Control", destination: NightscoutFetchView(state: state))
+                Section {
+                    NavigationLink("Connect", destination: NightscoutConnectView(state: state))
+                    NavigationLink("Upload", destination: NightscoutUploadView(state: state))
+                    NavigationLink("Fetch and Remote Control", destination: NightscoutFetchView(state: state))
+                }.listRowBackground(Color.chart)
 
 
                 Section(
                 Section(
                     header: Text("Import Settings from Nightscout"),
                     header: Text("Import Settings from Nightscout"),
@@ -83,24 +85,26 @@ extension NightscoutConfig {
                             secondaryButton: .cancel()
                             secondaryButton: .cancel()
                         )
                         )
                         isImportAlertPresented.toggle()
                         isImportAlertPresented.toggle()
-                    }.disabled(state.url.isEmpty || state.connecting)
-                        .alert(isPresented: $importedHasRun) {
-                            Alert(
-                                title: Text((fetchedErrors.first?.error ?? "").count < 4 ? "Settings imported" : "Import Error"),
-                                message: Text(
-                                    (fetchedErrors.first?.error ?? "").count < 4 ?
-                                        NSLocalizedString(
-                                            "\nNow please verify all of your new settings thoroughly: \n\n • DIA (Pump settings)\n • Basal Profile\n • Insulin Sensitivities\n • Carb Ratios\n • Target Glucose\n\n in Trio Settings -> Configuration.\n\nBad or invalid profile settings could have disastrous effects.",
-                                            comment: "Imported Profiles Alert"
-                                        ) :
-                                        NSLocalizedString(fetchedErrors.first?.error ?? "", comment: "Import Error")
-                                ),
-                                primaryButton: .destructive(
-                                    Text("OK")
-                                ),
-                                secondaryButton: .cancel()
-                            )
-                        }
+                    }
+                    .listRowBackground(Color.chart)
+                    .disabled(state.url.isEmpty || state.connecting)
+                    .alert(isPresented: $importedHasRun) {
+                        Alert(
+                            title: Text((fetchedErrors.first?.error ?? "").count < 4 ? "Settings imported" : "Import Error"),
+                            message: Text(
+                                (fetchedErrors.first?.error ?? "").count < 4 ?
+                                    NSLocalizedString(
+                                        "\nNow please verify all of your new settings thoroughly: \n\n • DIA (Pump settings)\n • Basal Profile\n • Insulin Sensitivities\n • Carb Ratios\n • Target Glucose\n\n in Trio Settings -> Configuration.\n\nBad or invalid profile settings could have disastrous effects.",
+                                        comment: "Imported Profiles Alert"
+                                    ) :
+                                    NSLocalizedString(fetchedErrors.first?.error ?? "", comment: "Import Error")
+                            ),
+                            primaryButton: .destructive(
+                                Text("OK")
+                            ),
+                            secondaryButton: .cancel()
+                        )
+                    }
                 }
                 }
 
 
                 Section {
                 Section {
@@ -110,8 +114,9 @@ extension NightscoutConfig {
                         }
                         }
                     }
                     }
                     .disabled(state.url.isEmpty || state.connecting || state.backfilling)
                     .disabled(state.url.isEmpty || state.connecting || state.backfilling)
-                } header: { Text("Backfill glucose from Nightscout")
                 }
                 }
+                header: { Text("Backfill glucose from Nightscout")
+                }.listRowBackground(Color.chart)
             }
             }
             .navigationBarTitle("Nightscout Config")
             .navigationBarTitle("Nightscout Config")
             .navigationBarTitleDisplayMode(.automatic)
             .navigationBarTitleDisplayMode(.automatic)

+ 7 - 4
FreeAPS/Sources/Modules/NightscoutConfig/View/NightscoutConnectView.swift

@@ -52,18 +52,21 @@ struct NightscoutConnectView: View {
                         ProgressView()
                         ProgressView()
                     }
                     }
                 }
                 }
-            }
+            }.listRowBackground(Color.chart)
+
             Section {
             Section {
                 Button("Connect to Nightscout") { state.connect() }
                 Button("Connect to Nightscout") { state.connect() }
                     .disabled(state.url.isEmpty || state.connecting)
                     .disabled(state.url.isEmpty || state.connecting)
                 Button("Delete") { state.delete() }.foregroundColor(.red).disabled(state.connecting)
                 Button("Delete") { state.delete() }.foregroundColor(.red).disabled(state.connecting)
-            }
+            }.listRowBackground(Color.chart)
+
             Section {
             Section {
                 Button("Open Nightscout") {
                 Button("Open Nightscout") {
                     UIApplication.shared.open(URL(string: state.url)!, options: [:], completionHandler: nil)
                     UIApplication.shared.open(URL(string: state.url)!, options: [:], completionHandler: nil)
                 }
                 }
                 .disabled(state.url.isEmpty || state.connecting)
                 .disabled(state.url.isEmpty || state.connecting)
-            }
+            }.listRowBackground(Color.chart)
+
             Section {
             Section {
                 Toggle("Use local glucose server", isOn: $state.useLocalSource)
                 Toggle("Use local glucose server", isOn: $state.useLocalSource)
                 HStack {
                 HStack {
@@ -76,7 +79,7 @@ struct NightscoutConnectView: View {
                         allowDecimalSeparator: false
                         allowDecimalSeparator: false
                     )
                     )
                 }
                 }
-            } header: { Text("Local glucose source") }
+            } header: { Text("Local glucose source") }.listRowBackground(Color.chart)
         }
         }
         .navigationTitle("Connect")
         .navigationTitle("Connect")
         .scrollContentBackground(.hidden).background(color)
         .scrollContentBackground(.hidden).background(color)

+ 3 - 2
FreeAPS/Sources/Modules/NightscoutConfig/View/NightscoutFetchView.swift

@@ -37,7 +37,8 @@ struct NightscoutFetchView: View {
                 Text(
                 Text(
                     "The Fetch Treatments toggle enables fetching of carbs and temp targets entered in Careportal or by another uploading device than Trio."
                     "The Fetch Treatments toggle enables fetching of carbs and temp targets entered in Careportal or by another uploading device than Trio."
                 )
                 )
-            }
+            }.listRowBackground(Color.chart)
+
             Section(
             Section(
                 header: Text("Allow Remote control of Trio"),
                 header: Text("Allow Remote control of Trio"),
                 footer: VStack(alignment: .leading, spacing: 2) {
                 footer: VStack(alignment: .leading, spacing: 2) {
@@ -52,7 +53,7 @@ struct NightscoutFetchView: View {
                 {
                 {
                     Toggle("Remote Control", isOn: $state.allowAnnouncements)
                     Toggle("Remote Control", isOn: $state.allowAnnouncements)
                         .disabled(!state.isDownloadEnabled)
                         .disabled(!state.isDownloadEnabled)
-                }
+                }.listRowBackground(Color.chart)
         }
         }
         .navigationTitle("Fetch and Remote")
         .navigationTitle("Fetch and Remote")
         .scrollContentBackground(.hidden).background(color)
         .scrollContentBackground(.hidden).background(color)

+ 1 - 1
FreeAPS/Sources/Modules/NightscoutConfig/View/NightscoutUploadView.swift

@@ -41,7 +41,7 @@ struct NightscoutUploadView: View {
                     Toggle("Upload Treatments and Settings", isOn: $state.isUploadEnabled)
                     Toggle("Upload Treatments and Settings", isOn: $state.isUploadEnabled)
 
 
                     Toggle("Upload Glucose", isOn: $state.uploadGlucose).disabled(!state.changeUploadGlucose)
                     Toggle("Upload Glucose", isOn: $state.uploadGlucose).disabled(!state.changeUploadGlucose)
-                }
+                }.listRowBackground(Color.chart)
         }
         }
         .navigationTitle("Upload")
         .navigationTitle("Upload")
         .scrollContentBackground(.hidden).background(color)
         .scrollContentBackground(.hidden).background(color)

+ 1 - 1
FreeAPS/Sources/Modules/Settings/View/SettingsRootView.swift

@@ -250,7 +250,7 @@ extension Settings {
                     }
                     }
                 }
                 }
                 // TODO: check how to implement intuitive search
                 // TODO: check how to implement intuitive search
-//                .searchable(text: $searchText, placement: .navigationBarDrawer(displayMode: .always))
+//                .searchable(text: $searchText, placement: .navigationBarDrawer(displayMode: .automatic))
                 .onDisappear(perform: { state.uploadProfileAndSettings(false) })
                 .onDisappear(perform: { state.uploadProfileAndSettings(false) })
                 .screenNavigation(self)
                 .screenNavigation(self)
         }
         }

+ 2 - 2
Trio.xcworkspace/xcshareddata/swiftpm/Package.resolved

@@ -1,5 +1,5 @@
 {
 {
-  "originHash" : "59ac7eba66375d6eb406e758cb0b9964f4b3b0ae45c5665596f00384c32262b9",
+  "originHash" : "f5c836c216c4ca7d356e3777e58d6d4f9502b03f3974891349eb775f4c4cf750",
   "pins" : [
   "pins" : [
     {
     {
       "identity" : "cryptoswift",
       "identity" : "cryptoswift",
@@ -49,7 +49,7 @@
     {
     {
       "identity" : "swiftcharts",
       "identity" : "swiftcharts",
       "kind" : "remoteSourceControl",
       "kind" : "remoteSourceControl",
-      "location" : "https://github.com/ivanschuetz/SwiftCharts.git",
+      "location" : "https://github.com/ivanschuetz/SwiftCharts",
       "state" : {
       "state" : {
         "branch" : "master",
         "branch" : "master",
         "revision" : "c354c1945bb35a1f01b665b22474f6db28cba4a2"
         "revision" : "c354c1945bb35a1f01b665b22474f6db28cba4a2"