Revision: 14541
          http://sourceforge.net/p/skim-app/code/14541
Author:   hofman
Date:     2024-10-10 23:14:08 +0000 (Thu, 10 Oct 2024)
Log Message:
-----------
use sheetParent instead of assuming it's the window of the controller

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

Modified: trunk/SKPresentationOptionsSheetController.m
===================================================================
--- trunk/SKPresentationOptionsSheetController.m        2024-10-10 16:07:17 UTC 
(rev 14540)
+++ trunk/SKPresentationOptionsSheetController.m        2024-10-10 23:14:08 UTC 
(rev 14541)
@@ -198,26 +198,26 @@
     }
     
     NSWindow *window = [self window];
-    BOOL isSheet = [window sheetParent] != nil;
+    NSWindow *parent = [window sheetParent];
     CGFloat width = separate ? [tableWidthConstraint constant] + TABLE_OFFSET 
: BOX_OFFSET;
     
-    if (isSheet && [NSView shouldShowSlideAnimation]) {
+    if (parent && [NSView shouldShowSlideAnimation]) {
         [NSAnimationContext runAnimationGroup:^(NSAnimationContext *context){
                 [[boxLeadingConstraint animator] setConstant:width];
                 [[scrollView animator] setHidden:separate == NO];
             }
             completionHandler:^{
-                if (isSheet) {
+                if (parent) {
                     NSRect frame = [window frame];
-                    [window setFrameOrigin:NSMakePoint(NSMidX([[controller 
window] frame]) - 0.5 * NSWidth(frame), NSMinY(frame))];
+                    [window setFrameOrigin:NSMakePoint(NSMidX([parent frame]) 
- 0.5 * NSWidth(frame), NSMinY(frame))];
                 }
             }];
     } else {
         [boxLeadingConstraint setConstant:width];
         [scrollView setHidden:separate == NO];
-        if (isSheet) {
+        if (parent) {
             NSRect frame = [window frame];
-            [window setFrameOrigin:NSMakePoint(NSMidX([[controller window] 
frame]) - 0.5 * NSWidth(frame), NSMinY(frame))];
+            [window setFrameOrigin:NSMakePoint(NSMidX([parent frame]) - 0.5 * 
NSWidth(frame), NSMinY(frame))];
         }
     }
 }

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