Sfoglia il codice sorgente

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 settimane fa
parent
commit
a92705d6f1
1 ha cambiato i file con 6 aggiunte e 2 eliminazioni
  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) {