Przeglądaj źródła

Adjust treatment button size on small device WIP

Deniz Cengiz 1 rok temu
rodzic
commit
8a35e06618

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

@@ -116,11 +116,16 @@ struct TrioMainWatchView: View {
         var foregroundColor: Color = .white
         var foregroundColor: Color = .white
         var fontSize: Font = .title2
         var fontSize: Font = .title2
 
 
+        private var is40mm: Bool {
+            let size = WKInterfaceDevice.current().screenBounds.size
+            return size.height < 225 && size.width < 185
+        }
+
         func makeBody(configuration: Configuration) -> some View {
         func makeBody(configuration: Configuration) -> some View {
             configuration.label
             configuration.label
                 .font(fontSize)
                 .font(fontSize)
-                .fontWeight(.semibold)
-                .padding()
+                .fontWeight(is40mm ? .medium : .semibold)
+                .padding(is40mm ? 6 : 10)
                 .background(
                 .background(
                     backgroundGradient.opacity(configuration.isPressed ? 0.8 : 1.0)
                     backgroundGradient.opacity(configuration.isPressed ? 0.8 : 1.0)
                 )
                 )