Revision: 14098
          http://sourceforge.net/p/skim-app/code/14098
Author:   hofman
Date:     2024-03-10 17:56:45 +0000 (Sun, 10 Mar 2024)
Log Message:
-----------
can assign constraint ivar earlier, avoid using extra variable

Modified Paths:
--------------
    trunk/SKMainWindowController.m

Modified: trunk/SKMainWindowController.m
===================================================================
--- trunk/SKMainWindowController.m      2024-03-10 17:47:08 UTC (rev 14097)
+++ trunk/SKMainWindowController.m      2024-03-10 17:56:45 UTC (rev 14098)
@@ -1728,11 +1728,12 @@
     NSView *findBar = [findController view];
     NSView *contentView = [findBar superview];
     NSLayoutConstraint *barTopConstraint = [findController topConstraint];
-    NSLayoutConstraint *newTopConstraint = nil;
     CGFloat barHeight = [findController height];
     
-    if (mwcFlags.fullSizeContent == NO)
-        newTopConstraint = [[pdfSplitView topAnchor] 
constraintEqualToAnchor:[contentView topAnchor]];
+    if (mwcFlags.fullSizeContent)
+        findBarTopConstraint = nil;
+    else
+        findBarTopConstraint = [[pdfSplitView topAnchor] 
constraintEqualToAnchor:[contentView topAnchor]];
     
     if ([[mainWindow firstResponder] isDescendantOf:findBar])
         [mainWindow makeFirstResponder:pdfView];
@@ -1753,8 +1754,7 @@
             }
             completionHandler:^{
                 [findBar removeFromSuperview];
-                [newTopConstraint setActive:YES];
-                findBarTopConstraint = newTopConstraint;
+                [findBarTopConstraint setActive:YES];
                 [mainWindow recalculateKeyViewLoop];
                 
                 mwcFlags.isAnimatingFindBar = NO;
@@ -1761,8 +1761,7 @@
             }];
     } else {
         [findBar removeFromSuperview];
-        [newTopConstraint setActive:YES];
-        findBarTopConstraint = newTopConstraint;
+        [findBarTopConstraint setActive:YES];
         [contentView layoutSubtreeIfNeeded];
         [mainWindow recalculateKeyViewLoop];
     }

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.



_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to