Procházet zdrojové kódy

pull in latest changes, solve merge conflicts

polscm32 aka Marvout před 1 rokem
rodič
revize
43bf804c99

+ 7 - 0
Trio Watch App Extension/Views/BolusConfirmationView.swift

@@ -10,6 +10,12 @@ struct BolusConfirmationView: View {
 
 
     @FocusState private var isCrownFocused: Bool
     @FocusState private var isCrownFocused: Bool
 
 
+    var trioBackgroundColor = LinearGradient(
+        gradient: Gradient(colors: [Color.bgDarkBlue, Color.bgDarkerDarkBlue]),
+        startPoint: .top,
+        endPoint: .bottom
+    )
+
     var body: some View {
     var body: some View {
         VStack(spacing: 10) {
         VStack(spacing: 10) {
             Spacer()
             Spacer()
@@ -86,6 +92,7 @@ struct BolusConfirmationView: View {
             }
             }
         }
         }
         .navigationTitle("Confirm")
         .navigationTitle("Confirm")
+        .background(trioBackgroundColor)
         .toolbar {
         .toolbar {
             ToolbarItem(placement: .topBarTrailing) {
             ToolbarItem(placement: .topBarTrailing) {
                 Image(systemName: "digitalcrown.arrow.counterclockwise.fill")
                 Image(systemName: "digitalcrown.arrow.counterclockwise.fill")

+ 7 - 1
Trio Watch App Extension/Views/BolusInputView.swift

@@ -7,7 +7,6 @@ import WatchKit
 struct BolusInputView: View {
 struct BolusInputView: View {
     @ObservedObject var navigationState: NavigationState
     @ObservedObject var navigationState: NavigationState
     @State private var bolusAmount = 0.0
     @State private var bolusAmount = 0.0
-    @State private var navigateToConfirmation = false
 
 
     let state: WatchState
     let state: WatchState
 
 
@@ -26,6 +25,12 @@ struct BolusInputView: View {
         )
         )
     }
     }
 
 
+    var trioBackgroundColor = LinearGradient(
+        gradient: Gradient(colors: [Color.bgDarkBlue, Color.bgDarkerDarkBlue]),
+        startPoint: .top,
+        endPoint: .bottom
+    )
+
     var body: some View {
     var body: some View {
         VStack {
         VStack {
             if state.carbsAmount > 0 {
             if state.carbsAmount > 0 {
@@ -98,6 +103,7 @@ struct BolusInputView: View {
             .tint(.blue)
             .tint(.blue)
             .disabled(!(bolusAmount > 0.0) || bolusAmount >= effectiveBolusLimit)
             .disabled(!(bolusAmount > 0.0) || bolusAmount >= effectiveBolusLimit)
         }
         }
+        .background(trioBackgroundColor)
         .toolbar {
         .toolbar {
             ToolbarItem(placement: .topBarTrailing) {
             ToolbarItem(placement: .topBarTrailing) {
                 Image(systemName: "syringe.fill")
                 Image(systemName: "syringe.fill")

+ 7 - 1
Trio Watch App Extension/Views/CarbsInputView.swift

@@ -6,7 +6,6 @@ import SwiftUI
 struct CarbsInputView: View {
 struct CarbsInputView: View {
     @ObservedObject var navigationState: NavigationState
     @ObservedObject var navigationState: NavigationState
     @State private var carbsAmount: Double = 0.0 // Needs to be Double due to .digitalCrownRotation() stride
     @State private var carbsAmount: Double = 0.0 // Needs to be Double due to .digitalCrownRotation() stride
-    @State private var navigateToBolus = false // Track navigation to BolusInputView
     @FocusState private var isCrownFocused: Bool // Manage crown focus
     @FocusState private var isCrownFocused: Bool // Manage crown focus
 
 
     let state: WatchState
     let state: WatchState
@@ -25,6 +24,12 @@ struct CarbsInputView: View {
         )
         )
     }
     }
 
 
+    var trioBackgroundColor = LinearGradient(
+        gradient: Gradient(colors: [Color.bgDarkBlue, Color.bgDarkerDarkBlue]),
+        startPoint: .top,
+        endPoint: .bottom
+    )
+
     var body: some View {
     var body: some View {
         let buttonLabel = continueToBolus ? "Proceed" : "Log Carbs"
         let buttonLabel = continueToBolus ? "Proceed" : "Log Carbs"
 
 
@@ -98,6 +103,7 @@ struct CarbsInputView: View {
             .tint(.orange)
             .tint(.orange)
             .disabled(!(carbsAmount > 0.0) || carbsAmount >= effectiveCarbsLimit)
             .disabled(!(carbsAmount > 0.0) || carbsAmount >= effectiveCarbsLimit)
         }
         }
+        .background(trioBackgroundColor)
         .toolbar {
         .toolbar {
             ToolbarItem(placement: .topBarTrailing) {
             ToolbarItem(placement: .topBarTrailing) {
                 Image(systemName: "fork.knife")
                 Image(systemName: "fork.knife")

+ 2 - 3
Trio Watch App Extension/Views/TrioMainWatchView.swift

@@ -91,7 +91,7 @@ struct TrioMainWatchView: View {
                     }
                     }
 
 
                     Button {
                     Button {
-                        showingTreatmentMenuSheet.toggle()
+                        showingTreatmentMenuSheet = true
                     } label: {
                     } label: {
                         Image(systemName: "plus")
                         Image(systemName: "plus")
                             .foregroundStyle(Color.bgDarkerDarkBlue)
                             .foregroundStyle(Color.bgDarkerDarkBlue)
@@ -170,12 +170,11 @@ struct TrioMainWatchView: View {
             configuration.label
             configuration.label
                 .font(fontSize)
                 .font(fontSize)
                 .fontWeight(is40mm ? .medium : .semibold)
                 .fontWeight(is40mm ? .medium : .semibold)
-                .padding(is40mm ? 6 : 10)
+                .padding(is40mm ? 6 : 8)
                 .background(
                 .background(
                     backgroundGradient.opacity(configuration.isPressed ? 0.8 : 1.0)
                     backgroundGradient.opacity(configuration.isPressed ? 0.8 : 1.0)
                 )
                 )
                 .clipShape(Circle())
                 .clipShape(Circle())
-                .scaleEffect(configuration.isPressed ? 0.95 : 1.0)
                 .animation(.easeInOut(duration: 0.1), value: configuration.isPressed)
                 .animation(.easeInOut(duration: 0.1), value: configuration.isPressed)
         }
         }
     }
     }