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

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 недель назад: 3
Родитель
Сommit
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 {
108 108
         addButton.target = self
109 109
         addButton.action = #selector(didTapAdd)
110 110
         addButton.translatesAutoresizingMaskIntoConstraints = false
111
-        // Keep the pill at intrinsic width so title + arrow stay grouped and centered; otherwise a wide stack pins text and icon to opposite edges.
112 111
         addButton.setContentHuggingPriority(.required, for: .horizontal)
113 112
         addButton.setContentCompressionResistancePriority(.required, for: .horizontal)
113
+        NSLayoutConstraint.activate([
114
+            addButton.heightAnchor.constraint(equalToConstant: 32),
115
+            addButton.widthAnchor.constraint(greaterThanOrEqualToConstant: 76)
116
+        ])
114 117
 
115 118
         let titleSubtitleStack = NSStackView(views: [title, subtitle])
116 119
         titleSubtitleStack.orientation = .vertical
@@ -299,10 +302,10 @@ private final class ProfileListRowView: NSView {
299 302
     }
300 303
 }
301 304
 
302
-// MARK: - Primary CTA (matches profile page button)
305
+// MARK: - Primary CTA (matches job cards’ Apply: 13pt semibold, 32pt tall, 8pt corners)
303 306
 
304 307
 private final class ProfilesPrimaryButton: NSButton {
305
-    private static let intrinsicPadding = NSEdgeInsets(top: 12, left: 28, bottom: 12, right: 28)
308
+    private static let horizontalOutset: CGFloat = 20
306 309
 
307 310
     private var trackingArea: NSTrackingArea?
308 311
     private var didPushCursor = false
@@ -325,29 +328,21 @@ private final class ProfilesPrimaryButton: NSButton {
325 328
     }
326 329
 
327 330
     private func commonInit() {
331
+        translatesAutoresizingMaskIntoConstraints = false
328 332
         bezelStyle = .rounded
329 333
         isBordered = false
330
-        font = .systemFont(ofSize: 15, weight: .semibold)
334
+        font = .systemFont(ofSize: 13, weight: .semibold)
331 335
         contentTintColor = .white
336
+        focusRingType = .none
332 337
         wantsLayer = true
333
-        layer?.masksToBounds = true
334
-        if #available(macOS 11.0, *) {
335
-            layer?.cornerCurve = .continuous
336
-        }
338
+        layer?.cornerRadius = 8
337 339
         layer?.backgroundColor = ProfilesListPalette.brandBlue.cgColor
338 340
     }
339 341
 
340 342
     override var intrinsicContentSize: NSSize {
341 343
         let base = super.intrinsicContentSize
342
-        let p = Self.intrinsicPadding
343
-        return NSSize(width: base.width + p.left + p.right, height: base.height + p.top + p.bottom)
344
-    }
345
-
346
-    override func layout() {
347
-        super.layout()
348
-        let h = bounds.height
349
-        guard h > 1 else { return }
350
-        layer?.cornerRadius = h / 2
344
+        guard base.width != NSView.noIntrinsicMetric, base.width >= 1 else { return base }
345
+        return NSSize(width: base.width + Self.horizontalOutset, height: base.height)
351 346
     }
352 347
 
353 348
     override func updateTrackingAreas() {