|
@@ -108,9 +108,12 @@ final class ProfilesListPageView: NSView {
|
|
|
addButton.target = self
|
|
addButton.target = self
|
|
|
addButton.action = #selector(didTapAdd)
|
|
addButton.action = #selector(didTapAdd)
|
|
|
addButton.translatesAutoresizingMaskIntoConstraints = false
|
|
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.setContentHuggingPriority(.required, for: .horizontal)
|
|
|
addButton.setContentCompressionResistancePriority(.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])
|
|
let titleSubtitleStack = NSStackView(views: [title, subtitle])
|
|
|
titleSubtitleStack.orientation = .vertical
|
|
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 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 trackingArea: NSTrackingArea?
|
|
|
private var didPushCursor = false
|
|
private var didPushCursor = false
|
|
@@ -325,29 +328,21 @@ private final class ProfilesPrimaryButton: NSButton {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private func commonInit() {
|
|
private func commonInit() {
|
|
|
|
|
+ translatesAutoresizingMaskIntoConstraints = false
|
|
|
bezelStyle = .rounded
|
|
bezelStyle = .rounded
|
|
|
isBordered = false
|
|
isBordered = false
|
|
|
- font = .systemFont(ofSize: 15, weight: .semibold)
|
|
|
|
|
|
|
+ font = .systemFont(ofSize: 13, weight: .semibold)
|
|
|
contentTintColor = .white
|
|
contentTintColor = .white
|
|
|
|
|
+ focusRingType = .none
|
|
|
wantsLayer = true
|
|
wantsLayer = true
|
|
|
- layer?.masksToBounds = true
|
|
|
|
|
- if #available(macOS 11.0, *) {
|
|
|
|
|
- layer?.cornerCurve = .continuous
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ layer?.cornerRadius = 8
|
|
|
layer?.backgroundColor = ProfilesListPalette.brandBlue.cgColor
|
|
layer?.backgroundColor = ProfilesListPalette.brandBlue.cgColor
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
override var intrinsicContentSize: NSSize {
|
|
override var intrinsicContentSize: NSSize {
|
|
|
let base = super.intrinsicContentSize
|
|
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() {
|
|
override func updateTrackingAreas() {
|