Revision: 15177 http://sourceforge.net/p/skim-app/code/15177 Author: hofman Date: 2025-05-09 22:02:52 +0000 (Fri, 09 May 2025) Log Message: ----------- Don't update page view on resize. Don't resize transition preview window in animation, use standard window animation to show/hide th window.
Modified Paths: -------------- trunk/SKPresentationOptionsSheetController.m trunk/SKPresentationView.m Modified: trunk/SKPresentationOptionsSheetController.m =================================================================== --- trunk/SKPresentationOptionsSheetController.m 2025-05-09 21:42:32 UTC (rev 15176) +++ trunk/SKPresentationOptionsSheetController.m 2025-05-09 22:02:52 UTC (rev 15177) @@ -325,7 +325,7 @@ [previewWindow setTitlebarAppearsTransparent:YES]; [previewWindow setHidesOnDeactivate:NO]; [previewWindow setFloatingPanel:YES]; - [previewWindow setAnimationBehavior:NSWindowAnimationBehaviorNone]; + [previewWindow setAnimationBehavior:NSWindowAnimationBehaviorDocumentWindow]; NSView *contentView = [previewWindow contentView]; @@ -359,75 +359,29 @@ [bgView addSubviewWithConstraints:previewView]; } - [previewView setPage:[[controller pdfDocument] pageAtIndex:idx]]; - [[previewView transitionController] setTransition:info]; - [previewWindow setTitle:[info localizedStyleName]]; 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 = rect, targetRect = rect; - if ([NSView shouldShowSlideAnimation]) { - 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); - targetRect = [tableView convertRectToScreen:[tableView frameOfCellAtColumn:1 row:idx]]; - targetRect = NSOffsetRect(NSInsetRect(targetRect, -6.0, -6.0 - 0.5 * titleHeight), 0.0, 0.5 * titleHeight); - } else { - targetRect = sourceRect = [[stylePopUpButton superview] convertRectToScreen:[[stylePopUpButton superview] bounds]]; - } - } - BOOL shouldAnimate = [NSView shouldShowFadeAnimation]; - id viewOrWindow = previewWindow; - NSView *titleView = nil; - if (separate && NSEqualRects(sourceRect, rect) == NO) { - viewOrWindow = [[[previewWindow contentView] subviews] firstObject]; - titleView = [[[[previewWindow contentView] superview] subviews] lastObject]; - [previewWindow setOpaque:NO]; - [previewWindow setBackgroundColor:[NSColor clearColor]]; - } else { - [previewWindow setOpaque:YES]; - [previewWindow setBackgroundColor:[NSColor blackColor]]; - } - [previewWindow setFrame:sourceRect display:NO]; - if (shouldAnimate) { - [viewOrWindow setAlphaValue:0.0]; - [titleView setAlphaValue:0.0]; - } + + [previewView setPage:[[controller pdfDocument] pageAtIndex:idx]]; + [[previewView transitionController] setTransition:info]; + [previewWindow makeKeyAndOrderFront:nil]; - [NSAnimationContext runAnimationGroup:^(NSAnimationContext *context){ - if (shouldAnimate == NO) { - [context setDuration:0.0]; - } else { - [[viewOrWindow animator] setAlphaValue:1.0]; - [[titleView animator] setAlphaValue:1.0]; - } - [[previewWindow animator] setFrame:rect display:YES]; - } completionHandler:^{ - [previewWindow invalidateShadow]; - DISPATCH_MAIN_AFTER_SEC(1.0, ^{ - [previewView goToNextPage:nil]; - DISPATCH_MAIN_AFTER_SEC(1.0 + [info duration], ^{ - if ([previewWindow isKeyWindow]) - [[self window] makeKeyWindow]; - [NSAnimationContext runAnimationGroup:^(NSAnimationContext *context){ - if (shouldAnimate == NO) { - [context setDuration:0.0]; - } else { - [[viewOrWindow animator] setAlphaValue:0.0]; - [[titleView animator] setAlphaValue:0.0]; - } - [[previewWindow animator] setFrame:targetRect display:YES]; - } completionHandler:^{ - [previewWindow orderOut:nil]; - [viewOrWindow setAlphaValue:1.0]; - [titleView setAlphaValue:1.0]; - }]; - }); + + DISPATCH_MAIN_AFTER_SEC(1.0, ^{ + + [previewView goToNextPage:nil]; + + DISPATCH_MAIN_AFTER_SEC(1.0 + [info duration], ^{ + + if ([previewWindow isKeyWindow]) + [[self window] makeKeyWindow]; + [previewWindow orderOut:nil]; + }); - }]; + }); } - (NSArray *)availableTransitions { Modified: trunk/SKPresentationView.m =================================================================== --- trunk/SKPresentationView.m 2025-05-09 21:42:32 UTC (rev 15176) +++ trunk/SKPresentationView.m 2025-05-09 22:02:52 UTC (rev 15177) @@ -105,8 +105,6 @@ pageView = [[NSView alloc] initWithFrame:[self bounds]]; [pageView setLayer:layer]; [pageView setWantsLayer:YES]; - if ([self isMemberOfClass:[SKPDFPageView class]]) - [pageView setLayerContentsRedrawPolicy:NSViewLayerContentsRedrawDuringViewResize]; [pageView setContentFilters:SKColorEffectFilters()]; [pageView setTranslatesAutoresizingMaskIntoConstraints:NO]; [self addSubviewWithConstraints:pageView]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. _______________________________________________ Skim-app-commit mailing list Skim-app-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/skim-app-commit