Revision: 14483
http://sourceforge.net/p/skim-app/code/14483
Author: hofman
Date: 2024-09-26 14:50:13 +0000 (Thu, 26 Sep 2024)
Log Message:
-----------
animate preview window when showing
Modified Paths:
--------------
trunk/SKPresentationOptionsSheetController.m
Modified: trunk/SKPresentationOptionsSheetController.m
===================================================================
--- trunk/SKPresentationOptionsSheetController.m 2024-09-25 14:21:39 UTC
(rev 14482)
+++ trunk/SKPresentationOptionsSheetController.m 2024-09-26 14:50:13 UTC
(rev 14483)
@@ -307,6 +307,7 @@
[layer setCornerRadius:6.0];
[bgView setLayer:layer];
[bgView setWantsLayer:YES];
+ [bgView
setLayerContentsRedrawPolicy:NSViewLayerContentsRedrawDuringViewResize];
[bgView setTranslatesAutoresizingMaskIntoConstraints:NO];
[contentView addSubview:bgView];
NSArray *constraints = @[
@@ -314,6 +315,7 @@
[[contentView trailingAnchor] constraintEqualToAnchor:[bgView
trailingAnchor] constant:6.0],
[[bgView topAnchor] constraintEqualToAnchor:[[previewWindow
contentLayoutGuide] topAnchor] constant:0.0],
[[contentView bottomAnchor] constraintEqualToAnchor:[bgView
bottomAnchor] constant:6.0]];
+ [[constraints objectAtIndex:2]
setPriority:NSLayoutPriorityDefaultHigh];
[NSLayoutConstraint activateConstraints:constraints];
previewView = [[SKPDFPageView alloc] init];
@@ -326,10 +328,21 @@
[[previewView transitionController] setTransition:info];
[previewWindow setTitle:[SKTransitionController
localizedNameForStyle:[info transitionStyle]]];
- rect.size.height += NSHeight([previewWindow frame]) -
NSHeight([previewWindow contentLayoutRect]) - 28.0;
+ CGFloat titleHeight = NSHeight([previewWindow frame]) -
NSHeight([previewWindow contentLayoutRect]);
+ rect.size.height += titleHeight - 28.0;
[previewWindow setFrame:rect display:NO];
[previewWindow center];
+ rect = [previewWindow frame];
+ NSRect sourceRect;
+ if (separate) {
+ sourceRect = [tableView convertRectToScreen:[tableView
frameOfCellAtColumn:0 row:idx]];
+ sourceRect = NSOffsetRect(NSInsetRect(sourceRect, -6.0, -6.0 - 0.5 *
titleHeight), 0.0, 0.5 * titleHeight);
+ } else {
+ sourceRect = [[stylePopUpButton superview]
convertRectToScreen:[[stylePopUpButton superview] bounds]];
+ }
+ [previewWindow setFrame:sourceRect display:NO];
[previewWindow makeKeyAndOrderFront:nil];
+ [previewWindow setFrame:rect display:YES animate:YES];
[previewView performSelector:@selector(goToNextPage:) withObject:nil
afterDelay:1.0];
[previewWindow performSelector:@selector(orderOut:) withObject:nil
afterDelay:2.0 + [info duration]];
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