Browse Source

Fix conflicting content top constraints on Settings layout switches.

Deactivate both header and window top constraints before activating the correct one to avoid Auto Layout warnings during appearance-driven relayout.

Co-authored-by: Cursor <cursoragent@cursor.com>
Hussain Afzal 2 tuần trước cách đây
mục cha
commit
a92705d6f1
1 tập tin đã thay đổi với 6 bổ sung2 xóa
  1. 6 2
      smart_printer/ViewController.swift

+ 6 - 2
smart_printer/ViewController.swift

@@ -527,8 +527,12 @@ class ViewController: NSViewController {
 
         let isSettings = destination == .settings
         headerView.isHidden = isSettings
-        contentTopBelowHeader.isActive = !isSettings
-        contentTopBelowWindow.isActive = isSettings
+        NSLayoutConstraint.deactivate([contentTopBelowHeader, contentTopBelowWindow])
+        if isSettings {
+            contentTopBelowWindow.isActive = true
+        } else {
+            contentTopBelowHeader.isActive = true
+        }
     }
 
     func presentPaywall(returnToHomeOnDismiss: Bool = true) {