|
@@ -31,7 +31,7 @@ final class ProfilesListPageView: NSView {
|
|
|
private let documentView = ProfilesListDocumentView()
|
|
private let documentView = ProfilesListDocumentView()
|
|
|
private let contentStack = NSStackView()
|
|
private let contentStack = NSStackView()
|
|
|
private let emptyStateLabel = NSTextField(wrappingLabelWithString: "")
|
|
private let emptyStateLabel = NSTextField(wrappingLabelWithString: "")
|
|
|
- private let addButton = ProfilesPrimaryButton(title: "Add new profile", showsTrailingArrow: true, target: nil, action: nil)
|
|
|
|
|
|
|
+ private let addButton = ProfilesPrimaryButton(title: "Add new profile", target: nil, action: nil)
|
|
|
|
|
|
|
|
override var userInterfaceLayoutDirection: NSUserInterfaceLayoutDirection {
|
|
override var userInterfaceLayoutDirection: NSUserInterfaceLayoutDirection {
|
|
|
get { .leftToRight }
|
|
get { .leftToRight }
|
|
@@ -256,8 +256,7 @@ private final class ProfileListRowView: NSView {
|
|
|
// MARK: - Primary CTA (matches profile page button)
|
|
// MARK: - Primary CTA (matches profile page button)
|
|
|
|
|
|
|
|
private final class ProfilesPrimaryButton: NSButton {
|
|
private final class ProfilesPrimaryButton: NSButton {
|
|
|
- /// Horizontal padding around title + icon. Extra trailing inset keeps the SF arrow off the capsule curve (`masksToBounds` can clip at the ends).
|
|
|
|
|
- private static let intrinsicPadding = NSEdgeInsets(top: 12, left: 28, bottom: 12, right: 44)
|
|
|
|
|
|
|
+ private static let intrinsicPadding = NSEdgeInsets(top: 12, left: 28, bottom: 12, right: 28)
|
|
|
|
|
|
|
|
private var trackingArea: NSTrackingArea?
|
|
private var trackingArea: NSTrackingArea?
|
|
|
private var didPushCursor = false
|
|
private var didPushCursor = false
|
|
@@ -272,17 +271,11 @@ private final class ProfilesPrimaryButton: NSButton {
|
|
|
commonInit()
|
|
commonInit()
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- convenience init(title: String, showsTrailingArrow: Bool = false, target: AnyObject?, action: Selector?) {
|
|
|
|
|
|
|
+ convenience init(title: String, target: AnyObject?, action: Selector?) {
|
|
|
self.init(frame: .zero)
|
|
self.init(frame: .zero)
|
|
|
self.title = title
|
|
self.title = title
|
|
|
self.target = target
|
|
self.target = target
|
|
|
self.action = action
|
|
self.action = action
|
|
|
- if showsTrailingArrow {
|
|
|
|
|
- imagePosition = .imageTrailing
|
|
|
|
|
- let symbolConfig = NSImage.SymbolConfiguration(pointSize: 12, weight: .semibold)
|
|
|
|
|
- image = NSImage(systemSymbolName: "arrow.right", accessibilityDescription: nil)?
|
|
|
|
|
- .withSymbolConfiguration(symbolConfig)
|
|
|
|
|
- }
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private func commonInit() {
|
|
private func commonInit() {
|
|
@@ -301,12 +294,7 @@ private final class ProfilesPrimaryButton: NSButton {
|
|
|
override var intrinsicContentSize: NSSize {
|
|
override var intrinsicContentSize: NSSize {
|
|
|
let base = super.intrinsicContentSize
|
|
let base = super.intrinsicContentSize
|
|
|
let p = Self.intrinsicPadding
|
|
let p = Self.intrinsicPadding
|
|
|
- // `NSButton` intrinsic width can sit a few points tight vs. the symbol’s painted bounds; add slack so the arrow never kisses the pill edge.
|
|
|
|
|
- let trailingSlack: CGFloat = image != nil ? 10 : 0
|
|
|
|
|
- return NSSize(
|
|
|
|
|
- width: base.width + p.left + p.right + trailingSlack,
|
|
|
|
|
- height: base.height + p.top + p.bottom
|
|
|
|
|
- )
|
|
|
|
|
|
|
+ return NSSize(width: base.width + p.left + p.right, height: base.height + p.top + p.bottom)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
override func layout() {
|
|
override func layout() {
|