Просмотр исходного кода

remove uncommented code and shadow of picker again...

polscm32 2 лет назад
Родитель
Сommit
df2c3cc9d0

+ 0 - 30
FreeAPS/Sources/Modules/Home/View/Header/CurrentGlucoseView.swift

@@ -66,8 +66,6 @@ struct CurrentGlucoseView: View {
                     )
                     .font(.system(size: 40, weight: .bold))
                     .foregroundColor(alarm == nil ? colourGlucoseText : .loopRed)
-
-                    //                image
                 }
                 HStack {
                     let minutesAgo = -1 * (recentGlucose?.dateString.timeIntervalSinceNow ?? 0) / 60
@@ -118,34 +116,6 @@ struct CurrentGlucoseView: View {
         }
     }
 
-//    var image: Image {
-//        guard let direction = recentGlucose?.direction else {
-//            return Image(systemName: "arrow.left.and.right")
-//        }
-//
-//        switch direction {
-//        case .doubleUp,
-//             .singleUp,
-//             .tripleUp:
-//            return Image(systemName: "arrow.up")
-//        case .fortyFiveUp:
-//            return Image(systemName: "arrow.up.right")
-//        case .flat:
-//            return Image(systemName: "arrow.forward")
-//        case .fortyFiveDown:
-//            return Image(systemName: "arrow.down.forward")
-//        case .doubleDown,
-//             .singleDown,
-//             .tripleDown:
-//            return Image(systemName: "arrow.down")
-//
-//        case .none,
-//             .notComputable,
-//             .rateOutOfRange:
-//            return Image(systemName: "arrow.left.and.right")
-//        }
-//    }
-
     var colorOfGlucose: Color {
         let whichGlucose = recentGlucose?.glucose ?? 0
 

+ 0 - 21
FreeAPS/Sources/Modules/Home/View/Header/PumpView.swift

@@ -31,27 +31,6 @@ struct PumpView: View {
 
     var body: some View {
         HStack {
-//            MARK: TEST
-
-//            HStack {
-//                Text("IOB").font(.callout).foregroundColor(.secondary)
-//                Text(
-//                    (numberFormatter.string(from: (state.suggestion?.iob ?? 0) as NSNumber) ?? "0") +
-//                        NSLocalizedString(" U", comment: "Insulin unit")
-//                )
-//                .font(.callout).fontWeight(.bold)
-//
-//                Spacer()
-//
-//                Text("COB").font(.callout).foregroundColor(.secondary)
-//                Text(
-//                    (numberFormatter.string(from: (state.suggestion?.cob ?? 0) as NSNumber) ?? "0") +
-//                        NSLocalizedString(" g", comment: "gram of carbs")
-//                )
-//                .font(.callout).fontWeight(.bold)
-//
-//                Spacer()
-//            }
             Text("IOB").font(.callout).foregroundColor(.secondary)
             Text(
                 (numberFormatter.string(from: (state.suggestion?.iob ?? 0) as NSNumber) ?? "0") +

+ 1 - 57
FreeAPS/Sources/Modules/Home/View/HomeRootView.swift

@@ -80,66 +80,12 @@ extension Home {
             return scene
         }
 
-//        @ViewBuilder func header(_ geo: GeometryProxy) -> some View {
-//            HStack(alignment: .bottom) {
-//                Spacer()
-//                cobIobView
-//                Spacer()
-//                glucoseView
-//                Spacer()
-//                pumpView
-//                Spacer()
-//                loopView
-//                Spacer()
-//            }
-//            .frame(maxWidth: .infinity)
-//            .padding(.top, 10 + geo.safeAreaInsets.top)
-//            .padding(.bottom, 10)
-//            .background(Color.gray.opacity(0.3))
-//        }
         @ViewBuilder func header(_: GeometryProxy) -> some View {
-            let colour: Color = colorScheme == .dark ? .gray.opacity(0.2) : .white
-            RoundedRectangle(cornerRadius: 15)
-                .fill(colour)
-                .shadow(radius: 3)
-//                .frame(height: UIScreen.main.bounds.height / 6)
-                .overlay(
-                    HStack(alignment: .bottom) {
-                        Spacer()
-                        cobIobView
-                        Spacer()
-//                        glucoseView
-//                        Spacer()
-                        loopView
-                        Spacer()
-                        pumpView
-                        Spacer()
-                    }
-//                    .frame(maxWidth: .infinity)
-//                    .padding(.top, 10 + geo.safeAreaInsets.top)
-//                    .padding(.bottom, 10)
-                )
-                .frame(height: UIScreen.main.bounds.height / 13)
-                .padding([.leading, .trailing], 10)
-        }
-
-        @ViewBuilder func header2(_: GeometryProxy) -> some View {
-//            let colour: Color = colorScheme == .dark ? .gray.opacity(0.2) : .white
-
             HStack {
                 Spacer()
-//                cobIobView2
-//                Spacer()
-//                        glucoseView
-//                        Spacer()
-//                loopView
-//                Spacer()
                 pumpView
                 Spacer()
             }
-//            .frame(maxWidth: .infinity)
-//                    .padding(.top, 10 + geo.safeAreaInsets.top)
-//                    .padding(.bottom, 10)
         }
 
         var cobIobView: some View {
@@ -490,7 +436,6 @@ extension Home {
                 }
                 .pickerStyle(.segmented)
                 .background(Color.clear)
-                .shadow(radius: 3)
                 .frame(width: UIScreen.main.bounds.width / 1.5, height: 40, alignment: .center)
             }
             .padding(.vertical, 1)
@@ -678,7 +623,6 @@ extension Home {
                     .buttonStyle(.borderless)
                 }
                 .padding(.horizontal, 24)
-//                .padding(.bottom, geo.safeAreaInsets.bottom)
             }
         }
 
@@ -698,7 +642,7 @@ extension Home {
                             .padding(.top, 75)
                     }
 
-                    header2(geo)
+                    header(geo)
                         .padding(.top, 40)
                         .padding([.leading, .trailing], 10)