소스 검색

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 달 전
부모
커밋
3deb1bc9e8
1개의 변경된 파일9개의 추가작업 그리고 5개의 파일을 삭제
  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 {
     private func saveButtonHost() -> NSView {
         saveButton.translatesAutoresizingMaskIntoConstraints = false
         saveButton.translatesAutoresizingMaskIntoConstraints = false
+        saveButton.setContentHuggingPriority(.defaultLow, for: .horizontal)
         let host = NSView()
         let host = NSView()
         host.translatesAutoresizingMaskIntoConstraints = false
         host.translatesAutoresizingMaskIntoConstraints = false
         host.userInterfaceLayoutDirection = .leftToRight
         host.userInterfaceLayoutDirection = .leftToRight
         ProfileLayoutEnforcement.applyForcedLTR(to: host)
         ProfileLayoutEnforcement.applyForcedLTR(to: host)
         host.addSubview(saveButton)
         host.addSubview(saveButton)
+        let preferredWidth = saveButton.widthAnchor.constraint(equalToConstant: 292)
+        preferredWidth.priority = .defaultHigh
         NSLayoutConstraint.activate([
         NSLayoutConstraint.activate([
-            saveButton.leadingAnchor.constraint(equalTo: host.leadingAnchor),
+            saveButton.centerXAnchor.constraint(equalTo: host.centerXAnchor),
             saveButton.topAnchor.constraint(equalTo: host.topAnchor),
             saveButton.topAnchor.constraint(equalTo: host.topAnchor),
             saveButton.bottomAnchor.constraint(equalTo: host.bottomAnchor),
             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
         return host
     }
     }
@@ -1320,10 +1324,10 @@ private final class ProfilePrimaryButton: NSButton {
     private func commonInit() {
     private func commonInit() {
         bezelStyle = .rounded
         bezelStyle = .rounded
         isBordered = false
         isBordered = false
-        font = .systemFont(ofSize: 15, weight: .semibold)
+        font = .systemFont(ofSize: 16, weight: .semibold)
         contentTintColor = .white
         contentTintColor = .white
         wantsLayer = true
         wantsLayer = true
-        layer?.cornerRadius = 12
+        layer?.cornerRadius = 14
         if #available(macOS 11.0, *) {
         if #available(macOS 11.0, *) {
             layer?.cornerCurve = .continuous
             layer?.cornerCurve = .continuous
         }
         }