polscm32 aka Marvout 1 год назад
Родитель
Сommit
c63117bcfc

+ 11 - 11
FreeAPS/Sources/Modules/Stat/View/ViewElements/BolusStatsView.swift

@@ -267,13 +267,13 @@ struct BolusStatsView: View {
                 RuleMark(
                     x: .value("Selected Date", selectedDate)
                 )
-                .foregroundStyle(.secondary.opacity(0.3))
+                .foregroundStyle(.secondary.opacity(0.5))
                 .annotation(
                     position: .top,
                     spacing: 0,
                     overflowResolution: .init(x: .fit(to: .chart), y: .fit(to: .chart))
                 ) {
-                    BolusSelectionPopover(date: selectedDate, bolus: selectedBolus)
+                    BolusSelectionPopover(date: selectedDate, bolus: selectedBolus, selectedDuration: selectedDuration)
                 }
             }
         }
@@ -344,12 +344,12 @@ struct BolusStatsView: View {
 private struct BolusSelectionPopover: View {
     let date: Date
     let bolus: BolusStats
-
+    let selectedDuration: Stat.StateModel.StatsTimeInterval
     var body: some View {
         VStack(alignment: .leading, spacing: 4) {
-            Text(date.formatted(.dateTime.month().day()))
-                .font(.caption)
-                .foregroundStyle(.secondary)
+            Text(selectedDuration == .Day ? date.formatted(.dateTime.hour().minute()) : date.formatted(.dateTime.month().day()))
+                .font(.subheadline)
+                .fontWeight(.bold)
 
             Grid(alignment: .leading) {
                 GridRow {
@@ -371,13 +371,13 @@ private struct BolusSelectionPopover: View {
                     Text("U")
                 }
             }
-            .font(.caption)
+            .font(.headline.bold())
         }
-        .padding(8)
+        .foregroundStyle(.white)
+        .padding(20)
         .background(
-            RoundedRectangle(cornerRadius: 8)
-                .fill(Color(.systemBackground))
-                .shadow(radius: 2)
+            RoundedRectangle(cornerRadius: 10)
+                .fill(Color.blue.gradient)
         )
     }
 }

+ 9 - 10
FreeAPS/Sources/Modules/Stat/View/ViewElements/GlucosePercentileChart.swift

@@ -76,7 +76,7 @@ struct GlucosePercentileChart: View {
 
                 if let selectedStats, let selection {
                     RuleMark(x: .value("Selection", selection))
-                        .foregroundStyle(.secondary.opacity(0.3))
+                        .foregroundStyle(.secondary.opacity(0.5))
                         .annotation(
                             position: .top,
                             spacing: 0,
@@ -109,7 +109,7 @@ struct GlucosePercentileChart: View {
                     AxisGridLine()
                 }
             }
-            .chartXSelection(value: $selection)
+            .chartXSelection(value: $selection.animation(.easeInOut))
             .frame(height: 200)
 
             legend
@@ -186,10 +186,9 @@ struct AGPSelectionPopover: View {
             HStack {
                 Image(systemName: "clock")
                 Text(time.formatted(.dateTime.hour().minute(.twoDigits)))
-                    .font(.body).bold()
+                    .fontWeight(.bold)
             }
-            .font(.caption)
-            .foregroundStyle(.secondary)
+            .font(.subheadline)
 
             Grid(alignment: .leading, horizontalSpacing: 8) {
                 GridRow {
@@ -223,13 +222,13 @@ struct AGPSelectionPopover: View {
                         .foregroundStyle(.secondary)
                 }
             }
-            .font(.caption)
+            .font(.headline.bold())
         }
-        .padding(8)
+        .foregroundStyle(.white)
+        .padding(20)
         .background {
-            RoundedRectangle(cornerRadius: 8)
-                .fill(.background)
-                .shadow(radius: 2)
+            RoundedRectangle(cornerRadius: 10)
+                .fill(Color.blue.gradient)
         }
     }
 }

+ 12 - 11
FreeAPS/Sources/Modules/Stat/View/ViewElements/MealStatsView.swift

@@ -320,13 +320,13 @@ struct MealStatsView: View {
                 RuleMark(
                     x: .value("Selected Date", selectedDate)
                 )
-                .foregroundStyle(.secondary.opacity(0.3))
+                .foregroundStyle(.secondary.opacity(0.5))
                 .annotation(
                     position: .top,
                     spacing: 0,
                     overflowResolution: .init(x: .fit(to: .chart), y: .fit(to: .chart))
                 ) {
-                    MealSelectionPopover(date: selectedDate, meal: selectedMeal)
+                    MealSelectionPopover(date: selectedDate, meal: selectedMeal, selectedDuration: selectedDuration)
                 }
             }
         }
@@ -403,13 +403,15 @@ private struct MealSelectionPopover: View {
     let date: Date
     // The meal statistics to display
     let meal: MealStats
+    // The selected duration in the time picker
+    let selectedDuration: Stat.StateModel.StatsTimeInterval
 
     var body: some View {
         VStack(alignment: .leading, spacing: 4) {
             // Display formatted date header
-            Text(date.formatted(.dateTime.month().day()))
-                .font(.caption)
-                .foregroundStyle(.secondary)
+            Text(selectedDuration == .Day ? date.formatted(.dateTime.hour().minute()) : date.formatted(.dateTime.month().day()))
+                .font(.subheadline)
+                .fontWeight(.bold)
 
             // Grid layout for macronutrient values
             Grid(alignment: .leading) {
@@ -435,14 +437,13 @@ private struct MealSelectionPopover: View {
                     Text("g")
                 }
             }
-            .font(.caption)
+            .font(.headline.bold())
         }
-        .padding(8)
+        .foregroundStyle(.white)
+        .padding(20)
         .background(
-            // Add background styling with shadow
-            RoundedRectangle(cornerRadius: 8)
-                .fill(Color(.systemBackground))
-                .shadow(radius: 2)
+            RoundedRectangle(cornerRadius: 10)
+                .fill(Color.orange.gradient)
         )
     }
 }

+ 11 - 13
FreeAPS/Sources/Modules/Stat/View/ViewElements/TDDChart.swift

@@ -205,13 +205,13 @@ struct TDDChartView: View {
                 RuleMark(
                     x: .value("Selected Date", selectedDate)
                 )
-                .foregroundStyle(.secondary.opacity(0.3))
+                .foregroundStyle(.secondary.opacity(0.5))
                 .annotation(
                     position: .top,
                     spacing: 0,
                     overflowResolution: .init(x: .fit(to: .chart), y: .fit(to: .chart))
                 ) {
-                    TDDSelectionPopover(date: selectedDate, tdd: selectedTDD)
+                    TDDSelectionPopover(date: selectedDate, tdd: selectedTDD, selectedDuration: selectedDuration)
                 }
             }
         }
@@ -273,23 +273,21 @@ struct TDDChartView: View {
 private struct TDDSelectionPopover: View {
     let date: Date
     let tdd: TDDStats
-
+    let selectedDuration: Stat.StateModel.StatsTimeInterval
     var body: some View {
         VStack(alignment: .leading, spacing: 4) {
-            Text(date.formatted(.dateTime.month().day()))
-                .font(.caption)
-                .foregroundStyle(.secondary)
+            Text(selectedDuration == .Day ? date.formatted(.dateTime.hour().minute()) : date.formatted(.dateTime.month().day()))
+                .font(.subheadline)
+                .fontWeight(.bold)
 
             Text(tdd.amount.formatted(.number.precision(.fractionLength(1))) + " U")
-                .font(.caption)
-                .bold()
+                .font(.title3.bold())
         }
-        .padding(.horizontal, 8)
-        .padding(.vertical, 4)
+        .foregroundStyle(.white)
+        .padding(20)
         .background {
-            RoundedRectangle(cornerRadius: 8)
-                .fill(.background)
-                .shadow(radius: 2)
+            RoundedRectangle(cornerRadius: 10)
+                .fill(Color.insulin.gradient)
         }
     }
 }