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

Add Teams and Zoho tab logos and tune platform icon sizes.

Include retina image sets for Microsoft Teams (original colors) and Zoho (template), extend topTab with template and aspect options, and adjust Zoom and Teams display sizes.

Made-with: Cursor
huzaifahayat12 3 месяцев назад
Родитель
Сommit
a87b6a19d1

+ 23 - 0
meetings_app/Assets.xcassets/TeamsLogo.imageset/Contents.json

@@ -0,0 +1,23 @@
+{
+  "images" : [
+    {
+      "filename" : "teams_logo.png",
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "teams_logo@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "filename" : "teams_logo@3x.png",
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

BIN
meetings_app/Assets.xcassets/TeamsLogo.imageset/teams_logo.png


BIN
meetings_app/Assets.xcassets/TeamsLogo.imageset/teams_logo@2x.png


BIN
meetings_app/Assets.xcassets/TeamsLogo.imageset/teams_logo@3x.png


+ 26 - 0
meetings_app/Assets.xcassets/ZohoLogo.imageset/Contents.json

@@ -0,0 +1,26 @@
+{
+  "images" : [
+    {
+      "filename" : "zoho_logo.png",
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "zoho_logo@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "filename" : "zoho_logo@3x.png",
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  },
+  "properties" : {
+    "template-rendering-intent" : "template"
+  }
+}

BIN
meetings_app/Assets.xcassets/ZohoLogo.imageset/zoho_logo.png


BIN
meetings_app/Assets.xcassets/ZohoLogo.imageset/zoho_logo@2x.png


BIN
meetings_app/Assets.xcassets/ZohoLogo.imageset/zoho_logo@3x.png


+ 8 - 6
meetings_app/ViewController.swift

@@ -155,9 +155,9 @@ private extension ViewController {
         stack.spacing = 4
         stack.spacing = 4
 
 
         stack.addArrangedSubview(topTab("Meet", icon: "􀤆", selected: true, logoImageName: "MeetLogo"))
         stack.addArrangedSubview(topTab("Meet", icon: "􀤆", selected: true, logoImageName: "MeetLogo"))
-        stack.addArrangedSubview(topTab("Zoom", icon: "􀤉", selected: false, logoImageName: "ZoomLogo", logoPointSize: 30))
-        stack.addArrangedSubview(topTab("Teams", icon: "􀉨", selected: false))
-        stack.addArrangedSubview(topTab("Zoho", icon: "􀯶", selected: false))
+        stack.addArrangedSubview(topTab("Zoom", icon: "􀤉", selected: false, logoImageName: "ZoomLogo", logoPointSize: 34))
+        stack.addArrangedSubview(topTab("Teams", icon: "􀉨", selected: false, logoImageName: "TeamsLogo", logoPointSize: 26, logoHeightMultiplier: 62.0 / 50.0, logoTemplate: false))
+        stack.addArrangedSubview(topTab("Zoho", icon: "􀯶", selected: false, logoImageName: "ZohoLogo", logoPointSize: 28))
 
 
         shell.addSubview(stack)
         shell.addSubview(stack)
         wrapper.addSubview(shell)
         wrapper.addSubview(shell)
@@ -389,7 +389,7 @@ private extension ViewController {
         return item
         return item
     }
     }
 
 
-    func topTab(_ title: String, icon: String, selected: Bool, logoImageName: String? = nil, logoPointSize: CGFloat = 26) -> NSView {
+    func topTab(_ title: String, icon: String, selected: Bool, logoImageName: String? = nil, logoPointSize: CGFloat = 26, logoHeightMultiplier: CGFloat = 1, logoTemplate: Bool = true) -> NSView {
         let tab = roundedContainer(cornerRadius: 19, color: selected ? palette.primaryBlue : .clear)
         let tab = roundedContainer(cornerRadius: 19, color: selected ? palette.primaryBlue : .clear)
         tab.translatesAutoresizingMaskIntoConstraints = false
         tab.translatesAutoresizingMaskIntoConstraints = false
 
 
@@ -400,7 +400,9 @@ private extension ViewController {
             imageView.imageScaling = .scaleProportionallyDown
             imageView.imageScaling = .scaleProportionallyDown
             imageView.imageAlignment = .alignCenter
             imageView.imageAlignment = .alignCenter
             imageView.isEditable = false
             imageView.isEditable = false
-            imageView.contentTintColor = palette.textPrimary
+            if logoTemplate {
+                imageView.contentTintColor = palette.textPrimary
+            }
             leadingView = imageView
             leadingView = imageView
         } else {
         } else {
             leadingView = textLabel(icon, font: typography.tabIcon, color: palette.textPrimary)
             leadingView = textLabel(icon, font: typography.tabIcon, color: palette.textPrimary)
@@ -420,7 +422,7 @@ private extension ViewController {
         if logoImageName != nil {
         if logoImageName != nil {
             constraints.append(contentsOf: [
             constraints.append(contentsOf: [
                 leadingView.widthAnchor.constraint(equalToConstant: logoPointSize),
                 leadingView.widthAnchor.constraint(equalToConstant: logoPointSize),
-                leadingView.heightAnchor.constraint(equalToConstant: logoPointSize)
+                leadingView.heightAnchor.constraint(equalToConstant: logoPointSize * logoHeightMultiplier)
             ])
             ])
         }
         }
         NSLayoutConstraint.activate(constraints)
         NSLayoutConstraint.activate(constraints)