bastiaanv преди 6 месеца
родител
ревизия
e99a80b7d2

+ 5 - 4
LiveActivity/Views/LiveActivityView.swift

@@ -52,7 +52,7 @@ struct LiveActivityView: View {
                         context: context,
                         glucoseColor: .primary
                     )
-                    LiveActivityUpdatedLabelView(context: context, isDetailedLayout: false, isWatchOS: true)
+                    LiveActivityUpdatedLabelView(context: context, isDetailedLayout: false)
                 }
             }
             .addLiveActivityModifiers(isWatchOS: true)
@@ -112,7 +112,7 @@ struct LiveActivityView: View {
                             case .cob:
                                 LiveActivityCOBLabelView(context: context, additionalState: context.state.detailedViewState)
                             case .updatedLabel:
-                                LiveActivityUpdatedLabelView(context: context, isDetailedLayout: true, isWatchOS: false)
+                                LiveActivityUpdatedLabelView(context: context, isDetailedLayout: true)
                             case .totalDailyDose:
                                 LiveActivityTotalDailyDoseView(
                                     context: context,
@@ -152,7 +152,7 @@ struct LiveActivityView: View {
                                 context: context,
                                 glucoseColor: hasStaticColorScheme ? .primary : glucoseColor
                             ).font(.title3)
-                            LiveActivityUpdatedLabelView(context: context, isDetailedLayout: false, isWatchOS: false)
+                            LiveActivityUpdatedLabelView(context: context, isDetailedLayout: false)
                                 .font(.caption)
                                 .foregroundStyle(.primary.opacity(0.7))
                         }
@@ -202,7 +202,8 @@ struct LiveActivityExpandedCenterView: View {
     var context: ActivityViewContext<LiveActivityAttributes>
 
     var body: some View {
-        LiveActivityUpdatedLabelView(context: context, isDetailedLayout: false, isWatchOS: false).font(Font.caption)
+        LiveActivityUpdatedLabelView(context: context, isDetailedLayout: false)
+            .font(Font.caption)
             .foregroundStyle(Color.secondary)
             .addIsWatchOS()
     }

+ 5 - 4
LiveActivity/Views/WidgetItems/LiveActivityBGLabelLargeView.swift

@@ -3,27 +3,28 @@ import SwiftUI
 import WidgetKit
 
 struct LiveActivityBGLabelLargeView: View {
+    @Environment(\.isWatchOS) var isWatchOS
+
     var context: ActivityViewContext<LiveActivityAttributes>
     var glucoseColor: Color
-    var smallerFont: Bool = false
 
     var body: some View {
         HStack(alignment: .center) {
             if let trendArrow = context.state.direction {
                 Text(context.state.bg)
                     .fontWeight(.bold)
-                    .font(!smallerFont ? .title : .title3)
+                    .font(!isWatchOS ? .title : .title3)
                     .foregroundStyle(context.isStale ? .secondary : glucoseColor)
                     .strikethrough(context.isStale, pattern: .solid, color: .red.opacity(0.6))
 
                 Text(trendArrow)
                     .foregroundStyle(context.isStale ? .secondary : glucoseColor)
                     .fontWeight(.bold)
-                    .font(!smallerFont ? .headline : .subheadline)
+                    .font(!isWatchOS ? .headline : .subheadline)
             } else {
                 Text(context.state.bg)
                     .fontWeight(.bold)
-                    .font(!smallerFont ? .title : .title3)
+                    .font(!isWatchOS ? .title : .title3)
                     .foregroundStyle(context.isStale ? .secondary : glucoseColor)
                     .strikethrough(context.isStale, pattern: .solid, color: .red.opacity(0.6))
             }

+ 2 - 1
LiveActivity/Views/WidgetItems/LiveActivityUpdatedLabelView.swift

@@ -3,9 +3,10 @@ import SwiftUI
 import WidgetKit
 
 struct LiveActivityUpdatedLabelView: View {
+    @Environment(\.isWatchOS) var isWatchOS
+
     var context: ActivityViewContext<LiveActivityAttributes>
     var isDetailedLayout: Bool
-    var isWatchOS: Bool
 
     private var dateFormatter: DateFormatter {
         let formatter = DateFormatter()

+ 1 - 0
MedtrumKit

@@ -0,0 +1 @@
+Subproject commit c99cae1086284f27efd5e6000dbe2d76154d9325