Ver código fonte

Center and enlarge profile Save button

Pin the save action to the host with centerX, raise preferred width and
height, and lower horizontal hugging so layout can honor the wider frame.
Bump primary button typography and corner radius to match the larger control.

Co-authored-by: Cursor <cursoragent@cursor.com>
AhtashamShahzad1 2 meses atrás
pai
commit
3deb1bc9e8
1 arquivos alterados com 9 adições e 5 exclusões
  1. 9 5
      App for Indeed/Views/MyProfilePageView.swift

+ 9 - 5
App for Indeed/Views/MyProfilePageView.swift

@@ -861,17 +861,21 @@ final class MyProfilePageView: NSView {
 
     private func saveButtonHost() -> NSView {
         saveButton.translatesAutoresizingMaskIntoConstraints = false
+        saveButton.setContentHuggingPriority(.defaultLow, for: .horizontal)
         let host = NSView()
         host.translatesAutoresizingMaskIntoConstraints = false
         host.userInterfaceLayoutDirection = .leftToRight
         ProfileLayoutEnforcement.applyForcedLTR(to: host)
         host.addSubview(saveButton)
+        let preferredWidth = saveButton.widthAnchor.constraint(equalToConstant: 292)
+        preferredWidth.priority = .defaultHigh
         NSLayoutConstraint.activate([
-            saveButton.leadingAnchor.constraint(equalTo: host.leadingAnchor),
+            saveButton.centerXAnchor.constraint(equalTo: host.centerXAnchor),
             saveButton.topAnchor.constraint(equalTo: host.topAnchor),
             saveButton.bottomAnchor.constraint(equalTo: host.bottomAnchor),
-            saveButton.heightAnchor.constraint(equalToConstant: 48),
-            saveButton.trailingAnchor.constraint(lessThanOrEqualTo: host.trailingAnchor)
+            saveButton.heightAnchor.constraint(equalToConstant: 54),
+            preferredWidth,
+            saveButton.widthAnchor.constraint(lessThanOrEqualTo: host.widthAnchor)
         ])
         return host
     }
@@ -1320,10 +1324,10 @@ private final class ProfilePrimaryButton: NSButton {
     private func commonInit() {
         bezelStyle = .rounded
         isBordered = false
-        font = .systemFont(ofSize: 15, weight: .semibold)
+        font = .systemFont(ofSize: 16, weight: .semibold)
         contentTintColor = .white
         wantsLayer = true
-        layer?.cornerRadius = 12
+        layer?.cornerRadius = 14
         if #available(macOS 11.0, *) {
             layer?.cornerCurve = .continuous
         }