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

Merge remote-tracking branch 'Jon-b-m/test_merge' into test_merge

Jon B.M 4 лет назад
Родитель
Сommit
ae6c02522c

+ 38 - 0
FreeAPS/Resources/Assets.xcassets/Colors/DarkerBlue.colorset/Contents.json

@@ -0,0 +1,38 @@
+{
+  "colors" : [
+    {
+      "color" : {
+        "color-space" : "srgb",
+        "components" : {
+          "alpha" : "1.000",
+          "blue" : "1.000",
+          "green" : "0.288",
+          "red" : "0.118"
+        }
+      },
+      "idiom" : "universal"
+    },
+    {
+      "appearances" : [
+        {
+          "appearance" : "luminosity",
+          "value" : "dark"
+        }
+      ],
+      "color" : {
+        "color-space" : "srgb",
+        "components" : {
+          "alpha" : "1.000",
+          "blue" : "1.000",
+          "green" : "0.288",
+          "red" : "0.118"
+        }
+      },
+      "idiom" : "universal"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

+ 38 - 0
FreeAPS/Resources/Assets.xcassets/Colors/LoopOrange.colorset/Contents.json

@@ -0,0 +1,38 @@
+{
+  "colors" : [
+    {
+      "color" : {
+        "color-space" : "srgb",
+        "components" : {
+          "alpha" : "1.000",
+          "blue" : "0.171",
+          "green" : "0.457",
+          "red" : "1.000"
+        }
+      },
+      "idiom" : "universal"
+    },
+    {
+      "appearances" : [
+        {
+          "appearance" : "luminosity",
+          "value" : "dark"
+        }
+      ],
+      "color" : {
+        "color-space" : "srgb",
+        "components" : {
+          "alpha" : "1.000",
+          "blue" : "0.171",
+          "green" : "0.457",
+          "red" : "1.000"
+        }
+      },
+      "idiom" : "universal"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

+ 2 - 0
FreeAPS/Sources/Helpers/Color+Extensions.swift

@@ -10,4 +10,6 @@ extension Color {
     static let zt = Color("ZT")
     static let tempBasal = Color("TempBasal")
     static let basal = Color("Basal")
+    static let darkerBlue = Color("DarkerBlue")
+    static let loopOrange = Color("LoopOrange")
 }

+ 8 - 7
FreeAPS/Sources/Views/TagCloudView.swift

@@ -6,7 +6,6 @@ struct TagCloudView: View {
     @State private var totalHeight
 //          = CGFloat.zero       // << variant for ScrollView/List
         = CGFloat.infinity // << variant for VStack
-
     var body: some View {
         VStack {
             GeometryReader { geometry in
@@ -24,7 +23,7 @@ struct TagCloudView: View {
         return ZStack(alignment: .topLeading) {
             ForEach(self.tags, id: \.self) { tag in
                 self.item(for: tag)
-                    .padding([.horizontal, .vertical], 4)
+                    .padding([.horizontal, .vertical], 2)
                     .alignmentGuide(.leading, computeValue: { d in
                         if abs(width - d.width) > g.size.width
                         {
@@ -52,21 +51,23 @@ struct TagCloudView: View {
 
     private func item(for textTag: String) -> some View {
         var colorOfTag: Color {
-            if textTag.contains("Floating") {
+            if textTag.contains("Not Floating") {
                 return .loopYellow } else {
                 switch textTag {
+                case "Floating":
+                    return .loopOrange
                 case "autoISF":
                     return .zt
                 case "SMB Delivery Ratio:":
-                    return .loopOrange
+                    return .uam
                 case "Parabolic Fit":
                     return .loopRed
                 case "Autosense":
                     return .loopGreen
                 case "Standard":
-                    return .insulin
+                    return .darkerBlue
                 default:
-                    return .basal
+                    return .insulin
                 }
             }
         }
@@ -76,7 +77,7 @@ struct TagCloudView: View {
             .font(.caption)
             .background(colorOfTag.opacity(0.8))
             .foregroundColor(Color.white)
-            .cornerRadius(5)
+            .cornerRadius(5) }
     }
 
     private func viewHeightReader(_ binding: Binding<CGFloat>) -> some View {