You can subscribe to this list here.
2007 |
Jan
|
Feb
|
Mar
(23) |
Apr
(254) |
May
(252) |
Jun
(209) |
Jul
(198) |
Aug
(192) |
Sep
(207) |
Oct
(120) |
Nov
(179) |
Dec
(52) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
(48) |
Feb
(69) |
Mar
(129) |
Apr
(250) |
May
(113) |
Jun
(177) |
Jul
(228) |
Aug
(155) |
Sep
(218) |
Oct
(185) |
Nov
(109) |
Dec
(88) |
2009 |
Jan
(83) |
Feb
(39) |
Mar
(70) |
Apr
(47) |
May
(48) |
Jun
(67) |
Jul
(61) |
Aug
(97) |
Sep
(221) |
Oct
(141) |
Nov
(70) |
Dec
(61) |
2010 |
Jan
(45) |
Feb
(76) |
Mar
(178) |
Apr
(106) |
May
(57) |
Jun
(32) |
Jul
(64) |
Aug
(98) |
Sep
(96) |
Oct
(19) |
Nov
(34) |
Dec
(117) |
2011 |
Jan
(55) |
Feb
(48) |
Mar
(64) |
Apr
(21) |
May
(39) |
Jun
(53) |
Jul
(99) |
Aug
(56) |
Sep
(39) |
Oct
(26) |
Nov
(19) |
Dec
(69) |
2012 |
Jan
(17) |
Feb
(40) |
Mar
(17) |
Apr
|
May
(2) |
Jun
(8) |
Jul
(2) |
Aug
(10) |
Sep
(10) |
Oct
(38) |
Nov
(48) |
Dec
(70) |
2013 |
Jan
(43) |
Feb
(47) |
Mar
(39) |
Apr
(37) |
May
(25) |
Jun
(6) |
Jul
(20) |
Aug
(49) |
Sep
(33) |
Oct
(34) |
Nov
(75) |
Dec
(6) |
2014 |
Jan
(32) |
Feb
(10) |
Mar
(17) |
Apr
|
May
|
Jun
(26) |
Jul
(5) |
Aug
|
Sep
(4) |
Oct
(23) |
Nov
(80) |
Dec
(48) |
2015 |
Jan
(80) |
Feb
(50) |
Mar
(58) |
Apr
(20) |
May
(11) |
Jun
(16) |
Jul
(24) |
Aug
(27) |
Sep
(56) |
Oct
(30) |
Nov
(16) |
Dec
(6) |
2016 |
Jan
(31) |
Feb
(14) |
Mar
(23) |
Apr
(17) |
May
(40) |
Jun
(12) |
Jul
(17) |
Aug
(9) |
Sep
(32) |
Oct
(36) |
Nov
(23) |
Dec
(9) |
2017 |
Jan
(37) |
Feb
(23) |
Mar
(65) |
Apr
(22) |
May
(6) |
Jun
(3) |
Jul
|
Aug
|
Sep
(3) |
Oct
(22) |
Nov
(63) |
Dec
(71) |
2018 |
Jan
(83) |
Feb
(21) |
Mar
(35) |
Apr
(44) |
May
(14) |
Jun
(12) |
Jul
(8) |
Aug
(18) |
Sep
(10) |
Oct
(145) |
Nov
(144) |
Dec
(76) |
2019 |
Jan
(18) |
Feb
(28) |
Mar
(5) |
Apr
(208) |
May
(291) |
Jun
(158) |
Jul
(27) |
Aug
(8) |
Sep
(10) |
Oct
(83) |
Nov
(41) |
Dec
(31) |
2020 |
Jan
(16) |
Feb
(46) |
Mar
(100) |
Apr
(78) |
May
(69) |
Jun
(71) |
Jul
(28) |
Aug
(131) |
Sep
(176) |
Oct
(89) |
Nov
(147) |
Dec
(19) |
2021 |
Jan
(19) |
Feb
(25) |
Mar
(91) |
Apr
(98) |
May
(14) |
Jun
(44) |
Jul
(8) |
Aug
(3) |
Sep
(38) |
Oct
(57) |
Nov
(97) |
Dec
(74) |
2022 |
Jan
(89) |
Feb
(47) |
Mar
(15) |
Apr
(50) |
May
(54) |
Jun
(56) |
Jul
(80) |
Aug
(12) |
Sep
(11) |
Oct
(60) |
Nov
(48) |
Dec
(4) |
2023 |
Jan
(75) |
Feb
(49) |
Mar
(84) |
Apr
(24) |
May
(13) |
Jun
(74) |
Jul
(32) |
Aug
(66) |
Sep
(50) |
Oct
(38) |
Nov
(105) |
Dec
(181) |
2024 |
Jan
(21) |
Feb
(49) |
Mar
(77) |
Apr
(84) |
May
(20) |
Jun
(71) |
Jul
(53) |
Aug
(33) |
Sep
(54) |
Oct
(124) |
Nov
(151) |
Dec
(73) |
2025 |
Jan
(61) |
Feb
(17) |
Mar
(136) |
Apr
(72) |
May
(200) |
Jun
(238) |
Jul
(91) |
Aug
(8) |
Sep
|
Oct
|
Nov
|
Dec
|
From: <ho...@us...> - 2025-05-09 09:07:12
|
Revision: 15173 http://sourceforge.net/p/skim-app/code/15173 Author: hofman Date: 2025-05-09 09:07:10 +0000 (Fri, 09 May 2025) Log Message: ----------- only set needsdisplay for presentation view layer manually, needed only when setting the page, changing an annotation, or after a resize. Modified Paths: -------------- trunk/SKPresentationView.m Modified: trunk/SKPresentationView.m =================================================================== --- trunk/SKPresentationView.m 2025-05-09 09:02:14 UTC (rev 15172) +++ trunk/SKPresentationView.m 2025-05-09 09:07:10 UTC (rev 15173) @@ -146,7 +146,7 @@ - (void)setPage:(PDFPage *)newPage { if (newPage != page) { page = newPage; - [pageView setNeedsDisplay:YES]; + [[pageView layer] setNeedsDisplay]; [[NSNotificationCenter defaultCenter] postNotificationName:SKPresentationViewPageChangedNotification object:self]; } } @@ -259,7 +259,7 @@ pvFlags.removeLaserPointerShadow = [[NSUserDefaults standardUserDefaults] boolForKey:SKRemoveLaserPointerShadowKey]; pvFlags.enableDrawing = NO == [[NSUserDefaults standardUserDefaults] boolForKey:SKDisableDrawingInPresentationKey]; - [pageView setLayerContentsRedrawPolicy:NSViewLayerContentsRedrawOnSetNeedsDisplay]; + [pageView setLayerContentsRedrawPolicy:NSViewLayerContentsRedrawNever]; [pageView setLayerContentsPlacement:NSViewLayerContentsPlacementScaleProportionallyToFill]; [self addTrackingArea:[[NSTrackingArea alloc] initWithRect:NSZeroRect options:NSTrackingMouseMoved | NSTrackingMouseEnteredAndExited | NSTrackingActiveInKeyWindow | NSTrackingInVisibleRect owner:self userInfo:nil]]; @@ -269,12 +269,12 @@ - (void)viewDidEndLiveResize { [super viewDidEndLiveResize]; - [pageView setNeedsDisplay:YES]; + [[pageView layer] setNeedsDisplay]; } - (void)updatedAnnotationOnPage:(PDFPage *)aPage { if (page == aPage) - [pageView setNeedsDisplay:YES]; + [[pageView layer] setNeedsDisplay]; } #pragma mark Accessors @@ -291,7 +291,7 @@ if (flag != pvFlags.autoScales) { pvFlags.autoScales = flag; [pageView setLayerContentsPlacement:flag ? NSViewLayerContentsPlacementScaleProportionallyToFill : NSViewLayerContentsPlacementCenter]; - [pageView setNeedsDisplay:YES]; + [[pageView layer] setNeedsDisplay]; [[NSNotificationCenter defaultCenter] postNotificationName:SKPresentationViewAutoScalesChangedNotification object:self]; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-05-09 09:02:16
|
Revision: 15172 http://sourceforge.net/p/skim-app/code/15172 Author: hofman Date: 2025-05-09 09:02:14 +0000 (Fri, 09 May 2025) Log Message: ----------- Make sure presentation view has the correct size before setting the page, so it draws correctly. Modified Paths: -------------- trunk/SKMainWindowController_FullScreen.m Modified: trunk/SKMainWindowController_FullScreen.m =================================================================== --- trunk/SKMainWindowController_FullScreen.m 2025-05-09 08:55:53 UTC (rev 15171) +++ trunk/SKMainWindowController_FullScreen.m 2025-05-09 09:02:14 UTC (rev 15172) @@ -353,6 +353,8 @@ if (presentationView == nil) presentationView = [[SKPresentationView alloc] initWithFrame:[[presentationWindow contentView] bounds]]; + else + [presentationView setFrame:[[presentationWindow contentView] bounds]]; [[presentationWindow contentView] addSubviewWithConstraints:presentationView]; [presentationWindow makeFirstResponder:presentationView]; [presentationView setAutoScales:YES]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-05-09 08:55:57
|
Revision: 15171 http://sourceforge.net/p/skim-app/code/15171 Author: hofman Date: 2025-05-09 08:55:53 +0000 (Fri, 09 May 2025) Log Message: ----------- Let presentation view decide whether to redisplay. Scale to fill when resizing. Modified Paths: -------------- trunk/SKMainWindowController.m trunk/SKPresentationView.h trunk/SKPresentationView.m Modified: trunk/SKMainWindowController.m =================================================================== --- trunk/SKMainWindowController.m 2025-05-08 22:54:29 UTC (rev 15170) +++ trunk/SKMainWindowController.m 2025-05-09 08:55:53 UTC (rev 15171) @@ -2192,8 +2192,7 @@ [presentationNotes addObject:annotation]; if (page) { [self updateThumbnailAtPageIndex:[page pageIndex]]; - if ([presentationView page] == page) - [presentationView updatedAnnotation]; + [presentationView updatedAnnotationOnPage:page]; } } else { [[undoManager prepareWithInvocationTarget:[notification object]] removeAnnotation:annotation]; @@ -2216,8 +2215,8 @@ [self snapshotNeedsUpdate:wc lowPriority:NO]; } [secondaryPdfView addedAnnotation:annotation onPage:page]; - if ([self interactionMode] == SKPresentationMode && [presentationView page] == page) - [presentationView updatedAnnotation]; + if ([self interactionMode] == SKPresentationMode) + [presentationView updatedAnnotationOnPage:page]; } } } @@ -2234,8 +2233,7 @@ [presentationNotes removeObject:annotation]; if (page) { [self updateThumbnailAtPageIndex:[page pageIndex]]; - if ([presentationView page] == page) - [presentationView updatedAnnotation]; + [presentationView updatedAnnotationOnPage:page]; } } else { [[undoManager prepareWithInvocationTarget:[notification object]] addAnnotation:annotation toPage:page]; @@ -2261,8 +2259,8 @@ [self snapshotNeedsUpdate:wc lowPriority:NO]; } [secondaryPdfView removedAnnotation:annotation onPage:page]; - if ([self interactionMode] == SKPresentationMode && [presentationView page] == page) - [presentationView updatedAnnotation]; + if ([self interactionMode] == SKPresentationMode) + [presentationView updatedAnnotationOnPage:page]; } } } @@ -2286,8 +2284,10 @@ } [secondaryPdfView removedAnnotation:annotation onPage:oldPage]; [secondaryPdfView addedAnnotation:annotation onPage:newPage]; - if ([self interactionMode] == SKPresentationMode && ([presentationView page] == oldPage || [presentationView page] == newPage)) - [presentationView updatedAnnotation]; + if ([self interactionMode] == SKPresentationMode) { + [presentationView updatedAnnotationOnPage:oldPage]; + [presentationView updatedAnnotationOnPage:newPage]; + } } [rightSideController.noteArrayController rearrangeObjects]; @@ -2728,8 +2728,8 @@ [pdfView updatedAnnotation:note forKey:keyPath fromValue:oldValue]; [secondaryPdfView updatedAnnotation:note]; - if ([self interactionMode] == SKPresentationMode && [presentationView page] == page) - [presentationView updatedAnnotation]; + if ([self interactionMode] == SKPresentationMode) + [presentationView updatedAnnotationOnPage:page]; if ([keyPath isEqualToString:SKNPDFAnnotationBoundsKey] && note == [pdfView currentAnnotation] && [[NSUserDefaults standardUserDefaults] boolForKey:SKDisplayNoteBoundsKey]) [self updateRightStatus]; Modified: trunk/SKPresentationView.h =================================================================== --- trunk/SKPresentationView.h 2025-05-08 22:54:29 UTC (rev 15170) +++ trunk/SKPresentationView.h 2025-05-09 08:55:53 UTC (rev 15171) @@ -112,7 +112,7 @@ - (void)didOpen; - (void)willClose; -- (void)updatedAnnotation; +- (void)updatedAnnotationOnPage:(PDFPage *)aPage; @end Modified: trunk/SKPresentationView.m =================================================================== --- trunk/SKPresentationView.m 2025-05-08 22:54:29 UTC (rev 15170) +++ trunk/SKPresentationView.m 2025-05-09 08:55:53 UTC (rev 15171) @@ -260,7 +260,7 @@ pvFlags.enableDrawing = NO == [[NSUserDefaults standardUserDefaults] boolForKey:SKDisableDrawingInPresentationKey]; [pageView setLayerContentsRedrawPolicy:NSViewLayerContentsRedrawOnSetNeedsDisplay]; - [pageView setLayerContentsPlacement:NSViewLayerContentsPlacementScaleProportionallyToFit]; + [pageView setLayerContentsPlacement:NSViewLayerContentsPlacementScaleProportionallyToFill]; [self addTrackingArea:[[NSTrackingArea alloc] initWithRect:NSZeroRect options:NSTrackingMouseMoved | NSTrackingMouseEnteredAndExited | NSTrackingActiveInKeyWindow | NSTrackingInVisibleRect owner:self userInfo:nil]]; } @@ -272,8 +272,9 @@ [pageView setNeedsDisplay:YES]; } -- (void)updatedAnnotation; { - [pageView setNeedsDisplay:YES]; +- (void)updatedAnnotationOnPage:(PDFPage *)aPage { + if (page == aPage) + [pageView setNeedsDisplay:YES]; } #pragma mark Accessors @@ -289,7 +290,7 @@ - (void)setAutoScales:(BOOL)flag { if (flag != pvFlags.autoScales) { pvFlags.autoScales = flag; - [pageView setLayerContentsPlacement:flag ? NSViewLayerContentsPlacementScaleProportionallyToFit : NSViewLayerContentsPlacementCenter]; + [pageView setLayerContentsPlacement:flag ? NSViewLayerContentsPlacementScaleProportionallyToFill : NSViewLayerContentsPlacementCenter]; [pageView setNeedsDisplay:YES]; [[NSNotificationCenter defaultCenter] postNotificationName:SKPresentationViewAutoScalesChangedNotification object:self]; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-05-08 22:54:31
|
Revision: 15170 http://sourceforge.net/p/skim-app/code/15170 Author: hofman Date: 2025-05-08 22:54:29 +0000 (Thu, 08 May 2025) Log Message: ----------- Avoid redrawing presentation view. Don't call setNeedsDisplay: on pageView when view needs display, only update when changing an annotation. Don't redraw on resize, only at endof live resize. Modified Paths: -------------- trunk/SKMainWindowController.m trunk/SKPresentationView.h trunk/SKPresentationView.m Modified: trunk/SKMainWindowController.m =================================================================== --- trunk/SKMainWindowController.m 2025-05-08 16:14:28 UTC (rev 15169) +++ trunk/SKMainWindowController.m 2025-05-08 22:54:29 UTC (rev 15170) @@ -2193,7 +2193,7 @@ if (page) { [self updateThumbnailAtPageIndex:[page pageIndex]]; if ([presentationView page] == page) - [presentationView setNeedsDisplay:YES]; + [presentationView updatedAnnotation]; } } else { [[undoManager prepareWithInvocationTarget:[notification object]] removeAnnotation:annotation]; @@ -2217,7 +2217,7 @@ } [secondaryPdfView addedAnnotation:annotation onPage:page]; if ([self interactionMode] == SKPresentationMode && [presentationView page] == page) - [presentationView setNeedsDisplay:YES]; + [presentationView updatedAnnotation]; } } } @@ -2235,7 +2235,7 @@ if (page) { [self updateThumbnailAtPageIndex:[page pageIndex]]; if ([presentationView page] == page) - [presentationView setNeedsDisplay:YES]; + [presentationView updatedAnnotation]; } } else { [[undoManager prepareWithInvocationTarget:[notification object]] addAnnotation:annotation toPage:page]; @@ -2262,7 +2262,7 @@ } [secondaryPdfView removedAnnotation:annotation onPage:page]; if ([self interactionMode] == SKPresentationMode && [presentationView page] == page) - [presentationView setNeedsDisplay:YES]; + [presentationView updatedAnnotation]; } } } @@ -2287,7 +2287,7 @@ [secondaryPdfView removedAnnotation:annotation onPage:oldPage]; [secondaryPdfView addedAnnotation:annotation onPage:newPage]; if ([self interactionMode] == SKPresentationMode && ([presentationView page] == oldPage || [presentationView page] == newPage)) - [presentationView setNeedsDisplay:YES]; + [presentationView updatedAnnotation]; } [rightSideController.noteArrayController rearrangeObjects]; @@ -2729,8 +2729,8 @@ [secondaryPdfView updatedAnnotation:note]; if ([self interactionMode] == SKPresentationMode && [presentationView page] == page) - [presentationView setNeedsDisplay:YES]; - + [presentationView updatedAnnotation]; + if ([keyPath isEqualToString:SKNPDFAnnotationBoundsKey] && note == [pdfView currentAnnotation] && [[NSUserDefaults standardUserDefaults] boolForKey:SKDisplayNoteBoundsKey]) [self updateRightStatus]; } Modified: trunk/SKPresentationView.h =================================================================== --- trunk/SKPresentationView.h 2025-05-08 16:14:28 UTC (rev 15169) +++ trunk/SKPresentationView.h 2025-05-08 22:54:29 UTC (rev 15170) @@ -112,6 +112,8 @@ - (void)didOpen; - (void)willClose; +- (void)updatedAnnotation; + @end NS_ASSUME_NONNULL_END Modified: trunk/SKPresentationView.m =================================================================== --- trunk/SKPresentationView.m 2025-05-08 16:14:28 UTC (rev 15169) +++ trunk/SKPresentationView.m 2025-05-08 22:54:29 UTC (rev 15170) @@ -143,16 +143,6 @@ #pragma mark Accessors -- (void)setNeedsDisplay:(BOOL)needsDisplay { - [super setNeedsDisplay:needsDisplay]; - [pageView setNeedsDisplay:needsDisplay]; -} - -- (void)setNeedsDisplayInRect:(NSRect)invalidRect { - [super setNeedsDisplayInRect:invalidRect]; - [pageView setNeedsDisplay:YES]; -} - - (void)setPage:(PDFPage *)newPage { if (newPage != page) { page = newPage; @@ -269,11 +259,23 @@ pvFlags.removeLaserPointerShadow = [[NSUserDefaults standardUserDefaults] boolForKey:SKRemoveLaserPointerShadowKey]; pvFlags.enableDrawing = NO == [[NSUserDefaults standardUserDefaults] boolForKey:SKDisableDrawingInPresentationKey]; + [pageView setLayerContentsRedrawPolicy:NSViewLayerContentsRedrawOnSetNeedsDisplay]; + [pageView setLayerContentsPlacement:NSViewLayerContentsPlacementScaleProportionallyToFit]; + [self addTrackingArea:[[NSTrackingArea alloc] initWithRect:NSZeroRect options:NSTrackingMouseMoved | NSTrackingMouseEnteredAndExited | NSTrackingActiveInKeyWindow | NSTrackingInVisibleRect owner:self userInfo:nil]]; } return self; } +- (void)viewDidEndLiveResize { + [super viewDidEndLiveResize]; + [pageView setNeedsDisplay:YES]; +} + +- (void)updatedAnnotation; { + [pageView setNeedsDisplay:YES]; +} + #pragma mark Accessors - (BOOL)canBecomeKeyView { @@ -287,6 +289,7 @@ - (void)setAutoScales:(BOOL)flag { if (flag != pvFlags.autoScales) { pvFlags.autoScales = flag; + [pageView setLayerContentsPlacement:flag ? NSViewLayerContentsPlacementScaleProportionallyToFit : NSViewLayerContentsPlacementCenter]; [pageView setNeedsDisplay:YES]; [[NSNotificationCenter defaultCenter] postNotificationName:SKPresentationViewAutoScalesChangedNotification object:self]; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-05-08 16:14:31
|
Revision: 15169 http://sourceforge.net/p/skim-app/code/15169 Author: hofman Date: 2025-05-08 16:14:28 +0000 (Thu, 08 May 2025) Log Message: ----------- macro instead of function Modified Paths: -------------- trunk/SKMainWindowController.m Modified: trunk/SKMainWindowController.m =================================================================== --- trunk/SKMainWindowController.m 2025-05-08 16:11:24 UTC (rev 15168) +++ trunk/SKMainWindowController.m 2025-05-08 16:14:28 UTC (rev 15169) @@ -115,6 +115,7 @@ #define LARGE_SIZE 128.0 #define HUGE_SIZE 256.0 #define FUDGE_SIZE 0.1 +#define CACHE_SIZE_FOR_SIZE(size) (size < TINY_SIZE + FUDGE_SIZE) ? TINY_SIZE : (size < SMALL_SIZE + FUDGE_SIZE) ? SMALL_SIZE : (size < LARGE_SIZE + FUDGE_SIZE) ? LARGE_SIZE : HUGE_SIZE #define MAX_PAGE_COLUMN_WIDTH 80.0 #define MAX_PAGE_COLUMN_WIDTH_1 50.0 @@ -2975,14 +2976,10 @@ mwcFlags.updatingThumbnailSelection = 0; } -static inline CGFloat cacheSizeForSize(CGFloat size) { - return (size < TINY_SIZE + FUDGE_SIZE) ? TINY_SIZE : (size < SMALL_SIZE + FUDGE_SIZE) ? SMALL_SIZE : (size < LARGE_SIZE + FUDGE_SIZE) ? LARGE_SIZE : HUGE_SIZE; -} - - (void)resetThumbnailSizeIfNeeded { thumbnailSize = round([[NSUserDefaults standardUserDefaults] floatForKey:SKThumbnailSizeKey]); - CGFloat cacheSize = cacheSizeForSize(thumbnailSize); + CGFloat cacheSize = CACHE_SIZE_FOR_SIZE(thumbnailSize); if (fabs(cacheSize - thumbnailCacheSize) > FUDGE_SIZE) { thumbnailCacheSize = cacheSize; @@ -3060,7 +3057,7 @@ - (void)resetSnapshotSizeIfNeeded { snapshotThumbnailSize = round([[NSUserDefaults standardUserDefaults] floatForKey:SKSnapshotThumbnailSizeKey]); - CGFloat snapshotSize = cacheSizeForSize(snapshotThumbnailSize); + CGFloat snapshotSize = CACHE_SIZE_FOR_SIZE(snapshotThumbnailSize); if (fabs(snapshotSize - snapshotCacheSize) > FUDGE_SIZE) { snapshotCacheSize = snapshotSize; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-05-08 16:11:30
|
Revision: 15168 http://sourceforge.net/p/skim-app/code/15168 Author: hofman Date: 2025-05-08 16:11:24 +0000 (Thu, 08 May 2025) Log Message: ----------- convenience function to calculate cache size Modified Paths: -------------- trunk/SKMainWindowController.m Modified: trunk/SKMainWindowController.m =================================================================== --- trunk/SKMainWindowController.m 2025-05-07 16:02:04 UTC (rev 15167) +++ trunk/SKMainWindowController.m 2025-05-08 16:11:24 UTC (rev 15168) @@ -2975,11 +2975,14 @@ mwcFlags.updatingThumbnailSelection = 0; } +static inline CGFloat cacheSizeForSize(CGFloat size) { + return (size < TINY_SIZE + FUDGE_SIZE) ? TINY_SIZE : (size < SMALL_SIZE + FUDGE_SIZE) ? SMALL_SIZE : (size < LARGE_SIZE + FUDGE_SIZE) ? LARGE_SIZE : HUGE_SIZE; +} + - (void)resetThumbnailSizeIfNeeded { thumbnailSize = round([[NSUserDefaults standardUserDefaults] floatForKey:SKThumbnailSizeKey]); - CGFloat defaultSize = thumbnailSize; - CGFloat cacheSize = (defaultSize < TINY_SIZE + FUDGE_SIZE) ? TINY_SIZE : (defaultSize < SMALL_SIZE + FUDGE_SIZE) ? SMALL_SIZE : (defaultSize < LARGE_SIZE + FUDGE_SIZE) ? LARGE_SIZE : HUGE_SIZE; + CGFloat cacheSize = cacheSizeForSize(thumbnailSize); if (fabs(cacheSize - thumbnailCacheSize) > FUDGE_SIZE) { thumbnailCacheSize = cacheSize; @@ -3057,8 +3060,7 @@ - (void)resetSnapshotSizeIfNeeded { snapshotThumbnailSize = round([[NSUserDefaults standardUserDefaults] floatForKey:SKSnapshotThumbnailSizeKey]); - CGFloat defaultSize = snapshotThumbnailSize; - CGFloat snapshotSize = (defaultSize < TINY_SIZE + FUDGE_SIZE) ? TINY_SIZE : (defaultSize < SMALL_SIZE + FUDGE_SIZE) ? SMALL_SIZE : (defaultSize < LARGE_SIZE + FUDGE_SIZE) ? LARGE_SIZE : HUGE_SIZE; + CGFloat snapshotSize = cacheSizeForSize(snapshotThumbnailSize); if (fabs(snapshotSize - snapshotCacheSize) > FUDGE_SIZE) { snapshotCacheSize = snapshotSize; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-05-07 16:02:27
|
Revision: 15167 http://sourceforge.net/p/skim-app/code/15167 Author: hofman Date: 2025-05-07 16:02:04 +0000 (Wed, 07 May 2025) Log Message: ----------- Draw initial snapshot thumbnail with lower priority when opening from setup Modified Paths: -------------- trunk/SKMainWindowController.h trunk/SKMainWindowController.m Modified: trunk/SKMainWindowController.h =================================================================== --- trunk/SKMainWindowController.h 2025-05-07 15:47:14 UTC (rev 15166) +++ trunk/SKMainWindowController.h 2025-05-07 16:02:04 UTC (rev 15167) @@ -318,7 +318,7 @@ - (void)allThumbnailsNeedUpdate; - (void)resetSnapshotSizeIfNeeded; -- (void)snapshotNeedsUpdate:(SKSnapshotWindowController *)dirstySnapshot placeholder:(BOOL)isPlaceholder; +- (void)snapshotNeedsUpdate:(SKSnapshotWindowController *)dirstySnapshot lowPriority:(BOOL)lowPriority; - (void)allSnapshotsNeedUpdate; - (void)setPdfDocument:(nullable PDFDocument *)pdfDocument addAnnotationsFromDictionaries:(nullable NSArray<NSDictionary<NSString *, id> *> *)noteDicts; Modified: trunk/SKMainWindowController.m =================================================================== --- trunk/SKMainWindowController.m 2025-05-07 15:47:14 UTC (rev 15166) +++ trunk/SKMainWindowController.m 2025-05-07 16:02:04 UTC (rev 15167) @@ -2140,7 +2140,7 @@ NSUInteger idx = [page pageIndex]; for (SKSnapshotWindowController *wc in snapshots) { if ([wc isPageVisible:page]) { - [self snapshotNeedsUpdate:wc placeholder:NO]; + [self snapshotNeedsUpdate:wc lowPriority:NO]; [[wc pdfView] setNeedsDisplay:YES]; } } @@ -2212,7 +2212,7 @@ [self updateThumbnailAtPageIndex:[page pageIndex]]; for (SKSnapshotWindowController *wc in snapshots) { if ([wc isPageVisible:page]) - [self snapshotNeedsUpdate:wc placeholder:NO]; + [self snapshotNeedsUpdate:wc lowPriority:NO]; } [secondaryPdfView addedAnnotation:annotation onPage:page]; if ([self interactionMode] == SKPresentationMode && [presentationView page] == page) @@ -2257,7 +2257,7 @@ [self updateThumbnailAtPageIndex:[page pageIndex]]; for (SKSnapshotWindowController *wc in snapshots) { if ([wc isPageVisible:page]) - [self snapshotNeedsUpdate:wc placeholder:NO]; + [self snapshotNeedsUpdate:wc lowPriority:NO]; } [secondaryPdfView removedAnnotation:annotation onPage:page]; if ([self interactionMode] == SKPresentationMode && [presentationView page] == page) @@ -2281,7 +2281,7 @@ [self updateThumbnailAtPageIndex:[newPage pageIndex]]; for (SKSnapshotWindowController *wc in snapshots) { if ([wc isPageVisible:oldPage] || [wc isPageVisible:newPage]) - [self snapshotNeedsUpdate:wc placeholder:NO]; + [self snapshotNeedsUpdate:wc lowPriority:NO]; } [secondaryPdfView removedAnnotation:annotation onPage:oldPage]; [secondaryPdfView addedAnnotation:annotation onPage:newPage]; @@ -2362,7 +2362,7 @@ NSImage *image = [controller placeholderThumbnailWithSize:snapshotCacheSize scale:[[self window] backingScaleFactor]]; [controller setThumbnail:image]; - [self snapshotNeedsUpdate:controller placeholder:YES]; + [self snapshotNeedsUpdate:controller lowPriority:openType == SKSnapshotOpenFromSetup]; if (openType == SKSnapshotOpenFromSetup) { [self insertObject:controller inSnapshotsAtIndex:[snapshots count]]; @@ -2404,7 +2404,7 @@ - (void)snapshotControllerDidChange:(SKSnapshotWindowController *)controller { if (controller != presentationPreview) { - [self snapshotNeedsUpdate:controller placeholder:NO]; + [self snapshotNeedsUpdate:controller lowPriority:NO]; [rightSideController.snapshotArrayController rearrangeObjects]; [rightSideController.snapshotTableView reloadData]; [[self document] setRecentInfoNeedsUpdate:YES]; @@ -2719,7 +2719,7 @@ for (SKSnapshotWindowController *wc in snapshots) { if ([wc isPageVisible:page]) { - [self snapshotNeedsUpdate:wc placeholder:NO]; + [self snapshotNeedsUpdate:wc lowPriority:NO]; [[wc pdfView] updatedAnnotation:note]; } } @@ -3068,7 +3068,7 @@ } } -- (void)snapshotNeedsUpdate:(SKSnapshotWindowController *)controller placeholder:(BOOL)isPlaceholder { +- (void)snapshotNeedsUpdate:(SKSnapshotWindowController *)controller lowPriority:(BOOL)lowPriority { CGFloat backingScale = [[self window] backingScaleFactor]; SKSnapshotConfiguration *configuration = [controller currentConfiguration]; NSDate *date = [NSDate date]; @@ -3076,7 +3076,7 @@ if ([rightSideController.snapshotTableView window] == nil) queue = [[self class] backgroundThumbnailQueue]; - else if (isPlaceholder) + else if (lowPriority) queue = [[self class] thumbnailQueue]; else queue = [[self class] utilityThumbnailQueue]; @@ -3107,7 +3107,7 @@ - (void)allSnapshotsNeedUpdate { for (SKSnapshotWindowController *controller in [self snapshots]) - [self snapshotNeedsUpdate:controller placeholder:NO]; + [self snapshotNeedsUpdate:controller lowPriority:NO]; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-05-07 15:47:31
|
Revision: 15166 http://sourceforge.net/p/skim-app/code/15166 Author: hofman Date: 2025-05-07 15:47:14 +0000 (Wed, 07 May 2025) Log Message: ----------- only force ontop in full screen mode Modified Paths: -------------- trunk/SKMainWindowController.m Modified: trunk/SKMainWindowController.m =================================================================== --- trunk/SKMainWindowController.m 2025-05-07 15:41:00 UTC (rev 15165) +++ trunk/SKMainWindowController.m 2025-05-07 15:47:14 UTC (rev 15166) @@ -2464,7 +2464,7 @@ NSWindowController *wc = [self windowControllerForNote:annotation]; if (wc == nil) { wc = [[SKNoteWindowController alloc] initWithNote:annotation]; - [(SKNoteWindowController *)wc setForceOnTop:[self interactionMode] != SKNormalMode]; + [(SKNoteWindowController *)wc setForceOnTop:[self interactionMode] == SKFullScreenMode]; [[self document] addWindowController:wc]; } [wc showWindow:self]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-05-07 15:41:18
|
Revision: 15165 http://sourceforge.net/p/skim-app/code/15165 Author: hofman Date: 2025-05-07 15:41:00 +0000 (Wed, 07 May 2025) Log Message: ----------- block enumeration Modified Paths: -------------- trunk/SKMainWindowController.m Modified: trunk/SKMainWindowController.m =================================================================== --- trunk/SKMainWindowController.m 2025-05-07 15:35:42 UTC (rev 15164) +++ trunk/SKMainWindowController.m 2025-05-07 15:41:00 UTC (rev 15165) @@ -2337,17 +2337,13 @@ scaleFactor:scaleFactor autoFits:autoFits]; - [swc setForceOnTop:[self interactionMode] != SKNormalMode]; + [swc setForceOnTop:[self interactionMode] == SKFullScreenMode]; [[self document] addWindowController:swc]; } - (void)showSnapshotsWithSetups:(NSArray *)setups { - NSUInteger i, iMax = [setups count]; - - for (i = 0; i < iMax; i++) { - NSDictionary *setup = [setups objectAtIndex:i]; - + [setups enumerateObjectsUsingBlock:^(NSDictionary *setup, NSUInteger i, BOOL *stop){ SKSnapshotWindowController *swc = [[SKSnapshotWindowController alloc] init]; [swc setDelegate:self]; @@ -2354,10 +2350,10 @@ [swc setPdfDocument:[pdfView document] setup:setup]; - [swc setForceOnTop:[self interactionMode] != SKNormalMode]; + [swc setForceOnTop:[self interactionMode] == SKFullScreenMode]; [[self document] addWindowController:swc]; - } + }]; } - (void)snapshotController:(SKSnapshotWindowController *)controller didFinishSetup:(SKSnapshotOpenType)openType { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-05-07 15:35:59
|
Revision: 15164 http://sourceforge.net/p/skim-app/code/15164 Author: hofman Date: 2025-05-07 15:35:42 +0000 (Wed, 07 May 2025) Log Message: ----------- no need for local variables Modified Paths: -------------- trunk/SKMainWindowController.m Modified: trunk/SKMainWindowController.m =================================================================== --- trunk/SKMainWindowController.m 2025-05-07 15:30:47 UTC (rev 15163) +++ trunk/SKMainWindowController.m 2025-05-07 15:35:42 UTC (rev 15164) @@ -2364,10 +2364,7 @@ if (openType == SKSnapshotOpenPreview) return; - BOOL isVisible = [self rightSidePaneIsOpen] && [self rightSidePaneState] == SKSidePaneStateSnapshot; - CGFloat scale = [[self window] backingScaleFactor]; - NSImage *image = [controller placeholderThumbnailWithSize:snapshotCacheSize scale:scale]; - + NSImage *image = [controller placeholderThumbnailWithSize:snapshotCacheSize scale:[[self window] backingScaleFactor]]; [controller setThumbnail:image]; [self snapshotNeedsUpdate:controller placeholder:YES]; @@ -2380,7 +2377,7 @@ NSUInteger row = [[rightSideController.snapshotArrayController arrangedObjects] indexOfObject:controller]; if (row != NSNotFound) { NSTableViewAnimationOptions options = NSTableViewAnimationEffectNone; - if (isVisible && [NSView shouldShowSlideAnimation]) + if ([self rightSidePaneIsOpen] && [self rightSidePaneState] == SKSidePaneStateSnapshot && [NSView shouldShowSlideAnimation]) options = NSTableViewAnimationEffectGap | NSTableViewAnimationSlideDown; [rightSideController.snapshotTableView insertRowsAtIndexes:[NSIndexSet indexSetWithIndex:row] withAnimation:options]; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-05-07 15:31:05
|
Revision: 15163 http://sourceforge.net/p/skim-app/code/15163 Author: hofman Date: 2025-05-07 15:30:47 +0000 (Wed, 07 May 2025) Log Message: ----------- Always start snapshot with placeholder image and generate thumbnail async Modified Paths: -------------- trunk/SKMainWindowController.m Modified: trunk/SKMainWindowController.m =================================================================== --- trunk/SKMainWindowController.m 2025-05-07 14:30:25 UTC (rev 15162) +++ trunk/SKMainWindowController.m 2025-05-07 15:30:47 UTC (rev 15163) @@ -2364,20 +2364,13 @@ if (openType == SKSnapshotOpenPreview) return; - NSImage *image; BOOL isVisible = [self rightSidePaneIsOpen] && [self rightSidePaneState] == SKSidePaneStateSnapshot; CGFloat scale = [[self window] backingScaleFactor]; + NSImage *image = [controller placeholderThumbnailWithSize:snapshotCacheSize scale:scale]; - if (isVisible && openType == SKSnapshotOpenNormal) - image = [[controller currentConfiguration] thumbnailWithSize:snapshotCacheSize scale:scale]; - else - image = [controller placeholderThumbnailWithSize:snapshotCacheSize scale:scale]; - [controller setThumbnail:image]; + [self snapshotNeedsUpdate:controller placeholder:YES]; - if (isVisible == NO || openType != SKSnapshotOpenNormal) - [self snapshotNeedsUpdate:controller placeholder:YES]; - if (openType == SKSnapshotOpenFromSetup) { [self insertObject:controller inSnapshotsAtIndex:[snapshots count]]; [rightSideController.snapshotTableView reloadData]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-05-07 14:30:50
|
Revision: 15162 http://sourceforge.net/p/skim-app/code/15162 Author: hofman Date: 2025-05-07 14:30:25 +0000 (Wed, 07 May 2025) Log Message: ----------- tweak layout Modified Paths: -------------- trunk/Base.lproj/GeneralPreferences.xib Modified: trunk/Base.lproj/GeneralPreferences.xib =================================================================== --- trunk/Base.lproj/GeneralPreferences.xib 2025-05-06 21:15:35 UTC (rev 15161) +++ trunk/Base.lproj/GeneralPreferences.xib 2025-05-07 14:30:25 UTC (rev 15162) @@ -210,7 +210,7 @@ </textFieldCell> </textField> <popUpButton toolTip="Remember and reopen files from a previous run" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="lVN-xI-ijg"> - <rect key="frame" x="27" y="383" width="127" height="25"/> + <rect key="frame" x="29" y="383" width="127" height="25"/> <popUpButtonCell key="cell" type="push" title="Never" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" imageScaling="proportionallyDown" inset="2" selectedItem="gtz-vr-anS" id="D0s-vg-Wzx"> <behavior key="behavior" lightByBackground="YES" lightByGray="YES"/> <font key="font" metaFont="menu"/> @@ -264,6 +264,7 @@ <constraint firstItem="ClK-rQ-vsN" firstAttribute="top" secondItem="5" secondAttribute="bottom" constant="12" id="Lpu-p7-gyl"/> <constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="14" secondAttribute="trailing" constant="20" symbolic="YES" id="Lyc-Te-X32"/> <constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="15" secondAttribute="trailing" constant="20" symbolic="YES" id="Nkq-Ax-nJg"/> + <constraint firstItem="lVN-xI-ijg" firstAttribute="leading" secondItem="1" secondAttribute="leading" constant="32" id="Oje-sg-FbU"/> <constraint firstItem="15" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="1" secondAttribute="leading" constant="20" symbolic="YES" id="P2b-oG-3nq"/> <constraint firstItem="19" firstAttribute="top" secondItem="4" secondAttribute="bottom" constant="12" id="Q1S-8k-zDI"/> <constraint firstItem="8" firstAttribute="top" secondItem="12" secondAttribute="bottom" constant="12" id="QXC-51-fr8"/> @@ -284,7 +285,6 @@ <constraint firstItem="18" firstAttribute="leading" secondItem="hos-Of-u1Q" secondAttribute="leading" id="dt2-ti-H14"/> <constraint firstItem="11" firstAttribute="trailing" secondItem="5" secondAttribute="trailing" id="fmK-oo-I6v"/> <constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="20" secondAttribute="trailing" constant="20" symbolic="YES" id="g4n-FP-2OB"/> - <constraint firstItem="lVN-xI-ijg" firstAttribute="leading" secondItem="hos-Of-u1Q" secondAttribute="leading" constant="10" id="hSI-ia-3FQ"/> <constraint firstItem="13" firstAttribute="width" secondItem="14" secondAttribute="width" id="iDb-LY-iDA"/> <constraint firstItem="4" firstAttribute="top" secondItem="6" secondAttribute="bottom" constant="12" id="jmv-eQ-PmW"/> <constraint firstItem="8" firstAttribute="trailing" secondItem="5" secondAttribute="trailing" id="jne-As-Stw"/> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-05-06 21:15:52
|
Revision: 15161 http://sourceforge.net/p/skim-app/code/15161 Author: hofman Date: 2025-05-06 21:15:35 +0000 (Tue, 06 May 2025) Log Message: ----------- make sure we don't reopen last open files twice Modified Paths: -------------- trunk/SKApplicationController.h trunk/SKApplicationController.m Modified: trunk/SKApplicationController.h =================================================================== --- trunk/SKApplicationController.h 2025-05-06 16:51:29 UTC (rev 15160) +++ trunk/SKApplicationController.h 2025-05-06 21:15:35 UTC (rev 15161) @@ -50,6 +50,7 @@ NSMenu *noteColumnsMenu; NSMenu *noteTypeMenu; NSTimer *currentDocumentsTimer; + BOOL didReopen; BOOL remoteScrolling; id activity; SKPreferenceController *preferenceController; Modified: trunk/SKApplicationController.m =================================================================== --- trunk/SKApplicationController.m 2025-05-06 16:51:29 UTC (rev 15160) +++ trunk/SKApplicationController.m 2025-05-06 21:15:35 UTC (rev 15161) @@ -166,6 +166,8 @@ } - (void)reopenLastOpenFiles { + didReopen = YES; + SKBookmark *previousSession = [[SKBookmarkController sharedBookmarkController] previousSession]; NSUInteger numberOfDocs = [[previousSession children] count]; @@ -211,7 +213,7 @@ - (void)applicationDidFinishLaunching:(NSNotification *)aNotification{ NSUserDefaults *sud = [NSUserDefaults standardUserDefaults]; - if ([sud integerForKey:SKReopenLastOpenFilesKey] == 1 && [[[aNotification userInfo] objectForKey:NSApplicationLaunchIsDefaultLaunchKey] boolValue]) + if (didReopen == NO && [sud integerForKey:SKReopenLastOpenFilesKey] == 1 && [[[aNotification userInfo] objectForKey:NSApplicationLaunchIsDefaultLaunchKey] boolValue]) [self reopenLastOpenFiles]; [NSApp setServicesProvider:[NSDocumentController sharedDocumentController]]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-05-06 16:51:47
|
Revision: 15160 http://sourceforge.net/p/skim-app/code/15160 Author: hofman Date: 2025-05-06 16:51:29 +0000 (Tue, 06 May 2025) Log Message: ----------- Allow choice between reopening last open files oonly for default launches or always, reopen in applicationWillFinishLaunching when always, otherwise at applicationDidFinishLaunching Modified Paths: -------------- trunk/Base.lproj/GeneralPreferences.xib trunk/InitialUserDefaults.plist trunk/SKApplicationController.h trunk/SKApplicationController.m trunk/de.lproj/GeneralPreferences.strings trunk/en.lproj/GeneralPreferences.strings trunk/es.lproj/GeneralPreferences.strings trunk/fr.lproj/GeneralPreferences.strings trunk/it.lproj/GeneralPreferences.strings trunk/ja.lproj/GeneralPreferences.strings trunk/nl.lproj/GeneralPreferences.strings trunk/pl.lproj/GeneralPreferences.strings trunk/ru.lproj/GeneralPreferences.strings trunk/zh_CN.lproj/GeneralPreferences.strings trunk/zh_TW.lproj/GeneralPreferences.strings Modified: trunk/Base.lproj/GeneralPreferences.xib =================================================================== --- trunk/Base.lproj/GeneralPreferences.xib 2025-05-06 15:03:40 UTC (rev 15159) +++ trunk/Base.lproj/GeneralPreferences.xib 2025-05-06 16:51:29 UTC (rev 15160) @@ -15,18 +15,8 @@ <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/> <customObject id="-3" userLabel="Application" customClass="NSObject"/> <customView translatesAutoresizingMaskIntoConstraints="NO" id="1"> - <rect key="frame" x="0.0" y="0.0" width="340" height="423"/> + <rect key="frame" x="0.0" y="0.0" width="340" height="451"/> <subviews> - <button toolTip="Remember and reopen files from a previous run" horizontalHuggingPriority="252" verticalHuggingPriority="750" imageHugsTitle="YES" translatesAutoresizingMaskIntoConstraints="NO" id="2"> - <rect key="frame" x="18" y="386" width="222" height="18"/> - <buttonCell key="cell" type="check" title="Reopen last open files at startup" bezelStyle="regularSquare" imagePosition="left" alignment="left" inset="2" id="50"> - <behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/> - <font key="font" metaFont="system"/> - </buttonCell> - <connections> - <binding destination="58" name="value" keyPath="values.SKReopenLastOpenFiles" id="60"/> - </connections> - </button> <button toolTip="Open the contents pane only when the file has a table of contents" horizontalHuggingPriority="252" verticalHuggingPriority="750" imageHugsTitle="YES" translatesAutoresizingMaskIntoConstraints="NO" id="3"> <rect key="frame" x="18" y="317" width="252" height="18"/> <buttonCell key="cell" type="check" title="Open pane only for Table of Contents" bezelStyle="regularSquare" imagePosition="left" alignment="left" inset="2" id="49"> @@ -212,7 +202,7 @@ </connections> </popUpButton> <textField horizontalHuggingPriority="252" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="f9u-Df-2s9"> - <rect key="frame" x="20" y="217" width="150" height="16"/> + <rect key="frame" x="18" y="217" width="152" height="16"/> <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Settings for Full Screen:" id="rQz-G0-Jos"> <font key="font" metaFont="system"/> <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/> @@ -219,6 +209,31 @@ <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/> </textFieldCell> </textField> + <popUpButton toolTip="Remember and reopen files from a previous run" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="lVN-xI-ijg"> + <rect key="frame" x="27" y="383" width="127" height="25"/> + <popUpButtonCell key="cell" type="push" title="Never" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" imageScaling="proportionallyDown" inset="2" selectedItem="gtz-vr-anS" id="D0s-vg-Wzx"> + <behavior key="behavior" lightByBackground="YES" lightByGray="YES"/> + <font key="font" metaFont="menu"/> + <menu key="menu" id="hqY-Yk-Ef0"> + <items> + <menuItem title="Never" state="on" id="gtz-vr-anS"/> + <menuItem title="Default launch" tag="1" id="njb-dx-Ovw"/> + <menuItem title="Always" tag="2" id="jKc-Tn-o1b"/> + </items> + </menu> + </popUpButtonCell> + <connections> + <binding destination="58" name="selectedTag" keyPath="values.SKReopenLastOpenFiles" id="tk5-Kv-QW6"/> + </connections> + </popUpButton> + <textField horizontalHuggingPriority="252" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="hos-Of-u1Q" userLabel="Open files:"> + <rect key="frame" x="18" y="415" width="204" height="16"/> + <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Reopen last open files at startup:" id="bXV-8Q-oZQ"> + <font key="font" metaFont="system"/> + <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/> + <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/> + </textFieldCell> + </textField> </subviews> <constraints> <constraint firstItem="11" firstAttribute="top" secondItem="13" secondAttribute="bottom" constant="12" id="0FC-yH-TEU"/> @@ -225,20 +240,27 @@ <constraint firstItem="10" firstAttribute="top" secondItem="3" secondAttribute="bottom" constant="6" symbolic="YES" id="0kE-Qf-IKS"/> <constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="18" secondAttribute="trailing" constant="20" symbolic="YES" id="1dC-9R-56p"/> <constraint firstItem="14" firstAttribute="leading" secondItem="15" secondAttribute="trailing" constant="8" symbolic="YES" id="1pJ-ZZ-JaA"/> + <constraint firstItem="YMN-MA-BZc" firstAttribute="leading" secondItem="hos-Of-u1Q" secondAttribute="leading" id="20r-lI-K3p"/> <constraint firstItem="f9u-Df-2s9" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="1" secondAttribute="leading" constant="20" symbolic="YES" id="32P-dV-Eex"/> - <constraint firstItem="20" firstAttribute="leading" secondItem="2" secondAttribute="leading" id="3gQ-UZ-qCQ"/> <constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="13" secondAttribute="trailing" constant="20" symbolic="YES" id="3k2-tt-YTb"/> + <constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="hos-Of-u1Q" secondAttribute="trailing" constant="20" symbolic="YES" id="6l3-zE-gSM"/> + <constraint firstItem="3" firstAttribute="leading" secondItem="hos-Of-u1Q" secondAttribute="leading" id="7ep-6b-PdA"/> <constraint firstItem="14" firstAttribute="leading" secondItem="13" secondAttribute="leading" id="8iP-uW-VDS"/> <constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="9" secondAttribute="trailing" constant="20" symbolic="YES" id="9zb-Rk-CmA"/> + <constraint firstItem="lVN-xI-ijg" firstAttribute="top" secondItem="hos-Of-u1Q" secondAttribute="bottom" constant="8" symbolic="YES" id="A23-MT-CLp"/> <constraint firstItem="19" firstAttribute="leading" secondItem="5" secondAttribute="leading" id="CG0-Ds-aXI"/> <constraint firstItem="3" firstAttribute="top" secondItem="ClK-rQ-vsN" secondAttribute="bottom" constant="8" symbolic="YES" id="Dcc-qq-NoQ"/> + <constraint firstItem="15" firstAttribute="leading" secondItem="hos-Of-u1Q" secondAttribute="leading" id="Doc-wp-yxY"/> + <constraint firstItem="5" firstAttribute="top" secondItem="lVN-xI-ijg" secondAttribute="bottom" constant="12" id="EXD-Ez-Qk4"/> <constraint firstItem="6" firstAttribute="leading" secondItem="5" secondAttribute="leading" id="GHw-r2-IJp"/> <constraint firstItem="YMN-MA-BZc" firstAttribute="top" secondItem="11" secondAttribute="bottom" constant="12" id="GZE-6M-v8w"/> <constraint firstItem="ClK-rQ-vsN" firstAttribute="leading" secondItem="16" secondAttribute="trailing" constant="8" symbolic="YES" id="Gcb-Ih-tm0"/> - <constraint firstItem="7" firstAttribute="leading" secondItem="2" secondAttribute="leading" id="Gig-Od-oNe"/> + <constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="lVN-xI-ijg" secondAttribute="trailing" constant="20" symbolic="YES" id="HDt-uN-fK8"/> + <constraint firstItem="16" firstAttribute="leading" secondItem="hos-Of-u1Q" secondAttribute="leading" id="HMC-6w-OcU"/> <constraint firstItem="11" firstAttribute="leading" secondItem="5" secondAttribute="leading" id="I9Q-aa-Z5s"/> <constraint firstItem="14" firstAttribute="firstBaseline" secondItem="15" secondAttribute="firstBaseline" id="Ie9-gI-Gij"/> <constraint firstItem="8" firstAttribute="leading" secondItem="5" secondAttribute="leading" id="KGY-vQ-NxW"/> + <constraint firstItem="f9u-Df-2s9" firstAttribute="leading" secondItem="hos-Of-u1Q" secondAttribute="leading" id="Kj1-8n-wxA"/> <constraint firstItem="ClK-rQ-vsN" firstAttribute="top" secondItem="5" secondAttribute="bottom" constant="12" id="Lpu-p7-gyl"/> <constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="14" secondAttribute="trailing" constant="20" symbolic="YES" id="Lyc-Te-X32"/> <constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="15" secondAttribute="trailing" constant="20" symbolic="YES" id="Nkq-Ax-nJg"/> @@ -252,14 +274,17 @@ <constraint firstItem="9" firstAttribute="leading" secondItem="7" secondAttribute="trailing" constant="8" symbolic="YES" id="UHb-CR-xG0"/> <constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="YMN-MA-BZc" secondAttribute="trailing" constant="20" symbolic="YES" id="VuG-1Z-TbY"/> <constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="10" secondAttribute="trailing" constant="20" symbolic="YES" id="WRj-j0-8hB"/> - <constraint firstItem="16" firstAttribute="leading" secondItem="2" secondAttribute="leading" id="X5u-gc-Hsr"/> + <constraint firstItem="7" firstAttribute="leading" secondItem="hos-Of-u1Q" secondAttribute="leading" id="WeX-oG-9fM"/> + <constraint firstItem="20" firstAttribute="leading" secondItem="hos-Of-u1Q" secondAttribute="leading" id="XBW-mv-Spu"/> <constraint firstItem="6" firstAttribute="top" secondItem="9" secondAttribute="bottom" constant="12" id="XWD-bi-DNu"/> <constraint firstItem="15" firstAttribute="leading" secondItem="1" secondAttribute="leading" priority="750" constant="20" symbolic="YES" id="Zu8-ZB-EUH"/> <constraint firstItem="duc-5M-yv6" firstAttribute="firstBaseline" secondItem="20" secondAttribute="firstBaseline" id="Zx2-aa-pa9"/> - <constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="2" secondAttribute="trailing" constant="20" symbolic="YES" id="apj-25-RFr"/> - <constraint firstItem="5" firstAttribute="top" secondItem="2" secondAttribute="bottom" constant="12" id="fEc-4e-XWs"/> + <constraint firstItem="12" firstAttribute="leading" secondItem="hos-Of-u1Q" secondAttribute="leading" id="bLu-jp-YjC"/> + <constraint firstItem="hos-Of-u1Q" firstAttribute="top" secondItem="1" secondAttribute="top" constant="20" symbolic="YES" id="bPi-A8-Wp7"/> + <constraint firstItem="18" firstAttribute="leading" secondItem="hos-Of-u1Q" secondAttribute="leading" id="dt2-ti-H14"/> <constraint firstItem="11" firstAttribute="trailing" secondItem="5" secondAttribute="trailing" id="fmK-oo-I6v"/> <constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="20" secondAttribute="trailing" constant="20" symbolic="YES" id="g4n-FP-2OB"/> + <constraint firstItem="lVN-xI-ijg" firstAttribute="leading" secondItem="hos-Of-u1Q" secondAttribute="leading" constant="10" id="hSI-ia-3FQ"/> <constraint firstItem="13" firstAttribute="width" secondItem="14" secondAttribute="width" id="iDb-LY-iDA"/> <constraint firstItem="4" firstAttribute="top" secondItem="6" secondAttribute="bottom" constant="12" id="jmv-eQ-PmW"/> <constraint firstItem="8" firstAttribute="trailing" secondItem="5" secondAttribute="trailing" id="jne-As-Stw"/> @@ -266,28 +291,22 @@ <constraint firstItem="14" firstAttribute="top" secondItem="18" secondAttribute="bottom" constant="8" id="kFa-WK-niq"/> <constraint firstItem="6" firstAttribute="trailing" secondItem="5" secondAttribute="trailing" id="klH-cN-ajl"/> <constraint firstItem="duc-5M-yv6" firstAttribute="leading" secondItem="20" secondAttribute="trailing" constant="8" symbolic="YES" id="kpP-fK-RP0"/> - <constraint firstItem="10" firstAttribute="leading" secondItem="2" secondAttribute="leading" id="lJK-au-NH1"/> + <constraint firstItem="4" firstAttribute="leading" secondItem="hos-Of-u1Q" secondAttribute="leading" id="lGd-Fh-0GF"/> <constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="duc-5M-yv6" secondAttribute="trailing" constant="20" symbolic="YES" id="ldM-OS-AyE"/> - <constraint firstItem="2" firstAttribute="top" secondItem="1" secondAttribute="top" constant="20" symbolic="YES" id="mMh-gX-FVQ"/> <constraint firstItem="18" firstAttribute="top" secondItem="10" secondAttribute="bottom" constant="6" symbolic="YES" id="n6b-L7-vO4"/> <constraint firstItem="13" firstAttribute="top" secondItem="14" secondAttribute="bottom" constant="12" symbolic="YES" id="npT-XL-y6y"/> <constraint firstItem="12" firstAttribute="top" secondItem="YMN-MA-BZc" secondAttribute="bottom" constant="6" symbolic="YES" id="pRs-P8-idK"/> <constraint firstAttribute="bottom" secondItem="duc-5M-yv6" secondAttribute="bottom" constant="20" symbolic="YES" id="prN-jO-7Ys"/> <constraint firstItem="13" firstAttribute="leading" secondItem="f9u-Df-2s9" secondAttribute="trailing" constant="8" symbolic="YES" id="qPH-G3-xAj"/> - <constraint firstItem="YMN-MA-BZc" firstAttribute="leading" secondItem="2" secondAttribute="leading" id="rQg-cx-g1w"/> <constraint firstItem="ClK-rQ-vsN" firstAttribute="firstBaseline" secondItem="16" secondAttribute="firstBaseline" id="rVj-ct-mRq"/> <constraint firstItem="5" firstAttribute="leading" secondItem="1" secondAttribute="leading" constant="12" id="rkP-h4-vkE"/> <constraint firstItem="duc-5M-yv6" firstAttribute="top" secondItem="19" secondAttribute="bottom" constant="12" id="rxL-uA-y9K"/> <constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="12" secondAttribute="trailing" constant="20" symbolic="YES" id="sf3-2d-1Yx"/> <constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="ClK-rQ-vsN" secondAttribute="trailing" constant="20" symbolic="YES" id="t5G-XJ-g2V"/> - <constraint firstItem="2" firstAttribute="leading" secondItem="1" secondAttribute="leading" constant="20" symbolic="YES" id="tMJ-tr-Biu"/> - <constraint firstItem="3" firstAttribute="leading" secondItem="2" secondAttribute="leading" id="ts7-AR-Lxc"/> <constraint firstAttribute="trailing" secondItem="5" secondAttribute="trailing" constant="12" id="uYa-Mh-FS5"/> - <constraint firstItem="4" firstAttribute="leading" secondItem="2" secondAttribute="leading" id="ubd-z2-fUk"/> - <constraint firstItem="18" firstAttribute="leading" secondItem="2" secondAttribute="leading" id="uqD-YV-TJ1"/> + <constraint firstItem="10" firstAttribute="leading" secondItem="hos-Of-u1Q" secondAttribute="leading" id="vK9-EU-mar"/> <constraint firstItem="13" firstAttribute="firstBaseline" secondItem="f9u-Df-2s9" secondAttribute="firstBaseline" id="vRB-kQ-LI2"/> <constraint firstItem="9" firstAttribute="top" secondItem="8" secondAttribute="bottom" constant="12" id="wRZ-ah-TXh"/> - <constraint firstItem="12" firstAttribute="leading" secondItem="2" secondAttribute="leading" id="x2g-Di-rcn"/> <constraint firstItem="9" firstAttribute="firstBaseline" secondItem="7" secondAttribute="firstBaseline" id="xO9-QM-sbG"/> </constraints> <point key="canvasLocation" x="139.5" y="154.5"/> Modified: trunk/InitialUserDefaults.plist =================================================================== --- trunk/InitialUserDefaults.plist 2025-05-06 15:03:40 UTC (rev 15159) +++ trunk/InitialUserDefaults.plist 2025-05-06 16:51:29 UTC (rev 15160) @@ -19,7 +19,7 @@ <key>SKInitialWindowSizeOption</key> <integer>0</integer> <key>SKReopenLastOpenFiles</key> - <false/> + <integer>0</integer> <key>SKRememberLastPageViewed</key> <false/> <key>SKRememberSnapshots</key> Modified: trunk/SKApplicationController.h =================================================================== --- trunk/SKApplicationController.h 2025-05-06 15:03:40 UTC (rev 15159) +++ trunk/SKApplicationController.h 2025-05-06 16:51:29 UTC (rev 15160) @@ -50,7 +50,6 @@ NSMenu *noteColumnsMenu; NSMenu *noteTypeMenu; NSTimer *currentDocumentsTimer; - BOOL didCheckReopen; BOOL remoteScrolling; id activity; SKPreferenceController *preferenceController; Modified: trunk/SKApplicationController.m =================================================================== --- trunk/SKApplicationController.m 2025-05-06 15:03:40 UTC (rev 15159) +++ trunk/SKApplicationController.m 2025-05-06 16:51:29 UTC (rev 15160) @@ -165,60 +165,54 @@ [[[NSDocumentController sharedDocumentController] documents] makeObjectsPerformSelector:forced ? @selector(saveRecentDocumentInfo) : @selector(saveRecentDocumentInfoIfNeeded)]; } -#pragma mark NSApplication delegate - -- (BOOL)applicationShouldOpenUntitledFile:(NSApplication *)application { - if (didCheckReopen == NO) { - NSUserDefaults *sud = [NSUserDefaults standardUserDefaults]; +- (void)reopenLastOpenFiles { + SKBookmark *previousSession = [[SKBookmarkController sharedBookmarkController] previousSession]; + NSUInteger numberOfDocs = [[previousSession children] count]; + + if (numberOfDocs > REOPEN_WARNING_LIMIT) { + NSAlert *alert = [[NSAlert alloc] init]; + [alert setMessageText:[NSString stringWithFormat:NSLocalizedString(@"Are you sure you want to open %lu documents?", @"Message in alert dialog"), (unsigned long)numberOfDocs]]; + [alert setInformativeText:NSLocalizedString(@"Each document opens in a separate window.", @"Informative text in alert dialog")]; + [alert addButtonWithTitle:NSLocalizedString(@"Cancel", @"Button title")]; + [alert addButtonWithTitle:NSLocalizedString(@"Open", @"Button title")]; - didCheckReopen = YES; - - if ([sud boolForKey:SKReopenLastOpenFilesKey] || [sud boolForKey:SKIsRelaunchKey]) { - // just remove this in case opening the last open files crashes the app after a relaunch - if ([sud objectForKey:SKIsRelaunchKey]) { - [sud removeObjectForKey:SKIsRelaunchKey]; - [sud synchronize]; - } - - SKBookmark *previousSession = [[SKBookmarkController sharedBookmarkController] previousSession]; - NSUInteger numberOfDocs = [[previousSession children] count]; - - if (numberOfDocs > REOPEN_WARNING_LIMIT) { - NSAlert *alert = [[NSAlert alloc] init]; - [alert setMessageText:[NSString stringWithFormat:NSLocalizedString(@"Are you sure you want to open %lu documents?", @"Message in alert dialog"), (unsigned long)numberOfDocs]]; - [alert setInformativeText:NSLocalizedString(@"Each document opens in a separate window.", @"Informative text in alert dialog")]; - [alert addButtonWithTitle:NSLocalizedString(@"Cancel", @"Button title")]; - [alert addButtonWithTitle:NSLocalizedString(@"Open", @"Button title")]; - - if (NSAlertFirstButtonReturn == [alert runModal]) - previousSession = nil; - } - - if (previousSession) - [[NSDocumentController sharedDocumentController] openDocumentWithBookmark:previousSession completionHandler:^(NSDocument *document, BOOL documentWasAlreadyOpen, NSError *error){ - if (document == nil && error && [error isUserCancelledError] == NO) - [NSApp presentError:error]; - }]; - } + if (NSAlertFirstButtonReturn == [alert runModal]) + previousSession = nil; } - return NO; -} + + if (previousSession) + [[NSDocumentController sharedDocumentController] openDocumentWithBookmark:previousSession completionHandler:^(NSDocument *document, BOOL documentWasAlreadyOpen, NSError *error){ + if (document == nil && error && [error isUserCancelledError] == NO) + [NSApp presentError:error]; + }]; +} +#pragma mark NSApplication delegate + - (void)applicationWillFinishLaunching:(NSNotification *)aNotification { + NSUserDefaults *sud = [NSUserDefaults standardUserDefaults]; + [NSImage makeImages]; [NSColor makeHighlightColors]; [NSValueTransformer registerCustomTransformers]; [PDFPage setUsesSequentialPageNumbering:[[NSUserDefaults standardUserDefaults] boolForKey:SKSequentialPageNumberingKey]]; - [[NSUserDefaults standardUserDefaults] addObserver:self forKeyPath:SKSequentialPageNumberingKey options:0 context:&SKApplicationControllerDefaultsObservationContext]; + [sud addObserver:self forKeyPath:SKSequentialPageNumberingKey options:0 context:&SKApplicationControllerDefaultsObservationContext]; + + if ([sud integerForKey:SKReopenLastOpenFilesKey] == 2 || [sud boolForKey:SKIsRelaunchKey]) { + // just remove this in case opening the last open files crashes the app after a relaunch + if ([sud objectForKey:SKIsRelaunchKey]) { + [sud removeObjectForKey:SKIsRelaunchKey]; + [sud synchronize]; + } + [self reopenLastOpenFiles]; + } } - (void)applicationDidFinishLaunching:(NSNotification *)aNotification{ NSUserDefaults *sud = [NSUserDefaults standardUserDefaults]; - if (didCheckReopen == NO && [[[aNotification userInfo] objectForKey:NSApplicationLaunchIsDefaultLaunchKey] boolValue]) - [self applicationShouldOpenUntitledFile:NSApp]; - didCheckReopen = YES; - [sud removeObjectForKey:SKIsRelaunchKey]; + if ([sud integerForKey:SKReopenLastOpenFilesKey] == 1 && [[[aNotification userInfo] objectForKey:NSApplicationLaunchIsDefaultLaunchKey] boolValue]) + [self reopenLastOpenFiles]; [NSApp setServicesProvider:[NSDocumentController sharedDocumentController]]; @@ -250,9 +244,8 @@ [NSApp setAutomaticCustomizeTouchBarMenuItemEnabled:YES]; } -// we don't want to reopen last open files when re-activating the app -- (BOOL)applicationShouldHandleReopen:(NSApplication *)application hasVisibleWindows:(BOOL)flag { - return flag; +- (BOOL)applicationShouldOpenUntitledFile:(NSApplication *)application { + return NO; } - (void)application:(NSApplication *)application openURLs:(NSArray *)urls { Modified: trunk/de.lproj/GeneralPreferences.strings =================================================================== (Binary files differ) Modified: trunk/en.lproj/GeneralPreferences.strings =================================================================== (Binary files differ) Modified: trunk/es.lproj/GeneralPreferences.strings =================================================================== (Binary files differ) Modified: trunk/fr.lproj/GeneralPreferences.strings =================================================================== (Binary files differ) Modified: trunk/it.lproj/GeneralPreferences.strings =================================================================== (Binary files differ) Modified: trunk/ja.lproj/GeneralPreferences.strings =================================================================== (Binary files differ) Modified: trunk/nl.lproj/GeneralPreferences.strings =================================================================== (Binary files differ) Modified: trunk/pl.lproj/GeneralPreferences.strings =================================================================== (Binary files differ) Modified: trunk/ru.lproj/GeneralPreferences.strings =================================================================== (Binary files differ) Modified: trunk/zh_CN.lproj/GeneralPreferences.strings =================================================================== (Binary files differ) Modified: trunk/zh_TW.lproj/GeneralPreferences.strings =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-05-06 15:03:58
|
Revision: 15159 http://sourceforge.net/p/skim-app/code/15159 Author: hofman Date: 2025-05-06 15:03:40 +0000 (Tue, 06 May 2025) Log Message: ----------- Compare user info key of notification to check if an app was simply launched rather than setting a flag in various delegate methods Modified Paths: -------------- trunk/SKApplicationController.m trunk/SKDocumentController.h trunk/SKDocumentController.m Modified: trunk/SKApplicationController.m =================================================================== --- trunk/SKApplicationController.m 2025-05-04 22:10:18 UTC (rev 15158) +++ trunk/SKApplicationController.m 2025-05-06 15:03:40 UTC (rev 15159) @@ -215,7 +215,7 @@ - (void)applicationDidFinishLaunching:(NSNotification *)aNotification{ NSUserDefaults *sud = [NSUserDefaults standardUserDefaults]; - if (didCheckReopen == NO && [[NSApp windows] count] == 0 && [(SKDocumentController *)[NSDocumentController sharedDocumentController] openedFile] == NO) + if (didCheckReopen == NO && [[[aNotification userInfo] objectForKey:NSApplicationLaunchIsDefaultLaunchKey] boolValue]) [self applicationShouldOpenUntitledFile:NSApp]; didCheckReopen = YES; [sud removeObjectForKey:SKIsRelaunchKey]; @@ -256,8 +256,6 @@ } - (void)application:(NSApplication *)application openURLs:(NSArray *)urls { - didCheckReopen = YES; - NSAppleEventDescriptor *errr = [[[NSAppleEventManager sharedAppleEventManager] currentAppleEvent] descriptorForKeyword:'errr']; BOOL errorReporting = errr ? [errr booleanValue] : YES; @@ -292,8 +290,6 @@ } - (NSApplicationPrintReply)application:(NSApplication *)application printFiles:(NSArray *)fileNames withSettings:(NSDictionary *)printSettings showPrintPanels:(BOOL)showPrintPanels { - didCheckReopen = YES; - // keep track to see whether we finished before this method returns __block NSApplicationPrintReply reply = NSNotFound; NSMutableArray *fileURLs = [NSMutableArray array]; Modified: trunk/SKDocumentController.h =================================================================== --- trunk/SKDocumentController.h 2025-05-04 22:10:18 UTC (rev 15158) +++ trunk/SKDocumentController.h 2025-05-06 15:03:40 UTC (rev 15159) @@ -68,7 +68,6 @@ @class SKBookmark; @interface SKDocumentController : NSDocumentController { - BOOL openedFile; Class openDocumentClass; } @@ -85,8 +84,6 @@ - (nullable Class)documentClassForContentsOfURL:(NSURL *)inAbsoluteURL; -@property (nonatomic, readonly) BOOL openedFile; - @end NS_ASSUME_NONNULL_END Modified: trunk/SKDocumentController.m =================================================================== --- trunk/SKDocumentController.m 2025-05-04 22:10:18 UTC (rev 15158) +++ trunk/SKDocumentController.m 2025-05-06 15:03:40 UTC (rev 15159) @@ -93,13 +93,10 @@ @implementation SKDocumentController -@synthesize openedFile; - - (instancetype)init { self = [super init]; if (self) { [self setAutosavingDelay:[[NSUserDefaults standardUserDefaults] doubleForKey:SKAutosaveIntervalKey]]; - openedFile = NO; } return self; } @@ -245,8 +242,6 @@ } - (void)openDocumentWithImageFromPasteboard:(NSPasteboard *)pboard completionHandler:(void (^)(NSDocument *document, BOOL documentWasAlreadyOpen, NSError *error))completionHandler { - openedFile = YES; - NSData *data = nil; NSString *type = nil; @@ -292,8 +287,6 @@ } - (void)openDocumentWithURLFromPasteboard:(NSPasteboard *)pboard showNotes:(BOOL)showNotes completionHandler:(void (^)(NSDocument *document, BOOL documentWasAlreadyOpen, NSError *error))completionHandler { - openedFile = YES; - NSArray *theURLs = [NSURL readURLsFromPasteboard:pboard]; NSURL *theURL = [theURLs count] > 0 ? [theURLs objectAtIndex:0] : nil; @@ -588,8 +581,6 @@ } - (void)openDocumentWithContentsOfURL:(NSURL *)absoluteURL display:(BOOL)displayDocument completionHandler:(void (^)(NSDocument *document, BOOL documentWasAlreadyOpen, NSError *error))completionHandler { - openedFile = YES; - NSString *fragment = [absoluteURL fragment]; NSDictionary *options = optionsFromFragmentAndEvent(fragment); NSString *type = [self typeForContentsOfURL:absoluteURL error:NULL]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-05-04 22:10:35
|
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. |
From: <ho...@us...> - 2025-05-04 21:26:07
|
Revision: 15157 http://sourceforge.net/p/skim-app/code/15157 Author: hofman Date: 2025-05-04 21:25:51 +0000 (Sun, 04 May 2025) Log Message: ----------- enerate image for tool tip with a slight delay, so itdoesnot happen when just moving over a link Modified Paths: -------------- trunk/SKImageToolTipWindow.h trunk/SKImageToolTipWindow.m Modified: trunk/SKImageToolTipWindow.h =================================================================== --- trunk/SKImageToolTipWindow.h 2025-05-04 16:39:51 UTC (rev 15156) +++ trunk/SKImageToolTipWindow.h 2025-05-04 21:25:51 UTC (rev 15157) @@ -45,6 +45,7 @@ @interface SKImageToolTipWindow : SKAnimatedBorderlessWindow { id <SKImageToolTipContext> context; NSPoint point; + CGFloat scale; NSImageView *imageView; NSImage *image; BOOL shouldShow; Modified: trunk/SKImageToolTipWindow.m =================================================================== --- trunk/SKImageToolTipWindow.m 2025-05-04 16:39:51 UTC (rev 15156) +++ trunk/SKImageToolTipWindow.m 2025-05-04 21:25:51 UTC (rev 15157) @@ -50,6 +50,7 @@ #define AUTO_HIDE_TIME_INTERVAL 10.0 #define DEFAULT_SHOW_DELAY 1.5 #define ALT_SHOW_DELAY 0.2 +#define GENERATE_DELAY 0.1 #define WINDOW_LEVEL ((NSWindowLevel)104) #define DEFAULT_SCALE -2.0 @@ -159,22 +160,40 @@ [self show]; } +- (void)generateImage { + id <SKImageToolTipContext> aContext = context; + CGFloat backingScale = [[NSScreen mainScreen] backingScaleFactor]; + NSNumber *usedScaleNumber = [[NSUserDefaults standardUserDefaults] objectForKey:SKToolTipScaleKey]; + CGFloat usedScale = [usedScaleNumber respondsToSelector:@selector(doubleValue)] ? [usedScaleNumber doubleValue] : DEFAULT_SCALE; + if (usedScale <= 0.0) + usedScale = usedScale < 0.0 ? fmin(scale, -usedScale) : scale; + + dispatch_async([[self class] imageQueue], ^{ + + NSImage *anImage = [aContext toolTipImageWithScale:usedScale backingScale:backingScale]; + + dispatch_async(dispatch_get_main_queue(), ^{ + + // check if another image is enerated or we are fading out + if (aContext == context) { + image = anImage; + if (image == nil) + [self fadeOut]; + else if (shouldShow) + [self show]; + } + + }); + + }); +} + - (void)stopAnimation { [super stopAnimation]; + [[self class] cancelPreviousPerformRequestsWithTarget:self selector:@selector(generateImage) object:nil]; [[self class] cancelPreviousPerformRequestsWithTarget:self selector:@selector(showDelayed) object:nil]; } -static inline CGFloat toolTipScale(CGFloat scale) { - NSNumber *usedScaleNumber = [[NSUserDefaults standardUserDefaults] objectForKey:SKToolTipScaleKey]; - CGFloat usedScale = [usedScaleNumber respondsToSelector:@selector(doubleValue)] ? [usedScaleNumber doubleValue] : DEFAULT_SCALE; - if (usedScale > 0.0) - return usedScale; - else if (usedScale < 0.0) - return fmin(scale, -usedScale); - else - return scale; -} - - (void)showForImageContext:(id <SKImageToolTipContext>)aContext scale:(CGFloat)aScale atPoint:(NSPoint)aPoint { point = aPoint; @@ -182,30 +201,11 @@ [self stopAnimation]; context = aContext; + scale = aScale; image = nil; shouldShow = NO; - CGFloat backingScale = [[NSScreen mainScreen] backingScaleFactor]; - - dispatch_async([[self class] imageQueue], ^{ - - NSImage *anImage = [aContext toolTipImageWithScale:toolTipScale(aScale) backingScale:backingScale]; - - dispatch_async(dispatch_get_main_queue(), ^{ - - // check if another image is enerated or we are fading out - if (aContext == context) { - image = anImage; - if (image == nil) - [self fadeOut]; - else if (shouldShow) - [self show]; - } - - }); - - }); - + [self performSelector:@selector(generateImage) withObject:nil afterDelay:GENERATE_DELAY]; [self performSelector:@selector(showDelayed) withObject:nil afterDelay:[self isVisible] ? ALT_SHOW_DELAY : DEFAULT_SHOW_DELAY]; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-05-04 16:40:08
|
Revision: 15156 http://sourceforge.net/p/skim-app/code/15156 Author: hofman Date: 2025-05-04 16:39:51 +0000 (Sun, 04 May 2025) Log Message: ----------- notify at page index remainder 49 Modified Paths: -------------- trunk/SKMainWindowController.m Modified: trunk/SKMainWindowController.m =================================================================== --- trunk/SKMainWindowController.m 2025-05-04 16:37:54 UTC (rev 15155) +++ trunk/SKMainWindowController.m 2025-05-04 16:39:51 UTC (rev 15156) @@ -2040,7 +2040,7 @@ if ([statusBar progressIndicatorStyle] == SKProgressIndicatorStyleDeterminate) [[statusBar progressIndicator] setDoubleValue:pageIndex + 1.0]; - if (pageIndex > 0 && pageIndex % 50 == 0) { + if (pageIndex % 50 == 49) { NSString *key = mwcFlags.findPaneState == SKFindPaneStateSingular ? SEARCHRESULTS_KEY : GROUPEDSEARCHRESULTS_KEY; mwcFlags.updatingFindResults = 1; [self didChangeValueForKey:key]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-05-04 16:38:12
|
Revision: 15155 http://sourceforge.net/p/skim-app/code/15155 Author: hofman Date: 2025-05-04 16:37:54 +0000 (Sun, 04 May 2025) Log Message: ----------- fix getting number Modified Paths: -------------- trunk/SKTableView.m Modified: trunk/SKTableView.m =================================================================== --- trunk/SKTableView.m 2025-05-04 16:20:09 UTC (rev 15154) +++ trunk/SKTableView.m 2025-05-04 16:37:54 UTC (rev 15155) @@ -350,7 +350,7 @@ - (void)mouseEntered:(NSEvent *)theEvent{ if ([self imageToolTipLayout] != SKTableImageToolTipNone) { - NSNumber *rowNumber = [[[[theEvent trackingArea] userInfo] objectForKey:SKImageToolTipRowNumberKey] nonretainedObjectValue]; + NSNumber *rowNumber = [[[theEvent trackingArea] userInfo] objectForKey:SKImageToolTipRowNumberKey]; if (rowNumber) { NSInteger row = [rowNumber integerValue]; if (row != -1) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-05-04 16:20:26
|
Revision: 15154 http://sourceforge.net/p/skim-app/code/15154 Author: hofman Date: 2025-05-04 16:20:09 +0000 (Sun, 04 May 2025) Log Message: ----------- set row number in tracking area rather than the rowwView Modified Paths: -------------- trunk/SKOutlineView.m trunk/SKTableView.m Modified: trunk/SKOutlineView.m =================================================================== --- trunk/SKOutlineView.m 2025-05-04 14:52:54 UTC (rev 15153) +++ trunk/SKOutlineView.m 2025-05-04 16:20:09 UTC (rev 15154) @@ -42,7 +42,7 @@ #import "NSEvent_SKExtensions.h" #import "NSFont_SKExtensions.h" -#define SKImageToolTipRowViewKey @"SKImageToolTipRowView" +#define SKImageToolTipRowNumberKey @"SKImageToolTipRowView" @implementation SKOutlineView @@ -286,7 +286,8 @@ #pragma mark Tracking - (void)addTrackingAreaForRowView:(NSTableRowView *)rowView { - NSDictionary *userInfo = [[NSDictionary alloc] initWithObjectsAndKeys:[NSValue valueWithNonretainedObject:rowView], SKImageToolTipRowViewKey, nil]; + NSInteger row = [self rowForView:rowView]; + NSDictionary *userInfo = @{SKImageToolTipRowNumberKey: [NSNumber numberWithInteger:row]}; NSTrackingArea *area = [[NSTrackingArea alloc] initWithRect:[rowView bounds] options:NSTrackingMouseEnteredAndExited | NSTrackingActiveInKeyWindow | NSTrackingInVisibleRect owner:self userInfo:userInfo]; [rowView addTrackingArea:area]; } @@ -293,7 +294,7 @@ - (void)removeTrackingAreaForRowView:(NSTableRowView *)rowView { for (NSTrackingArea *area in [rowView trackingAreas]) { - if ([[area userInfo] objectForKey:SKImageToolTipRowViewKey]) { + if ([[area userInfo] objectForKey:SKImageToolTipRowNumberKey]) { [rowView removeTrackingArea:area]; break; } @@ -336,9 +337,9 @@ - (void)mouseEntered:(NSEvent *)theEvent{ if ([self hasImageToolTips]) { - NSTableRowView *rowView = [[[[theEvent trackingArea] userInfo] objectForKey:SKImageToolTipRowViewKey] nonretainedObjectValue]; - if (rowView) { - NSInteger row = [self rowForView:rowView]; + NSNumber *rowNumber = [[[theEvent trackingArea] userInfo] objectForKey:SKImageToolTipRowNumberKey]; + if (rowNumber) { + NSInteger row = [rowNumber integerValue]; if (row != -1) { id item = [self itemAtRow:row]; if (item) { @@ -356,7 +357,7 @@ } - (void)mouseExited:(NSEvent *)theEvent{ - if ([self hasImageToolTips] && [[[theEvent trackingArea] userInfo] objectForKey:SKImageToolTipRowViewKey]) + if ([self hasImageToolTips] && [[[theEvent trackingArea] userInfo] objectForKey:SKImageToolTipRowNumberKey]) [[SKImageToolTipWindow sharedToolTipWindow] fadeOut]; else if ([[SKOutlineView superclass] instancesRespondToSelector:_cmd]) [super mouseEntered:theEvent]; Modified: trunk/SKTableView.m =================================================================== --- trunk/SKTableView.m 2025-05-04 14:52:54 UTC (rev 15153) +++ trunk/SKTableView.m 2025-05-04 16:20:09 UTC (rev 15154) @@ -42,7 +42,7 @@ #import "NSFont_SKExtensions.h" #import "SKImageToolTipWindow.h" -#define SKImageToolTipRowViewKey @"SKImageToolTipRowView" +#define SKImageToolTipRowNumberKey @"SKImageToolTipRow" #define SKImageToolTipColumnKey @"SKImageToolTipColumn" @implementation SKTableView @@ -289,17 +289,19 @@ } - (void)addTrackingAreaForRowView:(NSTableRowView *)rowView { - NSDictionary *userInfo = [[NSDictionary alloc] initWithObjectsAndKeys:[NSValue valueWithNonretainedObject:rowView], SKImageToolTipRowViewKey, nil]; + NSInteger row = [self rowForView:rowView]; + NSDictionary *userInfo = @{SKImageToolTipRowNumberKey: [NSNumber numberWithInteger:row]}; NSTrackingArea *area = [[NSTrackingArea alloc] initWithRect:[rowView bounds] options:NSTrackingMouseEnteredAndExited | NSTrackingActiveInKeyWindow | NSTrackingInVisibleRect owner:self userInfo:userInfo]; [rowView addTrackingArea:area]; } - (void)addTrackingAreasForRowView:(NSTableRowView *)rowView { + NSInteger row = [self rowForView:rowView]; NSInteger column, numCols = [self numberOfColumns]; for (column = 0; column < numCols; column++) { NSView *view = [rowView viewAtColumn:column]; if (view) { - NSDictionary *userInfo = [[NSDictionary alloc] initWithObjectsAndKeys:[NSValue valueWithNonretainedObject:rowView], SKImageToolTipRowViewKey, [NSNumber numberWithInteger:column], SKImageToolTipColumnKey, nil]; + NSDictionary *userInfo = @{SKImageToolTipRowNumberKey: [NSNumber numberWithInteger:row], SKImageToolTipColumnKey: [NSNumber numberWithInteger:column]}; NSTrackingArea *area = [[NSTrackingArea alloc] initWithRect:[view frame] options:NSTrackingMouseEnteredAndExited | NSTrackingActiveInKeyWindow owner:self userInfo:userInfo]; [rowView addTrackingArea:area]; } @@ -309,7 +311,7 @@ - (void)removeTrackingAreasForRowView:(NSTableRowView *)rowView { NSArray *areas = [[rowView trackingAreas] copy]; for (NSTrackingArea *area in areas) { - if ([[area userInfo] objectForKey:SKImageToolTipRowViewKey]) + if ([[area userInfo] objectForKey:SKImageToolTipRowNumberKey]) [rowView removeTrackingArea:area]; } } @@ -348,9 +350,9 @@ - (void)mouseEntered:(NSEvent *)theEvent{ if ([self imageToolTipLayout] != SKTableImageToolTipNone) { - NSTableRowView *rowView = [[[[theEvent trackingArea] userInfo] objectForKey:SKImageToolTipRowViewKey] nonretainedObjectValue]; - if (rowView) { - NSInteger row = [self rowForView:rowView]; + NSNumber *rowNumber = [[[[theEvent trackingArea] userInfo] objectForKey:SKImageToolTipRowNumberKey] nonretainedObjectValue]; + if (rowNumber) { + NSInteger row = [rowNumber integerValue]; if (row != -1) { id <SKImageToolTipContext> context = nil; CGFloat scale = 1.0; @@ -372,7 +374,7 @@ } - (void)mouseExited:(NSEvent *)theEvent{ - if ([self imageToolTipLayout] != SKTableImageToolTipNone && [[[theEvent trackingArea] userInfo] objectForKey:SKImageToolTipRowViewKey]) + if ([self imageToolTipLayout] != SKTableImageToolTipNone && [[[theEvent trackingArea] userInfo] objectForKey:SKImageToolTipRowNumberKey]) [[SKImageToolTipWindow sharedToolTipWindow] fadeOut]; else if ([[SKTableView superclass] instancesRespondToSelector:_cmd]) [super mouseExited:theEvent]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-05-04 14:53:10
|
Revision: 15153 http://sourceforge.net/p/skim-app/code/15153 Author: hofman Date: 2025-05-04 14:52:54 +0000 (Sun, 04 May 2025) Log Message: ----------- Move scale calculation to inline function Modified Paths: -------------- trunk/SKImageToolTipWindow.m Modified: trunk/SKImageToolTipWindow.m =================================================================== --- trunk/SKImageToolTipWindow.m 2025-05-04 14:42:44 UTC (rev 15152) +++ trunk/SKImageToolTipWindow.m 2025-05-04 14:52:54 UTC (rev 15153) @@ -164,6 +164,17 @@ [[self class] cancelPreviousPerformRequestsWithTarget:self selector:@selector(showDelayed) object:nil]; } +static inline CGFloat toolTipScale(CGFloat scale) { + NSNumber *usedScaleNumber = [[NSUserDefaults standardUserDefaults] objectForKey:SKToolTipScaleKey]; + CGFloat usedScale = [usedScaleNumber respondsToSelector:@selector(doubleValue)] ? [usedScaleNumber doubleValue] : DEFAULT_SCALE; + if (usedScale > 0.0) + return usedScale; + else if (usedScale < 0.0) + return fmin(scale, -usedScale); + else + return scale; +} + - (void)showForImageContext:(id <SKImageToolTipContext>)aContext scale:(CGFloat)aScale atPoint:(NSPoint)aPoint { point = aPoint; @@ -178,13 +189,8 @@ dispatch_async([[self class] imageQueue], ^{ - NSNumber *usedScaleNumber = [[NSUserDefaults standardUserDefaults] objectForKey:SKToolTipScaleKey]; - CGFloat usedScale = [usedScaleNumber respondsToSelector:@selector(doubleValue)] ? [usedScaleNumber doubleValue] : DEFAULT_SCALE; - if (usedScale <= 0.0) - usedScale = usedScale < 0.0 ? fmin(aScale, -usedScale) : aScale; + NSImage *anImage = [aContext toolTipImageWithScale:toolTipScale(aScale) backingScale:backingScale]; - NSImage *anImage = [aContext toolTipImageWithScale:usedScale backingScale:backingScale]; - dispatch_async(dispatch_get_main_queue(), ^{ // check if another image is enerated or we are fading out This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-05-04 14:43:00
|
Revision: 15152 http://sourceforge.net/p/skim-app/code/15152 Author: hofman Date: 2025-05-04 14:42:44 +0000 (Sun, 04 May 2025) Log Message: ----------- Pass backingScaleFactor to method to get tool tip image, as it is not safe to get this from NSScreen on a secondary thread Modified Paths: -------------- trunk/SKImageToolTipContext.h trunk/SKImageToolTipContext.m trunk/SKImageToolTipWindow.m Modified: trunk/SKImageToolTipContext.h =================================================================== --- trunk/SKImageToolTipContext.h 2025-05-04 14:29:24 UTC (rev 15151) +++ trunk/SKImageToolTipContext.h 2025-05-04 14:42:44 UTC (rev 15152) @@ -43,7 +43,7 @@ NS_ASSUME_NONNULL_BEGIN @protocol SKImageToolTipContext <NSObject> -- (nullable NSImage *)toolTipImageWithScale:(CGFloat)scale; +- (nullable NSImage *)toolTipImageWithScale:(CGFloat)scale backingScale:(CGFloat)backingScale; @end Modified: trunk/SKImageToolTipContext.m =================================================================== --- trunk/SKImageToolTipContext.m 2025-05-04 14:29:24 UTC (rev 15151) +++ trunk/SKImageToolTipContext.m 2025-05-04 14:42:44 UTC (rev 15152) @@ -99,12 +99,12 @@ @interface PDFDestination (SKImageToolTipContextExtension) -- (NSImage *)toolTipImageWithScale:(CGFloat)scale selections:(NSArray *)selections label:(NSString *)label; +- (NSImage *)toolTipImageWithScale:(CGFloat)scale backingScale:(CGFloat)backingScale selections:(NSArray *)selections label:(NSString *)label; @end @implementation PDFDestination (SKImageToolTipContext) -- (NSImage *)toolTipImageWithScale:(CGFloat)scale selections:(NSArray *)selections label:(NSString *)label { +- (NSImage *)toolTipImageWithScale:(CGFloat)scale backingScale:(CGFloat)backingScale selections:(NSArray *)selections label:(NSString *)label { static NSDictionary *labelAttributes = nil; static NSColor *labelColor = nil; if (labelAttributes == nil) @@ -122,7 +122,7 @@ NSPoint point = [[self effectiveDestinationForView:nil] point]; NSRect bounds = [page boundsForBox:kPDFDisplayBoxCropBox]; CGFloat size = isScaled ? ceil(scale * fmax(NSWidth(bounds), NSHeight(bounds))) : 0.0; - NSImage *pageImage = [page thumbnailWithSize:size scale:[[NSScreen mainScreen] backingScaleFactor] forBox:kPDFDisplayBoxCropBox hasShadow:NO highlights:selections]; + NSImage *pageImage = [page thumbnailWithSize:size scale:backingScale forBox:kPDFDisplayBoxCropBox hasShadow:NO highlights:selections]; NSRect pageImageRect = {NSZeroPoint, [pageImage size]}; NSRect sourceRect = NSZeroRect; PDFSelection *pageSelection = [page selectionForRect:bounds]; @@ -189,8 +189,8 @@ return image; } -- (NSImage *)toolTipImageWithScale:(CGFloat)scale { - return [self toolTipImageWithScale:scale selections:nil label:nil]; +- (NSImage *)toolTipImageWithScale:(CGFloat)scale backingScale:(CGFloat)backingScale { + return [self toolTipImageWithScale:scale backingScale:backingScale selections:nil label:nil]; } @end @@ -198,8 +198,8 @@ @implementation PDFSelection (SKImageToolTipContext) -- (NSImage *)toolTipImageWithScale:(CGFloat)scale { - return [[self destination] toolTipImageWithScale:scale selections:@[self] label:nil]; +- (NSImage *)toolTipImageWithScale:(CGFloat)scale backingScale:(CGFloat)backingScale { + return [[self destination] toolTipImageWithScale:scale backingScale:backingScale selections:@[self] label:nil]; } @end @@ -207,8 +207,8 @@ @implementation SKGroupedSearchResult (SKImageToolTipContext) -- (NSImage *)toolTipImageWithScale:(CGFloat)scale { - return [[[[self matches] firstObject] destination] toolTipImageWithScale:scale selections:[self matches] label:[self label]]; +- (NSImage *)toolTipImageWithScale:(CGFloat)scale backingScale:(CGFloat)backingScale { + return [[[[self matches] firstObject] destination] toolTipImageWithScale:scale backingScale:backingScale selections:[self matches] label:[self label]]; } @end @@ -216,10 +216,10 @@ @implementation PDFAnnotation (SKImageToolTipContext) -- (NSImage *)toolTipImageWithScale:(CGFloat)scale { +- (NSImage *)toolTipImageWithScale:(CGFloat)scale backingScale:(CGFloat)backingScale { if ([self isLink]) { - NSImage *image = [[self destination] toolTipImageWithScale:scale selections:nil label:nil]; + NSImage *image = [[self destination] toolTipImageWithScale:scale backingScale:backingScale selections:nil label:nil]; if (image) { [[[image representations] firstObject] setOpaque:YES]; return image; @@ -264,8 +264,8 @@ @implementation PDFPage (SKImageToolTipContext) -- (NSImage *)toolTipImageWithScale:(CGFloat)scale { - NSImage *image = [self thumbnailWithSize:256.0 scale:[[NSScreen mainScreen] backingScaleFactor] forBox:kPDFDisplayBoxCropBox hasShadow:NO highlights:nil]; +- (NSImage *)toolTipImageWithScale:(CGFloat)scale backingScale:(CGFloat)backingScale { + NSImage *image = [self thumbnailWithSize:256.0 scale:backingScale forBox:kPDFDisplayBoxCropBox hasShadow:NO highlights:nil]; [[[image representations] firstObject] setOpaque:YES]; return image; } Modified: trunk/SKImageToolTipWindow.m =================================================================== --- trunk/SKImageToolTipWindow.m 2025-05-04 14:29:24 UTC (rev 15151) +++ trunk/SKImageToolTipWindow.m 2025-05-04 14:42:44 UTC (rev 15152) @@ -174,6 +174,8 @@ image = nil; shouldShow = NO; + CGFloat backingScale = [[NSScreen mainScreen] backingScaleFactor]; + dispatch_async([[self class] imageQueue], ^{ NSNumber *usedScaleNumber = [[NSUserDefaults standardUserDefaults] objectForKey:SKToolTipScaleKey]; @@ -181,7 +183,7 @@ if (usedScale <= 0.0) usedScale = usedScale < 0.0 ? fmin(aScale, -usedScale) : aScale; - NSImage *anImage = [aContext toolTipImageWithScale:usedScale]; + NSImage *anImage = [aContext toolTipImageWithScale:usedScale backingScale:backingScale]; dispatch_async(dispatch_get_main_queue(), ^{ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-05-04 14:29:40
|
Revision: 15151 http://sourceforge.net/p/skim-app/code/15151 Author: hofman Date: 2025-05-04 14:29:24 +0000 (Sun, 04 May 2025) Log Message: ----------- No need for NSAttributedString to conform to SKToolTipImageContext. Don't override isOpaque for tooltip images from attributed string. Modified Paths: -------------- trunk/SKImageToolTipContext.h trunk/SKImageToolTipContext.m Modified: trunk/SKImageToolTipContext.h =================================================================== --- trunk/SKImageToolTipContext.h 2025-05-04 14:10:32 UTC (rev 15150) +++ trunk/SKImageToolTipContext.h 2025-05-04 14:29:24 UTC (rev 15151) @@ -47,9 +47,6 @@ @end -@interface NSAttributedString (SKImageToolTipContext) <SKImageToolTipContext> -@end - @interface PDFDestination (SKImageToolTipContext) <SKImageToolTipContext> @end Modified: trunk/SKImageToolTipContext.m =================================================================== --- trunk/SKImageToolTipContext.m 2025-05-04 14:10:32 UTC (rev 15150) +++ trunk/SKImageToolTipContext.m 2025-05-04 14:29:24 UTC (rev 15151) @@ -67,9 +67,13 @@ } +@interface NSAttributedString (SKImageToolTipContext) +- (NSImage *)toolTipImage; +@end + @implementation NSAttributedString (SKImageToolTipContext) -- (NSImage *)toolTipImageWithScale:(CGFloat)scale { +- (NSImage *)toolTipImage { NSAttributedString *attrString = [self attributedStringByAddingControlTextColorAttribute]; CGFloat width = [[NSUserDefaults standardUserDefaults] doubleForKey:SKToolTipWidthKey] - 2.0 * TEXT_MARGIN_X; CGFloat height = [[NSUserDefaults standardUserDefaults] doubleForKey:SKToolTipHeightKey] - 2.0 * TEXT_MARGIN_Y; @@ -216,16 +220,16 @@ if ([self isLink]) { NSImage *image = [[self destination] toolTipImageWithScale:scale selections:nil label:nil]; - if (image == nil) { + if (image) { + [[[image representations] firstObject] setOpaque:YES]; + return image; + } else { NSURL *url = [self URL]; if (url) { NSAttributedString *attrString = toolTipAttributedString([url absoluteString]); if ([attrString length]) - image = [attrString toolTipImageWithScale:1.0]; + image = [attrString toolTipImage]; } - } - if (image) { - [[[image representations] firstObject] setOpaque:YES]; return image; } } @@ -252,7 +256,7 @@ attrString = [attrString attributedSubstringFromRange:r]; } - return [attrString length] ? [attrString toolTipImageWithScale:1.0] : nil; + return [attrString length] ? [attrString toolTipImage] : nil; } @end This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-05-04 14:10:51
|
Revision: 15150 http://sourceforge.net/p/skim-app/code/15150 Author: hofman Date: 2025-05-04 14:10:32 +0000 (Sun, 04 May 2025) Log Message: ----------- don't delay generating prerview image for grouped search result, they should never be visible in the UI before they are fully formed Modified Paths: -------------- trunk/SKGroupedSearchResult.h trunk/SKGroupedSearchResult.m trunk/SKImageToolTipContext.h trunk/SKImageToolTipWindow.m trunk/SKMainWindowController.m Modified: trunk/SKGroupedSearchResult.h =================================================================== --- trunk/SKGroupedSearchResult.h 2025-05-04 09:38:18 UTC (rev 15149) +++ trunk/SKGroupedSearchResult.h 2025-05-04 14:10:32 UTC (rev 15150) @@ -47,7 +47,6 @@ PDFPage *page; NSUInteger maxCount; NSMutableArray<PDFSelection *> *matches; - BOOL readyForToolTip; } @property (nonatomic, readonly) PDFPage *page; @@ -56,7 +55,6 @@ @property (nonatomic) NSUInteger maxCount; @property (weak, nonatomic, readonly) NSString *label; @property (nonatomic, readonly) NSArray<PDFSelection *> *matches; -@property (nonatomic, getter=isReadyForToolTip) BOOL readyForToolTip; - (instancetype)initWithPage:(PDFPage *)aPage maxCount:(NSUInteger)aMaxCount; Modified: trunk/SKGroupedSearchResult.m =================================================================== --- trunk/SKGroupedSearchResult.m 2025-05-04 09:38:18 UTC (rev 15149) +++ trunk/SKGroupedSearchResult.m 2025-05-04 14:10:32 UTC (rev 15150) @@ -45,7 +45,7 @@ @implementation SKGroupedSearchResult -@synthesize page, maxCount, matches, readyForToolTip; +@synthesize page, maxCount, matches; @dynamic pageIndex, count, label; + (NSSet *)keyPathsForValuesAffectingValueForKey:(NSString *)key { Modified: trunk/SKImageToolTipContext.h =================================================================== --- trunk/SKImageToolTipContext.h 2025-05-04 09:38:18 UTC (rev 15149) +++ trunk/SKImageToolTipContext.h 2025-05-04 14:10:32 UTC (rev 15150) @@ -44,8 +44,6 @@ @protocol SKImageToolTipContext <NSObject> - (nullable NSImage *)toolTipImageWithScale:(CGFloat)scale; -@optional -@property (nonatomic, readonly, getter=isReadyForToolTip) BOOL readyForToolTip; @end Modified: trunk/SKImageToolTipWindow.m =================================================================== --- trunk/SKImageToolTipWindow.m 2025-05-04 09:38:18 UTC (rev 15149) +++ trunk/SKImageToolTipWindow.m 2025-05-04 14:10:32 UTC (rev 15150) @@ -174,11 +174,7 @@ image = nil; shouldShow = NO; - dispatch_time_t delay = 0; - if ([aContext respondsToSelector:@selector(isReadyForToolTip)] && [aContext isReadyForToolTip] == NO) - delay = NSEC_PER_SEC / 10; - - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, delay), [[self class] imageQueue], ^{ + dispatch_async([[self class] imageQueue], ^{ NSNumber *usedScaleNumber = [[NSUserDefaults standardUserDefaults] objectForKey:SKToolTipScaleKey]; CGFloat usedScale = [usedScaleNumber respondsToSelector:@selector(doubleValue)] ? [usedScaleNumber doubleValue] : DEFAULT_SCALE; Modified: trunk/SKMainWindowController.m =================================================================== --- trunk/SKMainWindowController.m 2025-05-04 09:38:18 UTC (rev 15149) +++ trunk/SKMainWindowController.m 2025-05-04 14:10:32 UTC (rev 15150) @@ -2038,17 +2038,6 @@ - (void)documentDidEndPageFind:(NSNotification *)note { NSUInteger pageIndex = [[[note userInfo] objectForKey:@"PDFDocumentPageIndex"] unsignedIntValue]; - NSUInteger i = [groupedSearchResults count]; - while (i-- > 0) { - SKGroupedSearchResult *result = [groupedSearchResults objectAtIndex:i]; - NSUInteger aPageIndex = [result pageIndex]; - if (pageIndex >= aPageIndex) { - if (pageIndex == aPageIndex) - [result setReadyForToolTip:YES]; - break; - } - } - if ([statusBar progressIndicatorStyle] == SKProgressIndicatorStyleDeterminate) [[statusBar progressIndicator] setDoubleValue:pageIndex + 1.0]; if (pageIndex > 0 && pageIndex % 50 == 0) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-05-04 09:38:35
|
Revision: 15149 http://sourceforge.net/p/skim-app/code/15149 Author: hofman Date: 2025-05-04 09:38:18 +0000 (Sun, 04 May 2025) Log Message: ----------- Copy selections and set highlight color in meethod drawing tool tip Modified Paths: -------------- trunk/SKImageToolTipContext.m Modified: trunk/SKImageToolTipContext.m =================================================================== --- trunk/SKImageToolTipContext.m 2025-05-04 09:11:54 UTC (rev 15148) +++ trunk/SKImageToolTipContext.m 2025-05-04 09:38:18 UTC (rev 15149) @@ -108,6 +108,11 @@ if (labelColor == nil) labelColor = [NSColor colorWithGenericGamma22White:0.55 alpha:0.8]; + if (selections) { + selections = [[NSArray alloc] initWithArray:selections copyItems:YES]; + [selections setValue:[NSColor findHighlightColor] forKey:@"color"]; + } + BOOL isScaled = fabs(scale - 1.0) > 0.01; PDFPage *page = [self page]; NSPoint point = [[self effectiveDestinationForView:nil] point]; @@ -190,10 +195,7 @@ @implementation PDFSelection (SKImageToolTipContext) - (NSImage *)toolTipImageWithScale:(CGFloat)scale { - PDFSelection *sel = [self copy]; - [sel setColor:[NSColor findHighlightColor]]; - NSArray *selections = @[sel]; - return [[self destination] toolTipImageWithScale:scale selections:selections label:nil]; + return [[self destination] toolTipImageWithScale:scale selections:@[self] label:nil]; } @end @@ -202,9 +204,7 @@ @implementation SKGroupedSearchResult (SKImageToolTipContext) - (NSImage *)toolTipImageWithScale:(CGFloat)scale { - NSArray *selections = [[NSArray alloc] initWithArray:[self matches] copyItems:YES]; - [selections setValue:[NSColor findHighlightColor] forKey:@"color"]; - return [[[selections firstObject] destination] toolTipImageWithScale:scale selections:selections label:[self label]]; + return [[[[self matches] firstObject] destination] toolTipImageWithScale:scale selections:[self matches] label:[self label]]; } @end This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |