Revision: 15158 http://sourceforge.net/p/skim-app/code/15158 Author: hofman Date: 2025-05-04 22:10:18 +0000 (Sun, 04 May 2025) Log Message: ----------- combine methods
Modified Paths: -------------- trunk/SKImageToolTipWindow.m Modified: trunk/SKImageToolTipWindow.m =================================================================== --- trunk/SKImageToolTipWindow.m 2025-05-04 21:25:51 UTC (rev 15157) +++ trunk/SKImageToolTipWindow.m 2025-05-04 22:10:18 UTC (rev 15158) @@ -128,36 +128,34 @@ [super fadeOut]; } -- (void)show { - [imageView setImage:image]; - - BOOL isOpaque = [[[image representations] firstObject] isOpaque]; - [[self contentView] setContentFilters:isOpaque ? SKColorEffectFilters() : @[]]; - - NSPoint thePoint = NSEqualPoints(point, NSZeroPoint) ? [NSEvent mouseLocation] : point; - NSRect screenRect = [[NSScreen screenForPoint:thePoint] frame]; - NSRect contentRect = NSZeroRect; - contentRect.size = [image size]; - contentRect.origin.x = fmin(thePoint.x, NSMaxX(screenRect) - NSWidth(contentRect)); - contentRect.origin.y = thePoint.y - WINDOW_OFFSET - NSHeight(contentRect); - contentRect = [self frameRectForContentRect:contentRect]; - if (NSMinY(contentRect) < NSMinX(screenRect)) - contentRect.origin.y = thePoint.y + WINDOW_OFFSET; - [self setFrame:contentRect display:NO]; - - if ([self isVisible] && [self alphaValue] > CRITICAL_ALPHA_VALUE) - [self orderFront:self]; - else - [self fadeIn]; - - image = nil; - shouldShow = NO; -} - - (void)showDelayed { - shouldShow = YES; - if (image) - [self show]; + if (image) { + [imageView setImage:image]; + + BOOL isOpaque = [[[image representations] firstObject] isOpaque]; + [[self contentView] setContentFilters:isOpaque ? SKColorEffectFilters() : @[]]; + + NSPoint thePoint = NSEqualPoints(point, NSZeroPoint) ? [NSEvent mouseLocation] : point; + NSRect screenRect = [[NSScreen screenForPoint:thePoint] frame]; + NSRect contentRect = NSZeroRect; + contentRect.size = [image size]; + contentRect.origin.x = fmin(thePoint.x, NSMaxX(screenRect) - NSWidth(contentRect)); + contentRect.origin.y = thePoint.y - WINDOW_OFFSET - NSHeight(contentRect); + contentRect = [self frameRectForContentRect:contentRect]; + if (NSMinY(contentRect) < NSMinX(screenRect)) + contentRect.origin.y = thePoint.y + WINDOW_OFFSET; + [self setFrame:contentRect display:NO]; + + if ([self isVisible] && [self alphaValue] > CRITICAL_ALPHA_VALUE) + [self orderFront:self]; + else + [self fadeIn]; + + image = nil; + shouldShow = NO; + } else { + shouldShow = YES; + } } - (void)generateImage { @@ -180,7 +178,7 @@ if (image == nil) [self fadeOut]; else if (shouldShow) - [self show]; + [self showDelayed]; } }); 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