Parcourir la source

Adjust spacing, size for CGM and pump

Deniz Cengiz il y a 1 an
Parent
commit
1908a64d53

+ 4 - 5
FreeAPS/Sources/Modules/CGM/View/CGMRootView.swift

@@ -29,14 +29,14 @@ extension CGM {
                             if cgmState.type != .none {
                                 Button {
                                     state.setupCGM = true
-
                                 } label: {
                                     HStack {
-                                        Image(systemName: "sensor.tag.radiowaves.forward.fill").padding()
+                                        Image(systemName: "sensor.tag.radiowaves.forward.fill")
                                         Text(cgmState.displayName)
                                     }
-                                }
-
+                                    .frame(maxWidth: .infinity, minHeight: 50, alignment: .center)
+                                    .font(.title2)
+                                }.padding()
                             } else {
                                 VStack {
                                     Button {
@@ -70,7 +70,6 @@ extension CGM {
                             }
                         }
                     )
-                    .padding(.top)
                     .listRowBackground(Color.chart)
 
                     if state.cgmCurrent.type == .plugin && state.cgmCurrent.id.contains("Libre") {

+ 21 - 12
FreeAPS/Sources/Modules/CGM/View/OtherCGMView.swift

@@ -79,19 +79,28 @@ struct OtherCGMView: BaseView {
                     state.deleteCGM()
                     presentationMode.wrappedValue.dismiss()
                 } label: {
-                    Text("Delete CGM").foregroundColor(.red)
-                        .frame(maxWidth: .infinity)
-                        .multilineTextAlignment(.center)
+                    Text("Delete CGM")
+                        .font(.headline)
+                        .foregroundStyle(Color.white)
+                        .frame(maxWidth: .infinity, alignment: .center)
+                        .frame(height: 35)
                 }
-
-            }.listSectionSpacing(sectionSpacing)
-                .navigationTitle(state.cgmCurrent.displayName)
-                .navigationBarTitleDisplayMode(.inline)
-                .navigationBarItems(leading: Button("Close") {
-                    presentationMode.wrappedValue.dismiss()
-                })
-                .scrollContentBackground(.hidden)
-                .background(appState.trioBackgroundColor(for: colorScheme))
+                .listRowBackground(Color(.systemRed))
+                .clipShape(RoundedRectangle(cornerRadius: 8))
+            }
+            .navigationTitle(state.cgmCurrent.displayName)
+            .navigationBarTitleDisplayMode(.inline)
+            .toolbar {
+                /// proper positioning should be .leading
+                /// but to keep this in line with LoopKit submodules, set placement to .trailing
+                ToolbarItem(placement: .topBarLeading) {
+                    Button("Close") {
+                        presentationMode.wrappedValue.dismiss()
+                    }
+                }
+            }
+            .scrollContentBackground(.hidden)
+            .background(appState.trioBackgroundColor(for: colorScheme))
         }
     }
 }

+ 1 - 1
FreeAPS/Sources/Modules/Home/HomeStateModel+Setup/GlucoseTargetSetup.swift

@@ -77,7 +77,7 @@ extension Home.StateModel {
                 )
             )
         }
-      
+
         return targetProfiles
     }
 }

+ 4 - 3
FreeAPS/Sources/Modules/PumpConfig/View/PumpConfigRootView.swift

@@ -29,10 +29,12 @@ extension PumpConfig {
                                     state.setupPump = true
                                 } label: {
                                     HStack {
-                                        Image(uiImage: pumpState.image ?? UIImage()).padding()
+                                        Image(uiImage: pumpState.image ?? UIImage())
                                         Text(pumpState.name)
                                     }
-                                }
+                                    .frame(maxWidth: .infinity, minHeight: 50, alignment: .center)
+                                    .font(.title2)
+                                }.padding()
                                 if state.alertNotAck {
                                     Spacer()
                                     Button("Acknowledge all alerts") { state.ack() }
@@ -70,7 +72,6 @@ extension PumpConfig {
                             }
                         }
                     )
-                    .padding(.top)
                     .listRowBackground(Color.chart)
                 }
                 .scrollContentBackground(.hidden).background(appState.trioBackgroundColor(for: colorScheme))