ソースを参照

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 2 週間 前
コミット
a87b6a19d1

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

@@ -0,0 +1,23 @@
1
+{
2
+  "images" : [
3
+    {
4
+      "filename" : "teams_logo.png",
5
+      "idiom" : "universal",
6
+      "scale" : "1x"
7
+    },
8
+    {
9
+      "filename" : "teams_logo@2x.png",
10
+      "idiom" : "universal",
11
+      "scale" : "2x"
12
+    },
13
+    {
14
+      "filename" : "teams_logo@3x.png",
15
+      "idiom" : "universal",
16
+      "scale" : "3x"
17
+    }
18
+  ],
19
+  "info" : {
20
+    "author" : "xcode",
21
+    "version" : 1
22
+  }
23
+}

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 @@
1
+{
2
+  "images" : [
3
+    {
4
+      "filename" : "zoho_logo.png",
5
+      "idiom" : "universal",
6
+      "scale" : "1x"
7
+    },
8
+    {
9
+      "filename" : "zoho_logo@2x.png",
10
+      "idiom" : "universal",
11
+      "scale" : "2x"
12
+    },
13
+    {
14
+      "filename" : "zoho_logo@3x.png",
15
+      "idiom" : "universal",
16
+      "scale" : "3x"
17
+    }
18
+  ],
19
+  "info" : {
20
+    "author" : "xcode",
21
+    "version" : 1
22
+  },
23
+  "properties" : {
24
+    "template-rendering-intent" : "template"
25
+  }
26
+}

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 {
155
         stack.spacing = 4
155
         stack.spacing = 4
156
 
156
 
157
         stack.addArrangedSubview(topTab("Meet", icon: "􀤆", selected: true, logoImageName: "MeetLogo"))
157
         stack.addArrangedSubview(topTab("Meet", icon: "􀤆", selected: true, logoImageName: "MeetLogo"))
158
-        stack.addArrangedSubview(topTab("Zoom", icon: "􀤉", selected: false, logoImageName: "ZoomLogo", logoPointSize: 30))
159
-        stack.addArrangedSubview(topTab("Teams", icon: "􀉨", selected: false))
160
-        stack.addArrangedSubview(topTab("Zoho", icon: "􀯶", selected: false))
158
+        stack.addArrangedSubview(topTab("Zoom", icon: "􀤉", selected: false, logoImageName: "ZoomLogo", logoPointSize: 34))
159
+        stack.addArrangedSubview(topTab("Teams", icon: "􀉨", selected: false, logoImageName: "TeamsLogo", logoPointSize: 26, logoHeightMultiplier: 62.0 / 50.0, logoTemplate: false))
160
+        stack.addArrangedSubview(topTab("Zoho", icon: "􀯶", selected: false, logoImageName: "ZohoLogo", logoPointSize: 28))
161
 
161
 
162
         shell.addSubview(stack)
162
         shell.addSubview(stack)
163
         wrapper.addSubview(shell)
163
         wrapper.addSubview(shell)
@@ -389,7 +389,7 @@ private extension ViewController {
389
         return item
389
         return item
390
     }
390
     }
391
 
391
 
392
-    func topTab(_ title: String, icon: String, selected: Bool, logoImageName: String? = nil, logoPointSize: CGFloat = 26) -> NSView {
392
+    func topTab(_ title: String, icon: String, selected: Bool, logoImageName: String? = nil, logoPointSize: CGFloat = 26, logoHeightMultiplier: CGFloat = 1, logoTemplate: Bool = true) -> NSView {
393
         let tab = roundedContainer(cornerRadius: 19, color: selected ? palette.primaryBlue : .clear)
393
         let tab = roundedContainer(cornerRadius: 19, color: selected ? palette.primaryBlue : .clear)
394
         tab.translatesAutoresizingMaskIntoConstraints = false
394
         tab.translatesAutoresizingMaskIntoConstraints = false
395
 
395
 
@@ -400,7 +400,9 @@ private extension ViewController {
400
             imageView.imageScaling = .scaleProportionallyDown
400
             imageView.imageScaling = .scaleProportionallyDown
401
             imageView.imageAlignment = .alignCenter
401
             imageView.imageAlignment = .alignCenter
402
             imageView.isEditable = false
402
             imageView.isEditable = false
403
-            imageView.contentTintColor = palette.textPrimary
403
+            if logoTemplate {
404
+                imageView.contentTintColor = palette.textPrimary
405
+            }
404
             leadingView = imageView
406
             leadingView = imageView
405
         } else {
407
         } else {
406
             leadingView = textLabel(icon, font: typography.tabIcon, color: palette.textPrimary)
408
             leadingView = textLabel(icon, font: typography.tabIcon, color: palette.textPrimary)
@@ -420,7 +422,7 @@ private extension ViewController {
420
         if logoImageName != nil {
422
         if logoImageName != nil {
421
             constraints.append(contentsOf: [
423
             constraints.append(contentsOf: [
422
                 leadingView.widthAnchor.constraint(equalToConstant: logoPointSize),
424
                 leadingView.widthAnchor.constraint(equalToConstant: logoPointSize),
423
-                leadingView.heightAnchor.constraint(equalToConstant: logoPointSize)
425
+                leadingView.heightAnchor.constraint(equalToConstant: logoPointSize * logoHeightMultiplier)
424
             ])
426
             ])
425
         }
427
         }
426
         NSLayoutConstraint.activate(constraints)
428
         NSLayoutConstraint.activate(constraints)