Procházet zdrojové kódy

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 před 2 týdny
rodič
revize
a92705d6f1
1 změnil soubory, kde provedl 6 přidání a 2 odebrání
  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) {