Преглед изворни кода

Match Add new profile button to job card Apply styling.

Use the same 13pt semibold label, 32pt height, and 8pt corners as Apply/Saved CTAs instead of the oversized pill.

Co-authored-by: Cursor <cursoragent@cursor.com>
AhtashamShahzad1 пре 2 месеци
родитељ
комит
07de939cd6
1 измењених фајлова са 12 додато и 17 уклоњено
  1. 12 17
      App for Indeed/Views/ProfilesListPageView.swift

+ 12 - 17
App for Indeed/Views/ProfilesListPageView.swift

@@ -108,9 +108,12 @@ final class ProfilesListPageView: NSView {
         addButton.target = self
         addButton.action = #selector(didTapAdd)
         addButton.translatesAutoresizingMaskIntoConstraints = false
-        // Keep the pill at intrinsic width so title + arrow stay grouped and centered; otherwise a wide stack pins text and icon to opposite edges.
         addButton.setContentHuggingPriority(.required, for: .horizontal)
         addButton.setContentCompressionResistancePriority(.required, for: .horizontal)
+        NSLayoutConstraint.activate([
+            addButton.heightAnchor.constraint(equalToConstant: 32),
+            addButton.widthAnchor.constraint(greaterThanOrEqualToConstant: 76)
+        ])
 
         let titleSubtitleStack = NSStackView(views: [title, subtitle])
         titleSubtitleStack.orientation = .vertical
@@ -299,10 +302,10 @@ private final class ProfileListRowView: NSView {
     }
 }
 
-// MARK: - Primary CTA (matches profile page button)
+// MARK: - Primary CTA (matches job cards’ Apply: 13pt semibold, 32pt tall, 8pt corners)
 
 private final class ProfilesPrimaryButton: NSButton {
-    private static let intrinsicPadding = NSEdgeInsets(top: 12, left: 28, bottom: 12, right: 28)
+    private static let horizontalOutset: CGFloat = 20
 
     private var trackingArea: NSTrackingArea?
     private var didPushCursor = false
@@ -325,29 +328,21 @@ private final class ProfilesPrimaryButton: NSButton {
     }
 
     private func commonInit() {
+        translatesAutoresizingMaskIntoConstraints = false
         bezelStyle = .rounded
         isBordered = false
-        font = .systemFont(ofSize: 15, weight: .semibold)
+        font = .systemFont(ofSize: 13, weight: .semibold)
         contentTintColor = .white
+        focusRingType = .none
         wantsLayer = true
-        layer?.masksToBounds = true
-        if #available(macOS 11.0, *) {
-            layer?.cornerCurve = .continuous
-        }
+        layer?.cornerRadius = 8
         layer?.backgroundColor = ProfilesListPalette.brandBlue.cgColor
     }
 
     override var intrinsicContentSize: NSSize {
         let base = super.intrinsicContentSize
-        let p = Self.intrinsicPadding
-        return NSSize(width: base.width + p.left + p.right, height: base.height + p.top + p.bottom)
-    }
-
-    override func layout() {
-        super.layout()
-        let h = bounds.height
-        guard h > 1 else { return }
-        layer?.cornerRadius = h / 2
+        guard base.width != NSView.noIntrinsicMetric, base.width >= 1 else { return base }
+        return NSSize(width: base.width + Self.horizontalOutset, height: base.height)
     }
 
     override func updateTrackingAreas() {