Forráskód Böngészése

Refine home action tile sizing for tighter layout.

Reduce tile dimensions and spacing while increasing icon glyph size for better visual balance in the New meeting, Join, and Schedule actions.

Made-with: Cursor
huzaifahayat12 3 hónapja
szülő
commit
fdc181c57f
1 módosított fájl, 14 hozzáadás és 10 törlés
  1. 14 10
      zoom_app/ViewController.swift

+ 14 - 10
zoom_app/ViewController.swift

@@ -934,7 +934,7 @@ class ViewController: NSViewController {
             makeActionTile(title: "Schedule", symbol: "calendar", color: accentBlue, action: #selector(scheduleMeetingWebTapped))
         ])
         actions.orientation = .horizontal
-        actions.spacing = 16
+        actions.spacing = 12
         actions.alignment = .centerY
         actions.distribution = .fillEqually
 
@@ -1284,21 +1284,25 @@ class ViewController: NSViewController {
     private func makeActionTile(title: String, symbol: String, color: NSColor, action: Selector? = nil) -> NSView {
         let root = NSView()
         root.translatesAutoresizingMaskIntoConstraints = false
-        root.widthAnchor.constraint(equalToConstant: 104).isActive = true
-        root.heightAnchor.constraint(equalToConstant: 100).isActive = true
+        root.widthAnchor.constraint(equalToConstant: 88).isActive = true
+        root.heightAnchor.constraint(equalToConstant: 70).isActive = true
 
         let iconButton = NSButton(title: "", target: action == nil ? nil : self, action: action)
         iconButton.isBordered = false
         iconButton.wantsLayer = true
         iconButton.layer?.backgroundColor = color.cgColor
-        iconButton.layer?.cornerRadius = 20
+        iconButton.layer?.cornerRadius = 15
         iconButton.layer?.shadowOpacity = 0.2
         iconButton.layer?.shadowRadius = 7
         iconButton.layer?.shadowOffset = NSSize(width: 0, height: -1)
-        iconButton.image = NSImage(systemSymbolName: symbol, accessibilityDescription: title)
+        let symbolConfig = NSImage.SymbolConfiguration(pointSize: 22, weight: .semibold)
+        if let baseImage = NSImage(systemSymbolName: symbol, accessibilityDescription: title),
+           let configured = baseImage.withSymbolConfiguration(symbolConfig) {
+            iconButton.image = configured
+        }
         iconButton.contentTintColor = .white
-        iconButton.imageScaling = .scaleProportionallyUpOrDown
-        let label = makeLabel(title, size: 14, color: secondaryText, weight: .regular, centered: true)
+        iconButton.imageScaling = .scaleNone
+        let label = makeLabel(title, size: 12, color: secondaryText, weight: .regular, centered: true)
 
         [iconButton, label].forEach {
             $0.translatesAutoresizingMaskIntoConstraints = false
@@ -1307,9 +1311,9 @@ class ViewController: NSViewController {
         NSLayoutConstraint.activate([
             iconButton.topAnchor.constraint(equalTo: root.topAnchor),
             iconButton.centerXAnchor.constraint(equalTo: root.centerXAnchor),
-            iconButton.widthAnchor.constraint(equalToConstant: 64),
-            iconButton.heightAnchor.constraint(equalToConstant: 64),
-            label.topAnchor.constraint(equalTo: iconButton.bottomAnchor, constant: 10),
+            iconButton.widthAnchor.constraint(equalToConstant: 50),
+            iconButton.heightAnchor.constraint(equalToConstant: 50),
+            label.topAnchor.constraint(equalTo: iconButton.bottomAnchor, constant: 8),
             label.centerXAnchor.constraint(equalTo: root.centerXAnchor),
             label.bottomAnchor.constraint(equalTo: root.bottomAnchor)
         ])