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
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <ho...@us...> - 2025-06-01 17:19:26
|
Revision: 15341 http://sourceforge.net/p/skim-app/code/15341 Author: hofman Date: 2025-06-01 17:19:23 +0000 (Sun, 01 Jun 2025) Log Message: ----------- implement applyOptions: in the document class Modified Paths: -------------- trunk/SKMainDocument.m trunk/SKMainWindowController.h trunk/SKMainWindowController.m Modified: trunk/SKMainDocument.m =================================================================== --- trunk/SKMainDocument.m 2025-06-01 17:08:56 UTC (rev 15340) +++ trunk/SKMainDocument.m 2025-06-01 17:19:23 UTC (rev 15341) @@ -251,7 +251,36 @@ } - (void)applyOptions:(NSDictionary *)options { - [[self mainWindowController] applyOptions:options]; + SKPDFView *pdfView = [self pdfView]; + NSInteger page = [[options objectForKey:@"page"] integerValue]; + NSString *searchString = [options objectForKey:@"search"]; + NSMutableDictionary *settings = [options mutableCopy]; + [settings removeObjectForKey:@"page"]; + [settings removeObjectForKey:@"point"]; + [settings removeObjectForKey:@"search"]; + if ([settings count]) { + if (page == 0 && [[pdfView currentPage] pageIndex] > 0) + [pdfView setDisplaySettingsAndRewind:settings]; + else + [pdfView setDisplaySettings:settings]; + } + if (page > 0) { + page = MIN(page, (NSInteger)[[pdfView document] pageCount]); + NSString *pointString = [options objectForKey:@"point"]; + if ([pointString length] > 0) { + SKDestination dest; + if ([pointString hasPrefix:@"{"] == NO) + pointString = [NSString stringWithFormat:@"{%@}", pointString]; + dest.pageIndex = page - 1; + dest.point = NSPointFromString(pointString); + [pdfView goToCurrentDestination:dest]; + } else if ((NSInteger)[[pdfView currentPage] pageIndex] != page) { + [pdfView goToCurrentPage:[[pdfView document] pageAtIndex:page - 1]]; + } + } + if ([searchString length] > 0) { + [[self mainWindowController] setSearchString:searchString]; + } } - (NSInteger)definitiveOption:(NSInteger)option usingMessageText:(NSString *)messageText informativeText:(NSString *)informativeText { Modified: trunk/SKMainWindowController.h =================================================================== --- trunk/SKMainWindowController.h 2025-06-01 17:08:56 UTC (rev 15340) +++ trunk/SKMainWindowController.h 2025-06-01 17:19:23 UTC (rev 15341) @@ -218,7 +218,7 @@ @property (nonatomic, nullable, strong) IBOutlet NSView *leftSideContentView, *rightSideContentView; -@property (nonatomic, nullable, readonly) NSString *searchString; +@property (nonatomic, nullable, strong) NSString *searchString; - (SKTransitionController *)transitionControllerCreating:(BOOL)create; @@ -320,7 +320,6 @@ - (void)applySetup:(NSDictionary<NSString *, id> *)setup; - (NSDictionary<NSString *, id> *)currentSetup; -- (void)applyOptions:(NSDictionary<NSString *, id> *)options; - (void)updateSubtitle; - (void)updateLeftStatus; Modified: trunk/SKMainWindowController.m =================================================================== --- trunk/SKMainWindowController.m 2025-06-01 17:08:56 UTC (rev 15340) +++ trunk/SKMainWindowController.m 2025-06-01 17:19:23 UTC (rev 15341) @@ -620,41 +620,6 @@ return setup; } -- (void)applyOptions:(NSDictionary *)options { - NSInteger page = [[options objectForKey:@"page"] integerValue]; - NSString *searchString = [options objectForKey:@"search"]; - NSMutableDictionary *settings = [options mutableCopy]; - [settings removeObjectForKey:@"page"]; - [settings removeObjectForKey:@"point"]; - [settings removeObjectForKey:@"search"]; - if ([settings count]) { - if (page == 0 && [[pdfView currentPage] pageIndex] > 0) - [pdfView setDisplaySettingsAndRewind:settings]; - else - [pdfView setDisplaySettings:settings]; - } - if (page > 0) { - page = MIN(page, (NSInteger)[[pdfView document] pageCount]); - NSString *pointString = [options objectForKey:@"point"]; - if ([pointString length] > 0) { - SKDestination dest; - if ([pointString hasPrefix:@"{"] == NO) - pointString = [NSString stringWithFormat:@"{%@}", pointString]; - dest.pageIndex = page - 1; - dest.point = NSPointFromString(pointString); - [pdfView goToCurrentDestination:dest]; - } else if ((NSInteger)[[pdfView currentPage] pageIndex] != page) { - [pdfView goToCurrentPage:[[pdfView document] pageAtIndex:page - 1]]; - } - } - if ([searchString length] > 0) { - if ([self leftSidePaneIsOpen] == NO) - [self toggleLeftSidePane:nil]; - [leftSideController.searchField setStringValue:searchString]; - [self performSelector:@selector(search:) withObject:leftSideController.searchField afterDelay:0.0]; - } -} - #pragma mark UI updating - (void)updateSubtitle { @@ -1699,6 +1664,18 @@ return [leftSideController.searchField stringValue]; } +- (void)setSearchString:(NSString *)searchString { + if ([searchString length] > 0) { + if ([self leftSidePaneIsOpen] == NO) + [self toggleLeftSidePane:nil]; + [leftSideController.searchField setStringValue:searchString]; + [self performSelector:@selector(search:) withObject:leftSideController.searchField afterDelay:0.0]; + } else { + [leftSideController.searchField setStringValue:searchString]; + [self search:leftSideController.searchField]; + } +} + - (BOOL)findString:(NSString *)string forward:(BOOL)forward { PDFDocument *pdfDoc = [pdfView document]; if ([pdfDoc isFinding]) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-06-01 17:08:59
|
Revision: 15340 http://sourceforge.net/p/skim-app/code/15340 Author: hofman Date: 2025-06-01 17:08:56 +0000 (Sun, 01 Jun 2025) Log Message: ----------- remove unused macros Modified Paths: -------------- trunk/SKMainWindowController.m Modified: trunk/SKMainWindowController.m =================================================================== --- trunk/SKMainWindowController.m 2025-06-01 17:07:28 UTC (rev 15339) +++ trunk/SKMainWindowController.m 2025-06-01 17:08:56 UTC (rev 15340) @@ -141,14 +141,7 @@ #define MAINWINDOWFRAME_KEY @"windowFrame" #define LEFTSIDEPANEWIDTH_KEY @"leftSidePaneWidth" #define RIGHTSIDEPANEWIDTH_KEY @"rightSidePaneWidth" -#define SCALEFACTOR_KEY @"scaleFactor" #define AUTOSCALES_KEY @"autoScales" -#define DISPLAYSPAGEBREAKS_KEY @"displaysPageBreaks" -#define DISPLAYSASBOOK_KEY @"displaysAsBook" -#define DISPLAYMODE_KEY @"displayMode" -#define DISPLAYDIRECTION_KEY @"displayDirection" -#define DISPLAYSRTL_KEY @"displaysRTL" -#define DISPLAYBOX_KEY @"displayBox" #define HASHORIZONTALSCROLLER_KEY @"hasHorizontalScroller" #define HASVERTICALSCROLLER_KEY @"hasVerticalScroller" #define AUTOHIDESSCROLLERS_KEY @"autoHidesScrollers" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-06-01 17:07:32
|
Revision: 15339 http://sourceforge.net/p/skim-app/code/15339 Author: hofman Date: 2025-06-01 17:07:28 +0000 (Sun, 01 Jun 2025) Log Message: ----------- implement getting or setting PDF view settings in SKPDFView class Modified Paths: -------------- trunk/SKMainDocument.m trunk/SKMainWindowController.h trunk/SKMainWindowController.m trunk/SKMainWindowController_FullScreen.m trunk/SKPDFView.h trunk/SKPDFView.m Modified: trunk/SKMainDocument.m =================================================================== --- trunk/SKMainDocument.m 2025-06-01 16:14:03 UTC (rev 15338) +++ trunk/SKMainDocument.m 2025-06-01 17:07:28 UTC (rev 15339) @@ -1818,11 +1818,11 @@ } - (NSDictionary *)pdfViewSettings { - return [[self mainWindowController] currentPDFSettings]; + return [[self pdfView] displaySettings]; } - (void)setPdfViewSettings:(NSDictionary *)pdfViewSettings { - [[self mainWindowController] applyPDFSettings:pdfViewSettings rewind:NO]; + [[self pdfView] setDisplaySettings:pdfViewSettings]; } - (NSInteger)toolMode { Modified: trunk/SKMainWindowController.h =================================================================== --- trunk/SKMainWindowController.h 2025-06-01 16:14:03 UTC (rev 15338) +++ trunk/SKMainWindowController.h 2025-06-01 17:07:28 UTC (rev 15339) @@ -320,8 +320,6 @@ - (void)applySetup:(NSDictionary<NSString *, id> *)setup; - (NSDictionary<NSString *, id> *)currentSetup; -- (void)applyPDFSettings:(NSDictionary<NSString *, id> *)setup rewind:(BOOL)rewind; -- (NSDictionary<NSString *, id> *)currentPDFSettings; - (void)applyOptions:(NSDictionary<NSString *, id> *)options; - (void)updateSubtitle; Modified: trunk/SKMainWindowController.m =================================================================== --- trunk/SKMainWindowController.m 2025-06-01 16:14:03 UTC (rev 15338) +++ trunk/SKMainWindowController.m 2025-06-01 17:07:28 UTC (rev 15339) @@ -395,7 +395,7 @@ [pdfView setInterpolationQuality:[sud integerForKey:SKInterpolationQualityKey]]; [pdfView setBackgroundColor:[PDFView defaultBackgroundColor]]; - [self applyPDFSettings:hasWindowSetup ? savedNormalSetup : [sud dictionaryForKey:SKDefaultPDFDisplaySettingsKey] rewind:NO]; + [pdfView setDisplaySettings:hasWindowSetup ? savedNormalSetup : [sud dictionaryForKey:SKDefaultPDFDisplaySettingsKey]]; [pdfView setDelegate:self]; @@ -430,7 +430,7 @@ if (hasWindowSetup == NO && [[NSUserDefaults standardUserDefaults] boolForKey:SKUseSettingsFromPDFKey]) { NSDictionary *initialSettings = [[self pdfDocument] initialSettings]; if (initialSettings) { - [self applyPDFSettings:initialSettings rewind:NO]; + [pdfView setDisplaySettings:initialSettings]; if ([initialSettings objectForKey:@"fitWindow"]) windowSizeOption = [[initialSettings objectForKey:@"fitWindow"] boolValue] ? SKWindowOptionFit : SKWindowOptionDefault; } @@ -583,7 +583,7 @@ [self showSnapshotsWithSetups:snapshotSetups]; if ([self interactionMode] == SKNormalMode) - [self applyPDFSettings:setup rewind:NO]; + [pdfView setDisplaySettings:setup]; else [savedNormalSetup addEntriesFromDictionary:setup]; @@ -618,7 +618,7 @@ if ([snapshots count]) [setup setObject:[snapshots valueForKey:SKSnapshotCurrentSetupKey] forKey:SNAPSHOTS_KEY]; if ([self interactionMode] != SKPresentationMode) - [setup addEntriesFromDictionary:[self currentPDFSettings]]; + [setup addEntriesFromDictionary:[pdfView displaySettings]]; if ([self interactionMode] != SKNormalMode || [[pdfView document] isLocked]) { [setup addEntriesFromDictionary:savedNormalSetup]; [setup removeObjectsForKeys:@[HASHORIZONTALSCROLLER_KEY, HASVERTICALSCROLLER_KEY, AUTOHIDESSCROLLERS_KEY, DRAWSBACKGROUND_KEY, TABGROUP_KEY, TABINDEX_KEY, USECUSTOMANIMATION_KEY, LOCKED_KEY]]; @@ -627,43 +627,6 @@ return setup; } -- (void)applyPDFSettings:(NSDictionary *)setup rewind:(BOOL)rewind { - if ([setup count] && rewind) - [pdfView setNeedsRewind:YES]; - NSNumber *number; - if ((number = [setup objectForKey:AUTOSCALES_KEY])) - [pdfView setAutoScales:[number boolValue]]; - if ([pdfView autoScales] == NO && (number = [setup objectForKey:SCALEFACTOR_KEY])) - [pdfView setScaleFactor:[number doubleValue]]; - if ((number = [setup objectForKey:DISPLAYSPAGEBREAKS_KEY])) - [pdfView setDisplaysPageBreaks:[number boolValue]]; - if ((number = [setup objectForKey:DISPLAYSASBOOK_KEY])) - [pdfView setDisplaysAsBook:[number boolValue]]; - if ((number = [setup objectForKey:DISPLAYMODE_KEY])) - [pdfView setExtendedDisplayMode:[number integerValue]]; - if ((number = [setup objectForKey:DISPLAYDIRECTION_KEY])) - [pdfView setDisplaysHorizontally:[number boolValue]]; - if ((number = [setup objectForKey:DISPLAYSRTL_KEY])) - [pdfView setDisplaysRTL:[number boolValue]]; - if ((number = [setup objectForKey:DISPLAYBOX_KEY])) - [pdfView setDisplayBox:[number integerValue]]; -} - -- (NSDictionary *)currentPDFSettings { - NSMutableDictionary *setup = [NSMutableDictionary dictionary]; - - [setup setObject:[NSNumber numberWithBool:[pdfView displaysPageBreaks]] forKey:DISPLAYSPAGEBREAKS_KEY]; - [setup setObject:[NSNumber numberWithBool:[pdfView displaysAsBook]] forKey:DISPLAYSASBOOK_KEY]; - [setup setObject:[NSNumber numberWithInteger:[pdfView displayBox]] forKey:DISPLAYBOX_KEY]; - [setup setObject:[NSNumber numberWithDouble:[pdfView scaleFactor]] forKey:SCALEFACTOR_KEY]; - [setup setObject:[NSNumber numberWithBool:[pdfView autoScales]] forKey:AUTOSCALES_KEY]; - [setup setObject:[NSNumber numberWithInteger:[pdfView displayMode]] forKey:DISPLAYMODE_KEY]; - [setup setObject:[NSNumber numberWithInteger:[pdfView displaysHorizontally] ? 1 : 0] forKey:DISPLAYDIRECTION_KEY]; - [setup setObject:[NSNumber numberWithBool:[pdfView displaysRTL]] forKey:DISPLAYSRTL_KEY]; - - return setup; -} - - (void)applyOptions:(NSDictionary *)options { NSInteger page = [[options objectForKey:@"page"] integerValue]; NSString *searchString = [options objectForKey:@"search"]; @@ -671,8 +634,12 @@ [settings removeObjectForKey:@"page"]; [settings removeObjectForKey:@"point"]; [settings removeObjectForKey:@"search"]; - if ([settings count]) - [self applyPDFSettings:settings rewind:page == 0 && [[pdfView currentPage] pageIndex] > 0]; + if ([settings count]) { + if (page == 0 && [[pdfView currentPage] pageIndex] > 0) + [pdfView setDisplaySettingsAndRewind:settings]; + else + [pdfView setDisplaySettings:settings]; + } if (page > 0) { page = MIN(page, (NSInteger)[[pdfView document] pageCount]); NSString *pointString = [options objectForKey:@"point"]; @@ -2073,7 +2040,7 @@ NSDictionary *settings = [self interactionMode] == SKFullScreenMode ? [[NSUserDefaults standardUserDefaults] dictionaryForKey:SKDefaultFullScreenPDFDisplaySettingsKey] : nil; if ([settings count] == 0) settings = [savedNormalSetup objectForKey:AUTOSCALES_KEY] ? savedNormalSetup : [[NSUserDefaults standardUserDefaults] dictionaryForKey:SKDefaultPDFDisplaySettingsKey]; - [self applyPDFSettings:settings rewind:NO]; + [pdfView setDisplaySettings:settings]; NSNumber *pageIndexNumber = [savedNormalSetup objectForKey:PAGEINDEX_KEY]; NSUInteger pageIndex = pageIndexNumber ? [pageIndexNumber unsignedIntegerValue] : NSNotFound; Modified: trunk/SKMainWindowController_FullScreen.m =================================================================== --- trunk/SKMainWindowController_FullScreen.m 2025-06-01 16:14:03 UTC (rev 15338) +++ trunk/SKMainWindowController_FullScreen.m 2025-06-01 17:07:28 UTC (rev 15339) @@ -231,7 +231,7 @@ [[SKImageToolTipWindow sharedToolTipWindow] orderOut:nil]; // remember normal setup to return to, we must do this before changing the interactionMode - [savedNormalSetup setDictionary:[self currentPDFSettings]]; + [savedNormalSetup setDictionary:[pdfView displaySettings]]; NSWindow *normalWindow = [self window]; savedNormalWindow = normalWindow; @@ -564,7 +564,7 @@ if ([[pdfView document] isLocked] == NO) { NSDictionary *fullScreenSetup = [[NSUserDefaults standardUserDefaults] dictionaryForKey:SKDefaultFullScreenPDFDisplaySettingsKey]; if ([fullScreenSetup count]) - [self applyPDFSettings:fullScreenSetup rewind:YES]; + [pdfView setDisplaySettingsAndRewind:fullScreenSetup]; } } } @@ -576,7 +576,7 @@ [pdfView setBackgroundColor:backgroundColor]; [secondaryPdfView setBackgroundColor:backgroundColor]; if ([[[NSUserDefaults standardUserDefaults] dictionaryForKey:SKDefaultFullScreenPDFDisplaySettingsKey] count]) - [self applyPDFSettings:savedNormalSetup rewind:YES]; + [pdfView setDisplaySettingsAndRewind:savedNormalSetup]; } } @@ -583,7 +583,7 @@ - (void)windowWillEnterFullScreen:(NSWindow *)window { mwcFlags.isSwitchingFullScreen = 1; if ([[pdfView document] isLocked] == NO || [savedNormalSetup count] == 0) - [savedNormalSetup setDictionary:[self currentPDFSettings]]; + [savedNormalSetup setDictionary:[pdfView displaySettings]]; NSString *frameString = NSStringFromRect([[self window] frame]); [savedNormalSetup setObject:frameString forKey:MAINWINDOWFRAME_KEY]; [self forceSubwindowsOnTop:YES]; Modified: trunk/SKPDFView.h =================================================================== --- trunk/SKPDFView.h 2025-06-01 16:14:03 UTC (rev 15338) +++ trunk/SKPDFView.h 2025-06-01 17:07:28 UTC (rev 15339) @@ -223,6 +223,9 @@ - (void)setDisplayBoxAndRewind:(PDFDisplayBox)box; - (void)setDisplaysAsBookAndRewind:(BOOL)asBook; +@property (nonatomic, copy) NSDictionary<NSString *, id> *displaySettings; +- (void)setDisplaySettingsAndRewind:(NSDictionary<NSString *, id> *)settings; + - (void)addAnnotationForContext:(nullable id)sender; - (void)addAnnotationWithType:(SKNoteType)annotationType; - (void)removeCurrentAnnotation:(nullable id)sender; Modified: trunk/SKPDFView.m =================================================================== --- trunk/SKPDFView.m 2025-06-01 16:14:03 UTC (rev 15338) +++ trunk/SKPDFView.m 2025-06-01 17:07:28 UTC (rev 15339) @@ -137,6 +137,15 @@ #define SKAnnotationKey @"SKAnnotation" +#define SCALEFACTOR_KEY @"scaleFactor" +#define AUTOSCALES_KEY @"autoScales" +#define DISPLAYSPAGEBREAKS_KEY @"displaysPageBreaks" +#define DISPLAYSASBOOK_KEY @"displaysAsBook" +#define DISPLAYMODE_KEY @"displayMode" +#define DISPLAYDIRECTION_KEY @"displayDirection" +#define DISPLAYSRTL_KEY @"displaysRTL" +#define DISPLAYBOX_KEY @"displayBox" + static char SKPDFViewDefaultsObservationContext; static NSUInteger moveReadingBarModifiers = NSEventModifierFlagCommand; @@ -240,7 +249,7 @@ @implementation SKPDFView @synthesize toolMode, annotationMode, temporaryToolMode, currentAnnotation, readingBar, pacerSpeed, typeSelectHelper, syncDot, hideNotes, zooming; -@dynamic extendedDisplayMode, displaysHorizontally, canSelectNote, hasReadingBar, hasPacer, currentSelectionPage, currentSelectionRect, currentMagnification, needsRewind, editing; +@dynamic extendedDisplayMode, displaysHorizontally, displaySettings, canSelectNote, hasReadingBar, hasPacer, currentSelectionPage, currentSelectionRect, currentMagnification, needsRewind, editing; + (void)initialize { SKINITIALIZE; @@ -936,6 +945,47 @@ return hideNotes == NO && (toolMode == SKToolModeText || toolMode == SKToolModeNote) && [[self document] allowsNotes]; } +- (NSDictionary *)displaySetting { + NSMutableDictionary *setup = [NSMutableDictionary dictionary]; + + [setup setObject:[NSNumber numberWithBool:[self displaysPageBreaks]] forKey:DISPLAYSPAGEBREAKS_KEY]; + [setup setObject:[NSNumber numberWithBool:[self displaysAsBook]] forKey:DISPLAYSASBOOK_KEY]; + [setup setObject:[NSNumber numberWithInteger:[self displayBox]] forKey:DISPLAYBOX_KEY]; + [setup setObject:[NSNumber numberWithDouble:[self scaleFactor]] forKey:SCALEFACTOR_KEY]; + [setup setObject:[NSNumber numberWithBool:[self autoScales]] forKey:AUTOSCALES_KEY]; + [setup setObject:[NSNumber numberWithInteger:[self displayMode]] forKey:DISPLAYMODE_KEY]; + [setup setObject:[NSNumber numberWithInteger:[self displaysHorizontally] ? 1 : 0] forKey:DISPLAYDIRECTION_KEY]; + [setup setObject:[NSNumber numberWithBool:[self displaysRTL]] forKey:DISPLAYSRTL_KEY]; + + return setup; +} + +- (void)setDisplaySettings:(NSDictionary *)setup { + NSNumber *number; + if ((number = [setup objectForKey:AUTOSCALES_KEY])) + [self setAutoScales:[number boolValue]]; + if ([self autoScales] == NO && (number = [setup objectForKey:SCALEFACTOR_KEY])) + [self setScaleFactor:[number doubleValue]]; + if ((number = [setup objectForKey:DISPLAYSPAGEBREAKS_KEY])) + [self setDisplaysPageBreaks:[number boolValue]]; + if ((number = [setup objectForKey:DISPLAYSASBOOK_KEY])) + [self setDisplaysAsBook:[number boolValue]]; + if ((number = [setup objectForKey:DISPLAYMODE_KEY])) + [self setExtendedDisplayMode:[number integerValue]]; + if ((number = [setup objectForKey:DISPLAYDIRECTION_KEY])) + [self setDisplaysHorizontally:[number boolValue]]; + if ((number = [setup objectForKey:DISPLAYSRTL_KEY])) + [self setDisplaysRTL:[number boolValue]]; + if ((number = [setup objectForKey:DISPLAYBOX_KEY])) + [self setDisplayBox:[number integerValue]]; +} + +- (void)setDisplaySettingsAndRewind:(NSDictionary *)setup { + if ([setup count] && rewind) + [self setNeedsRewind:YES]; + [self setDisplaySettings:setup]; +} + #pragma mark Reading bar - (BOOL)hasReadingBar { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-06-01 16:14:10
|
Revision: 15338 http://sourceforge.net/p/skim-app/code/15338 Author: hofman Date: 2025-06-01 16:14:03 +0000 (Sun, 01 Jun 2025) Log Message: ----------- Use separate delegetae methods for entering or exiting fullscreen stylemask Modified Paths: -------------- trunk/SKMainWindow.h trunk/SKMainWindow.m trunk/SKMainWindowController_FullScreen.m Modified: trunk/SKMainWindow.h =================================================================== --- trunk/SKMainWindow.h 2025-05-31 15:12:55 UTC (rev 15337) +++ trunk/SKMainWindow.h 2025-06-01 16:14:03 UTC (rev 15338) @@ -52,7 +52,8 @@ @protocol SKMainWindowDelegate <NSWindowDelegate> @optional - (void)window:(NSWindow *)window willSendEvent:(NSEvent *)event; -- (void)window:(NSWindow *)window willBecomeFullScreen:(BOOL)fullScreen; +- (void)windowWillEnterFullScreenStyle:(NSWindow *)window; +- (void)windowWillExitFullScreenStyle:(NSWindow *)window; @end @interface SKMainWindow : SKWindow { Modified: trunk/SKMainWindow.m =================================================================== --- trunk/SKMainWindow.m 2025-05-31 15:12:55 UTC (rev 15337) +++ trunk/SKMainWindow.m 2025-06-01 16:14:03 UTC (rev 15338) @@ -90,9 +90,10 @@ } - (void)setStyleMask:(NSWindowStyleMask)styleMask { - if ((styleMask & NSWindowStyleMaskFullScreen) != ([self styleMask] & NSWindowStyleMaskFullScreen) && [[self delegate] respondsToSelector:@selector(window:willBecomeFullScreen:)]) { - [[self delegate] window:self willBecomeFullScreen:0 != (styleMask & NSWindowStyleMaskFullScreen)]; - } + if (0 != (styleMask & NSWindowStyleMaskFullScreen) && 0 == ([self styleMask] & NSWindowStyleMaskFullScreen) && [[self delegate] respondsToSelector:@selector(windowWillEnterFullScreenStyle:)]) + [[self delegate] windowWillEnterFullScreenStyle:self]; + else if (0 == (styleMask & NSWindowStyleMaskFullScreen) && 0 != ([self styleMask] & NSWindowStyleMaskFullScreen) && [[self delegate] respondsToSelector:@selector(windowWillExitFullScreenStyle:)]) + [[self delegate] windowWillExitFullScreenStyle:self]; [super setStyleMask:styleMask]; } Modified: trunk/SKMainWindowController_FullScreen.m =================================================================== --- trunk/SKMainWindowController_FullScreen.m 2025-05-31 15:12:55 UTC (rev 15337) +++ trunk/SKMainWindowController_FullScreen.m 2025-06-01 16:14:03 UTC (rev 15338) @@ -555,32 +555,32 @@ return openWindows; } -- (void)window:(NSWindow *)windoww willBecomeFullScreen:(BOOL)fullScreen { - if (fullScreen) { - if (interactionMode != SKFullScreenMode) { - interactionMode = SKFullScreenMode; - NSColor *backgroundColor = [PDFView defaultFullScreenBackgroundColor]; - [pdfView setBackgroundColor:backgroundColor]; - [secondaryPdfView setBackgroundColor:backgroundColor]; - if ([[pdfView document] isLocked] == NO) { - NSDictionary *fullScreenSetup = [[NSUserDefaults standardUserDefaults] dictionaryForKey:SKDefaultFullScreenPDFDisplaySettingsKey]; - if ([fullScreenSetup count]) - [self applyPDFSettings:fullScreenSetup rewind:YES]; - } +- (void)windowWillEnterFullScreenStyle:(NSWindow *)window { + if (interactionMode != SKFullScreenMode) { + interactionMode = SKFullScreenMode; + NSColor *backgroundColor = [PDFView defaultFullScreenBackgroundColor]; + [pdfView setBackgroundColor:backgroundColor]; + [secondaryPdfView setBackgroundColor:backgroundColor]; + if ([[pdfView document] isLocked] == NO) { + NSDictionary *fullScreenSetup = [[NSUserDefaults standardUserDefaults] dictionaryForKey:SKDefaultFullScreenPDFDisplaySettingsKey]; + if ([fullScreenSetup count]) + [self applyPDFSettings:fullScreenSetup rewind:YES]; } - } else { - if (interactionMode != SKNormalMode) { - interactionMode = SKNormalMode; - NSColor *backgroundColor = [PDFView defaultBackgroundColor]; - [pdfView setBackgroundColor:backgroundColor]; - [secondaryPdfView setBackgroundColor:backgroundColor]; - if ([[[NSUserDefaults standardUserDefaults] dictionaryForKey:SKDefaultFullScreenPDFDisplaySettingsKey] count]) - [self applyPDFSettings:savedNormalSetup rewind:YES]; - } } } -- (void)windowWillEnterFullScreen:(NSNotification *)notification { +- (void)windowWillExitFullScreenStyle:(NSWindow *)window { + if (interactionMode != SKNormalMode) { + interactionMode = SKNormalMode; + NSColor *backgroundColor = [PDFView defaultBackgroundColor]; + [pdfView setBackgroundColor:backgroundColor]; + [secondaryPdfView setBackgroundColor:backgroundColor]; + if ([[[NSUserDefaults standardUserDefaults] dictionaryForKey:SKDefaultFullScreenPDFDisplaySettingsKey] count]) + [self applyPDFSettings:savedNormalSetup rewind:YES]; + } +} + +- (void)windowWillEnterFullScreen:(NSWindow *)window { mwcFlags.isSwitchingFullScreen = 1; if ([[pdfView document] isLocked] == NO || [savedNormalSetup count] == 0) [savedNormalSetup setDictionary:[self currentPDFSettings]]; @@ -619,7 +619,7 @@ [self displayStaticContentInWindow:displayWindow ordered:NSWindowBelow]; [(SKMainWindow *)window setDisableConstrainedFrame:YES]; [window setFrame:frame display:YES]; - [self window:window willBecomeFullScreen:YES]; + [self windowWillEnterFullScreenStyle:window]; setAlphaValueOfTitleBarControls(window, 0.0, NO); [(SKMainWindow *)window setDisableConstrainedFrame:NO]; [NSAnimationContext runAnimationGroup:^(NSAnimationContext *context) { @@ -632,7 +632,7 @@ }]; } else { [(SKMainWindow *)window setDisableConstrainedFrame:YES]; - [self window:window willBecomeFullScreen:YES]; + [self windowWillEnterFullScreenStyle:window]; [NSAnimationContext runAnimationGroup:^(NSAnimationContext *context) { [context setDuration:duration - 0.02]; if (@available(macOS 12.0, *)) @@ -659,7 +659,7 @@ } - (void)windowDidFailToEnterFullScreen:(NSWindow *)window { - [self window:window willBecomeFullScreen:NO]; + [self windowWillExitFullScreenStyle:window]; if ([[pdfView document] isLocked] == NO || [savedNormalSetup count] < 3) [savedNormalSetup removeAllObjects]; else @@ -745,7 +745,7 @@ } - (void)windowDidFailToExitFullScreen:(NSWindow *)window { - [self window:window willBecomeFullScreen:YES]; + [self windowWillEnterFullScreenStyle:window]; savedNormalWindow = nil; mwcFlags.isSwitchingFullScreen = 0; mwcFlags.wantsPresentationOrFullScreen = 0; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-05-31 15:12:58
|
Revision: 15337 http://sourceforge.net/p/skim-app/code/15337 Author: hofman Date: 2025-05-31 15:12:55 +0000 (Sat, 31 May 2025) Log Message: ----------- Always exit fullscreen with custom animation when we entered with custom animation to be sure Modified Paths: -------------- trunk/SKMainWindowController_FullScreen.m Modified: trunk/SKMainWindowController_FullScreen.m =================================================================== --- trunk/SKMainWindowController_FullScreen.m 2025-05-31 09:41:45 UTC (rev 15336) +++ trunk/SKMainWindowController_FullScreen.m 2025-05-31 15:12:55 UTC (rev 15337) @@ -607,6 +607,7 @@ } - (void)window:(NSWindow *)window startCustomAnimationToEnterFullScreenWithDuration:(NSTimeInterval)duration { + [savedNormalSetup setObject:@YES forKey:USECUSTOMANIMATION_KEY]; if (fullScreenToolbarOffset <= 0.0 && autoHideToolbarInFullScreen() == NO && [[window toolbar] isVisible]) fullScreenToolbarOffset = toolbarViewOffset(window); NSRect frame = SKShrinkRect([[window screen] frame], -fullScreenOffset(window), NSMaxYEdge); @@ -630,7 +631,6 @@ [displayWindow orderOut:nil]; }]; } else { - [savedNormalSetup setObject:@YES forKey:USECUSTOMANIMATION_KEY]; [(SKMainWindow *)window setDisableConstrainedFrame:YES]; [self window:window willBecomeFullScreen:YES]; [NSAnimationContext runAnimationGroup:^(NSAnimationContext *context) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-05-31 09:41:48
|
Revision: 15336 http://sourceforge.net/p/skim-app/code/15336 Author: hofman Date: 2025-05-31 09:41:45 +0000 (Sat, 31 May 2025) Log Message: ----------- set flag to use custom animation in animation method, as delegate method to get windows comes too early Modified Paths: -------------- trunk/SKMainWindowController_FullScreen.m Modified: trunk/SKMainWindowController_FullScreen.m =================================================================== --- trunk/SKMainWindowController_FullScreen.m 2025-05-31 09:25:24 UTC (rev 15335) +++ trunk/SKMainWindowController_FullScreen.m 2025-05-31 09:41:45 UTC (rev 15336) @@ -602,8 +602,6 @@ if ([[NSWorkspace sharedWorkspace] accessibilityDisplayShouldReduceMotion]) { savedNormalWindow = [[SKAnimatedBorderlessWindow alloc] initWithContentRect:[window frame]]; [windows addObject:savedNormalWindow]; - } else { - [savedNormalSetup setObject:@YES forKey:USECUSTOMANIMATION_KEY]; } return windows; } @@ -632,6 +630,7 @@ [displayWindow orderOut:nil]; }]; } else { + [savedNormalSetup setObject:@YES forKey:USECUSTOMANIMATION_KEY]; [(SKMainWindow *)window setDisableConstrainedFrame:YES]; [self window:window willBecomeFullScreen:YES]; [NSAnimationContext runAnimationGroup:^(NSAnimationContext *context) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-05-31 09:25:33
|
Revision: 15335 http://sourceforge.net/p/skim-app/code/15335 Author: hofman Date: 2025-05-31 09:25:24 +0000 (Sat, 31 May 2025) Log Message: ----------- Always use our animation to exit full screen when we entered with our resize animation, otherwise the system's animation may get the target frame wrong Modified Paths: -------------- trunk/SKMainWindowController.m trunk/SKMainWindowController_FullScreen.m Modified: trunk/SKMainWindowController.m =================================================================== --- trunk/SKMainWindowController.m 2025-05-30 14:41:00 UTC (rev 15334) +++ trunk/SKMainWindowController.m 2025-05-31 09:25:24 UTC (rev 15335) @@ -159,6 +159,7 @@ #define SCROLLPOINT_KEY @"scrollPoint" #define LOCKED_KEY @"locked" #define CROPBOXES_KEY @"cropBpxes" +#define USECUSTOMANIMATION_KEY @"useCustomAnimation" #define TRANSITION_KEY @"transition" #define PAGETRANSITIONS_KEY @"pageTransitions" @@ -620,7 +621,7 @@ [setup addEntriesFromDictionary:[self currentPDFSettings]]; if ([self interactionMode] != SKNormalMode || [[pdfView document] isLocked]) { [setup addEntriesFromDictionary:savedNormalSetup]; - [setup removeObjectsForKeys:@[HASHORIZONTALSCROLLER_KEY, HASVERTICALSCROLLER_KEY, AUTOHIDESSCROLLERS_KEY, DRAWSBACKGROUND_KEY, TABGROUP_KEY, TABINDEX_KEY, LOCKED_KEY]]; + [setup removeObjectsForKeys:@[HASHORIZONTALSCROLLER_KEY, HASVERTICALSCROLLER_KEY, AUTOHIDESSCROLLERS_KEY, DRAWSBACKGROUND_KEY, TABGROUP_KEY, TABINDEX_KEY, USECUSTOMANIMATION_KEY, LOCKED_KEY]]; } return setup; Modified: trunk/SKMainWindowController_FullScreen.m =================================================================== --- trunk/SKMainWindowController_FullScreen.m 2025-05-30 14:41:00 UTC (rev 15334) +++ trunk/SKMainWindowController_FullScreen.m 2025-05-31 09:25:24 UTC (rev 15335) @@ -76,6 +76,7 @@ #define DRAWSBACKGROUND_KEY @"drawsBackground" #define TABGROUP_KEY @"tabGroup" #define TABINDEX_KEY @"tabIndex" +#define USECUSTOMANIMATION_KEY @"useCustomAnimation" #define SKAutoHideToolbarInFullScreenKey @"SKAutoHideToolbarInFullScreen" #define SKResizablePresentationKey @"SKResizablePresentation" @@ -601,6 +602,8 @@ if ([[NSWorkspace sharedWorkspace] accessibilityDisplayShouldReduceMotion]) { savedNormalWindow = [[SKAnimatedBorderlessWindow alloc] initWithContentRect:[window frame]]; [windows addObject:savedNormalWindow]; + } else { + [savedNormalSetup setObject:@YES forKey:USECUSTOMANIMATION_KEY]; } return windows; } @@ -658,8 +661,10 @@ - (void)windowDidFailToEnterFullScreen:(NSWindow *)window { [self window:window willBecomeFullScreen:NO]; - if ([[pdfView document] isLocked] == NO || [savedNormalSetup count] == 1) + if ([[pdfView document] isLocked] == NO || [savedNormalSetup count] < 3) [savedNormalSetup removeAllObjects]; + else + [savedNormalSetup removeObjectForKey:USECUSTOMANIMATION_KEY]; [self forceSubwindowsOnTop:NO]; savedNormalWindow = nil; mwcFlags.isSwitchingFullScreen = 0; @@ -671,7 +676,7 @@ - (NSArray *)customWindowsToExitFullScreenForWindow:(NSWindow *)window { NSMutableArray *windows = openWindows(self); - if ([windows count] == 1) + if ([windows count] == 1 && [[savedNormalSetup objectForKey:USECUSTOMANIMATION_KEY] boolValue] == NO) return nil; if ([[NSWorkspace sharedWorkspace] accessibilityDisplayShouldReduceMotion]) { savedNormalWindow = [[SKAnimatedBorderlessWindow alloc] initWithContentRect:[window frame]]; @@ -724,8 +729,10 @@ NSString *frameString = [savedNormalSetup objectForKey:MAINWINDOWFRAME_KEY]; if (frameString) [[self window] setFrame:NSRectFromString(frameString) display:YES]; - if ([[pdfView document] isLocked] == NO || [savedNormalSetup count] == 1) + if ([[pdfView document] isLocked] == NO || [savedNormalSetup count] < 3) [savedNormalSetup removeAllObjects]; + else + [savedNormalSetup removeObjectForKey:USECUSTOMANIMATION_KEY]; [self forceSubwindowsOnTop:NO]; mwcFlags.isSwitchingFullScreen = 0; if (mwcFlags.wantsPresentationOrFullScreen) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-05-30 14:41:03
|
Revision: 15334 http://sourceforge.net/p/skim-app/code/15334 Author: hofman Date: 2025-05-30 14:41:00 +0000 (Fri, 30 May 2025) Log Message: ----------- move code Modified Paths: -------------- trunk/SKMainWindowController_UI.m Modified: trunk/SKMainWindowController_UI.m =================================================================== --- trunk/SKMainWindowController_UI.m 2025-05-30 14:33:43 UTC (rev 15333) +++ trunk/SKMainWindowController_UI.m 2025-05-30 14:41:00 UTC (rev 15334) @@ -245,12 +245,6 @@ } } -- (void)windowDidResignKey:(NSNotification *)notification { - if ([[self window] isEqual:[notification object]]) { - [[SKImageToolTipWindow sharedToolTipWindow] orderOut:nil]; - } -} - - (void)windowDidResignMain:(NSNotification *)notification { if ([[self window] isEqual:[notification object]]) { [[SKImageToolTipWindow sharedToolTipWindow] orderOut:nil]; @@ -261,6 +255,12 @@ } } +- (void)windowDidResignKey:(NSNotification *)notification { + if ([[self window] isEqual:[notification object]]) { + [[SKImageToolTipWindow sharedToolTipWindow] orderOut:nil]; + } +} + - (void)windowWillClose:(NSNotification *)notification { if ([[notification object] isEqual:[self window]]) { [[self document] saveRecentDocumentInfo]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-05-30 14:33:46
|
Revision: 15333 http://sourceforge.net/p/skim-app/code/15333 Author: hofman Date: 2025-05-30 14:33:43 +0000 (Fri, 30 May 2025) Log Message: ----------- close image tooltip when entering presentation Modified Paths: -------------- trunk/SKMainWindowController_FullScreen.m Modified: trunk/SKMainWindowController_FullScreen.m =================================================================== --- trunk/SKMainWindowController_FullScreen.m 2025-05-30 14:25:00 UTC (rev 15332) +++ trunk/SKMainWindowController_FullScreen.m 2025-05-30 14:33:43 UTC (rev 15333) @@ -67,6 +67,7 @@ #import "SKAnimatedBorderlessWindow.h" #import "SKPresentationView.h" #import "NSWindow_SKExtensions.h" +#import "SKImageToolTipWindow.h" #define MAINWINDOWFRAME_KEY @"windowFrame" #define HASHORIZONTALSCROLLER_KEY @"hasHorizontalScroller" @@ -226,6 +227,8 @@ mwcFlags.isSwitchingFullScreen = 1; + [[SKImageToolTipWindow sharedToolTipWindow] orderOut:nil]; + // remember normal setup to return to, we must do this before changing the interactionMode [savedNormalSetup setDictionary:[self currentPDFSettings]]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-05-30 14:25:02
|
Revision: 15332 http://sourceforge.net/p/skim-app/code/15332 Author: hofman Date: 2025-05-30 14:25:00 +0000 (Fri, 30 May 2025) Log Message: ----------- remove image tooltip window on resign key or main through delegate methods Modified Paths: -------------- trunk/SKMainWindow.m trunk/SKMainWindowController_UI.m Modified: trunk/SKMainWindow.m =================================================================== --- trunk/SKMainWindow.m 2025-05-30 14:17:30 UTC (rev 15331) +++ trunk/SKMainWindow.m 2025-05-30 14:25:00 UTC (rev 15332) @@ -37,7 +37,6 @@ */ #import "SKMainWindow.h" -#import "SKImageToolTipWindow.h" #import "NSResponder_SKExtensions.h" #import "NSEvent_SKExtensions.h" @@ -113,16 +112,6 @@ [super sendEvent:theEvent]; } -- (void)resignMainWindow { - [[SKImageToolTipWindow sharedToolTipWindow] orderOut:nil]; - [super resignMainWindow]; -} - -- (void)resignKeyWindow { - [[SKImageToolTipWindow sharedToolTipWindow] orderOut:nil]; - [super resignKeyWindow]; -} - - (void)performClose:(id)sender { if ([self delegate]) [super performClose:sender]; Modified: trunk/SKMainWindowController_UI.m =================================================================== --- trunk/SKMainWindowController_UI.m 2025-05-30 14:17:30 UTC (rev 15331) +++ trunk/SKMainWindowController_UI.m 2025-05-30 14:25:00 UTC (rev 15332) @@ -245,8 +245,15 @@ } } +- (void)windowDidResignKey:(NSNotification *)notification { + if ([[self window] isEqual:[notification object]]) { + [[SKImageToolTipWindow sharedToolTipWindow] orderOut:nil]; + } +} + - (void)windowDidResignMain:(NSNotification *)notification { if ([[self window] isEqual:[notification object]]) { + [[SKImageToolTipWindow sharedToolTipWindow] orderOut:nil]; if ([[[NSColorPanel sharedColorPanel] accessoryView] isEqual:colorAccessoryView]) [[NSColorPanel sharedColorPanel] setAccessoryView:nil]; if ([self interactionMode] == SKPresentationMode && [[NSUserDefaults standardUserDefaults] boolForKey:SKUseNormalLevelForPresentationKey] == NO) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-05-30 14:17:34
|
Revision: 15331 http://sourceforge.net/p/skim-app/code/15331 Author: hofman Date: 2025-05-30 14:17:30 +0000 (Fri, 30 May 2025) Log Message: ----------- intermediate window subclass to use for notes document Modified Paths: -------------- trunk/NotesDocument.xib trunk/SKMainWindow.h trunk/SKMainWindow.m Modified: trunk/NotesDocument.xib =================================================================== --- trunk/NotesDocument.xib 2025-05-30 13:56:30 UTC (rev 15330) +++ trunk/NotesDocument.xib 2025-05-30 14:17:30 UTC (rev 15331) @@ -17,7 +17,7 @@ </customObject> <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/> <customObject id="-3" userLabel="Application" customClass="NSObject"/> - <window allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" restorable="NO" releasedWhenClosed="NO" visibleAtLaunch="NO" animationBehavior="default" id="5" userLabel="Window" customClass="SKMainWindow"> + <window allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" restorable="NO" releasedWhenClosed="NO" visibleAtLaunch="NO" animationBehavior="default" id="5" userLabel="Window" customClass="SKWindow"> <windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/> <windowCollectionBehavior key="collectionBehavior" fullScreenPrimary="YES"/> <windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/> Modified: trunk/SKMainWindow.h =================================================================== --- trunk/SKMainWindow.h 2025-05-30 13:56:30 UTC (rev 15330) +++ trunk/SKMainWindow.h 2025-05-30 14:17:30 UTC (rev 15331) @@ -46,6 +46,9 @@ SKWindowTitleHiddenForTabBar }; +@interface SKWindow : NSWindow +@end + @protocol SKMainWindowDelegate <NSWindowDelegate> @optional - (void)window:(NSWindow *)window willSendEvent:(NSEvent *)event; @@ -52,7 +55,7 @@ - (void)window:(NSWindow *)window willBecomeFullScreen:(BOOL)fullScreen; @end -@interface SKMainWindow : NSWindow { +@interface SKMainWindow : SKWindow { BOOL disableConstrainedFrame; } Modified: trunk/SKMainWindow.m =================================================================== --- trunk/SKMainWindow.m 2025-05-30 13:56:30 UTC (rev 15330) +++ trunk/SKMainWindow.m 2025-05-30 14:17:30 UTC (rev 15331) @@ -46,6 +46,28 @@ - (NSTitlebarAccessoryViewController *)_tabBarAccessoryViewController; @end +#pragma mark - + +@implementation SKWindow + +- (void)keyDown:(NSEvent *)event { + if (([event deviceIndependentModifierFlags] & ~NSEventModifierFlagNumericPad) == (NSEventModifierFlagCommand | NSEventModifierFlagOption)) { + unichar eventChar = [event firstCharacter]; + if (eventChar >= '1' && eventChar <= '9') { + NSArray *windows = [self tabbedWindows]; + if ([windows count] > MAX(1UL, eventChar - '1')) { + [self setValue:[windows objectAtIndex:eventChar - '1'] forKeyPath:@"tabGroup.selectedWindow"]; + return; + } + } + } + [super keyDown:event]; +} + +@end + +#pragma mark - + @implementation SKMainWindow @synthesize disableConstrainedFrame, autoTitleVisibility; @@ -91,20 +113,6 @@ [super sendEvent:theEvent]; } -- (void)keyDown:(NSEvent *)event { - if (([event deviceIndependentModifierFlags] & ~NSEventModifierFlagNumericPad) == (NSEventModifierFlagCommand | NSEventModifierFlagOption)) { - unichar eventChar = [event firstCharacter]; - if (eventChar >= '1' && eventChar <= '9') { - NSArray *windows = [self tabbedWindows]; - if ([windows count] > MAX(1UL, eventChar - '1')) { - [self setValue:[windows objectAtIndex:eventChar - '1'] forKeyPath:@"tabGroup.selectedWindow"]; - return; - } - } - } - [super keyDown:event]; -} - - (void)resignMainWindow { [[SKImageToolTipWindow sharedToolTipWindow] orderOut:nil]; [super resignMainWindow]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-05-30 13:56:32
|
Revision: 15330 http://sourceforge.net/p/skim-app/code/15330 Author: hofman Date: 2025-05-30 13:56:30 +0000 (Fri, 30 May 2025) Log Message: ----------- do not make side window subclass of SKMainWindow Modified Paths: -------------- trunk/SKSideWindow.h trunk/SKSideWindow.m Modified: trunk/SKSideWindow.h =================================================================== --- trunk/SKSideWindow.h 2025-05-30 09:20:18 UTC (rev 15329) +++ trunk/SKSideWindow.h 2025-05-30 13:56:30 UTC (rev 15330) @@ -37,11 +37,10 @@ */ #import <Cocoa/Cocoa.h> -#import "SKMainWindow.h" NS_ASSUME_NONNULL_BEGIN -@interface SKSideWindow : SKMainWindow { +@interface SKSideWindow : NSWindow { NSView *mainContentView; BOOL resizing; } Modified: trunk/SKSideWindow.m =================================================================== --- trunk/SKSideWindow.m 2025-05-30 09:20:18 UTC (rev 15329) +++ trunk/SKSideWindow.m 2025-05-30 13:56:30 UTC (rev 15330) @@ -45,6 +45,7 @@ #import "NSView_SKExtensions.h" #import "NSImage_SKExtensions.h" #import "SKMainWindowController_Actions.h" +#import "SKImageToolTipWindow.h" #define DEFAULT_WINDOW_WIDTH 300.0 #define DEFAULT_WINDOW_HEIGHT 400.0 @@ -115,6 +116,11 @@ - (BOOL)canBecomeKeyWindow { return YES; } +- (void)resignKeyWindow { + [[SKImageToolTipWindow sharedToolTipWindow] orderOut:nil]; + [super resignKeyWindow]; +} + - (void)attachToWindow:(NSWindow *)window { NSRect frame; NSRect screenFrame = [[window screen] frame]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-05-30 09:20:22
|
Revision: 15329 http://sourceforge.net/p/skim-app/code/15329 Author: hofman Date: 2025-05-30 09:20:18 +0000 (Fri, 30 May 2025) Log Message: ----------- fade out window from correct variable Modified Paths: -------------- trunk/SKMainWindowController_FullScreen.m Modified: trunk/SKMainWindowController_FullScreen.m =================================================================== --- trunk/SKMainWindowController_FullScreen.m 2025-05-30 09:18:25 UTC (rev 15328) +++ trunk/SKMainWindowController_FullScreen.m 2025-05-30 09:20:18 UTC (rev 15329) @@ -694,7 +694,7 @@ [context setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]]; if (covered == NO) [[window animator] setAlphaValue:1.0]; - [[savedNormalWindow animator] setAlphaValue:0.0]; + [[displayWindow animator] setAlphaValue:0.0]; } completionHandler:^{ [displayWindow orderOut:nil]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-05-30 09:18:30
|
Revision: 15328 http://sourceforge.net/p/skim-app/code/15328 Author: hofman Date: 2025-05-30 09:18:25 +0000 (Fri, 30 May 2025) Log Message: ----------- Keep saved window for fullscreen animation as shortly as possible, retain it by the completion handler block Modified Paths: -------------- trunk/SKMainWindowController_FullScreen.m Modified: trunk/SKMainWindowController_FullScreen.m =================================================================== --- trunk/SKMainWindowController_FullScreen.m 2025-05-30 09:02:00 UTC (rev 15327) +++ trunk/SKMainWindowController_FullScreen.m 2025-05-30 09:18:25 UTC (rev 15328) @@ -462,9 +462,8 @@ } } -- (void)displayStaticContentForWindowOrdered:(NSWindowOrderingMode)place { +- (void)displayStaticContentInWindow:(NSWindow *)displayWindow ordered:(NSWindowOrderingMode)place { NSWindow *window = [self window]; - NSWindow *displayWindow = savedNormalWindow; NSRect frame = [window frame]; CALayer *layer = [CALayer layer]; CGImageRef cgImage = CGWindowListCreateImage(CGRectNull, kCGWindowListOptionIncludingWindow, (CGWindowID)[window windowNumber], kCGWindowImageBoundsIgnoreFraming | kCGWindowImageBestResolution); @@ -610,7 +609,9 @@ if ([[NSUserDefaults standardUserDefaults] boolForKey:AppleMenuBarVisibleInFullscreenKey]) frame.size.height -= [[NSApp mainMenu] menuBarHeight] ?: 24.0; if (savedNormalWindow != nil) { - [self displayStaticContentForWindowOrdered:NSWindowBelow]; + NSWindow *displayWindow = savedNormalWindow; + savedNormalWindow = nil; + [self displayStaticContentInWindow:displayWindow ordered:NSWindowBelow]; [(SKMainWindow *)window setDisableConstrainedFrame:YES]; [window setFrame:frame display:YES]; [self window:window willBecomeFullScreen:YES]; @@ -622,8 +623,7 @@ [[window animator] setAlphaValue:1.0]; } completionHandler:^{ - [savedNormalWindow orderOut:nil]; - savedNormalWindow = nil; + [displayWindow orderOut:nil]; }]; } else { [(SKMainWindow *)window setDisableConstrainedFrame:YES]; @@ -681,7 +681,9 @@ NSRect frame = NSRectFromString([savedNormalSetup objectForKey:MAINWINDOWFRAME_KEY]); if (savedNormalWindow != nil) { BOOL covered = NSContainsRect([window frame], frame); - [self displayStaticContentForWindowOrdered:NSWindowAbove]; + NSWindow *displayWindow = savedNormalWindow; + savedNormalWindow = nil; + [self displayStaticContentInWindow:displayWindow ordered:NSWindowAbove]; [window setStyleMask:[window styleMask] & ~NSWindowStyleMaskFullScreen]; setAlphaValueOfTitleBarControls(window, 1.0, NO); [window setFrame:frame display:YES]; @@ -695,8 +697,7 @@ [[savedNormalWindow animator] setAlphaValue:0.0]; } completionHandler:^{ - [savedNormalWindow orderOut:nil]; - savedNormalWindow = nil; + [displayWindow orderOut:nil]; }]; } else { NSRect startFrame = [window frame]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-05-30 09:02:03
|
Revision: 15327 http://sourceforge.net/p/skim-app/code/15327 Author: hofman Date: 2025-05-30 09:02:00 +0000 (Fri, 30 May 2025) Log Message: ----------- do not bother getting full screen setup when locked Modified Paths: -------------- trunk/SKMainWindowController_FullScreen.m Modified: trunk/SKMainWindowController_FullScreen.m =================================================================== --- trunk/SKMainWindowController_FullScreen.m 2025-05-30 08:51:56 UTC (rev 15326) +++ trunk/SKMainWindowController_FullScreen.m 2025-05-30 09:02:00 UTC (rev 15327) @@ -557,11 +557,13 @@ if (interactionMode != SKFullScreenMode) { interactionMode = SKFullScreenMode; NSColor *backgroundColor = [PDFView defaultFullScreenBackgroundColor]; - NSDictionary *fullScreenSetup = [[NSUserDefaults standardUserDefaults] dictionaryForKey:SKDefaultFullScreenPDFDisplaySettingsKey]; [pdfView setBackgroundColor:backgroundColor]; [secondaryPdfView setBackgroundColor:backgroundColor]; - if ([[pdfView document] isLocked] == NO && [fullScreenSetup count]) - [self applyPDFSettings:fullScreenSetup rewind:YES]; + if ([[pdfView document] isLocked] == NO) { + NSDictionary *fullScreenSetup = [[NSUserDefaults standardUserDefaults] dictionaryForKey:SKDefaultFullScreenPDFDisplaySettingsKey]; + if ([fullScreenSetup count]) + [self applyPDFSettings:fullScreenSetup rewind:YES]; + } } } else { if (interactionMode != SKNormalMode) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-05-30 08:52:00
|
Revision: 15326 http://sourceforge.net/p/skim-app/code/15326 Author: hofman Date: 2025-05-30 08:51:56 +0000 (Fri, 30 May 2025) Log Message: ----------- do not restore side pane widths after full screen as we do not (optionally) collapse them Modified Paths: -------------- trunk/SKMainWindowController_FullScreen.m Modified: trunk/SKMainWindowController_FullScreen.m =================================================================== --- trunk/SKMainWindowController_FullScreen.m 2025-05-29 21:14:37 UTC (rev 15325) +++ trunk/SKMainWindowController_FullScreen.m 2025-05-30 08:51:56 UTC (rev 15326) @@ -69,8 +69,6 @@ #import "NSWindow_SKExtensions.h" #define MAINWINDOWFRAME_KEY @"windowFrame" -#define LEFTSIDEPANEWIDTH_KEY @"leftSidePaneWidth" -#define RIGHTSIDEPANEWIDTH_KEY @"rightSidePaneWidth" #define HASHORIZONTALSCROLLER_KEY @"hasHorizontalScroller" #define HASVERTICALSCROLLER_KEY @"hasVerticalScroller" #define AUTOHIDESSCROLLERS_KEY @"autoHidesScrollers" @@ -573,10 +571,6 @@ [secondaryPdfView setBackgroundColor:backgroundColor]; if ([[[NSUserDefaults standardUserDefaults] dictionaryForKey:SKDefaultFullScreenPDFDisplaySettingsKey] count]) [self applyPDFSettings:savedNormalSetup rewind:YES]; - NSNumber *leftWidth = [savedNormalSetup objectForKey:LEFTSIDEPANEWIDTH_KEY]; - NSNumber *rightWidth = [savedNormalSetup objectForKey:RIGHTSIDEPANEWIDTH_KEY]; - if (leftWidth && rightWidth) - [self applyLeftSideWidth:[leftWidth doubleValue] rightSideWidth:[rightWidth doubleValue]]; } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-05-29 21:14:41
|
Revision: 15325 http://sourceforge.net/p/skim-app/code/15325 Author: hofman Date: 2025-05-29 21:14:37 +0000 (Thu, 29 May 2025) Log Message: ----------- Update interactionMode when changing display for it, and use it to know whether we have done so. Modified Paths: -------------- trunk/SKMainWindowController.h trunk/SKMainWindowController_FullScreen.m Modified: trunk/SKMainWindowController.h =================================================================== --- trunk/SKMainWindowController.h 2025-05-29 17:09:53 UTC (rev 15324) +++ trunk/SKMainWindowController.h 2025-05-29 21:14:37 UTC (rev 15325) @@ -196,7 +196,6 @@ unsigned int isEditingPDF:1; unsigned int isEditingTable:1; unsigned int isSwitchingFullScreen:1; - unsigned int didUpdateFullScreenDisplay:1; unsigned int isAnimatingFindBar:1; unsigned int wantsPresentationOrFullScreen:1; unsigned int hasCropped:1; Modified: trunk/SKMainWindowController_FullScreen.m =================================================================== --- trunk/SKMainWindowController_FullScreen.m 2025-05-29 17:09:53 UTC (rev 15324) +++ trunk/SKMainWindowController_FullScreen.m 2025-05-29 21:14:37 UTC (rev 15325) @@ -555,33 +555,34 @@ } - (void)window:(NSWindow *)windoww willBecomeFullScreen:(BOOL)fullScreen { - if (mwcFlags.didUpdateFullScreenDisplay) - return; - mwcFlags.didUpdateFullScreenDisplay = 1; if (fullScreen) { - NSColor *backgroundColor = [PDFView defaultFullScreenBackgroundColor]; - NSDictionary *fullScreenSetup = [[NSUserDefaults standardUserDefaults] dictionaryForKey:SKDefaultFullScreenPDFDisplaySettingsKey]; - [pdfView setBackgroundColor:backgroundColor]; - [secondaryPdfView setBackgroundColor:backgroundColor]; - if ([[pdfView document] isLocked] == NO && [fullScreenSetup count]) - [self applyPDFSettings:fullScreenSetup rewind:YES]; + if (interactionMode != SKFullScreenMode) { + interactionMode = SKFullScreenMode; + NSColor *backgroundColor = [PDFView defaultFullScreenBackgroundColor]; + NSDictionary *fullScreenSetup = [[NSUserDefaults standardUserDefaults] dictionaryForKey:SKDefaultFullScreenPDFDisplaySettingsKey]; + [pdfView setBackgroundColor:backgroundColor]; + [secondaryPdfView setBackgroundColor:backgroundColor]; + if ([[pdfView document] isLocked] == NO && [fullScreenSetup count]) + [self applyPDFSettings:fullScreenSetup rewind:YES]; + } } else { - NSColor *backgroundColor = [PDFView defaultBackgroundColor]; - [pdfView setBackgroundColor:backgroundColor]; - [secondaryPdfView setBackgroundColor:backgroundColor]; - if ([[[NSUserDefaults standardUserDefaults] dictionaryForKey:SKDefaultFullScreenPDFDisplaySettingsKey] count]) - [self applyPDFSettings:savedNormalSetup rewind:YES]; - NSNumber *leftWidth = [savedNormalSetup objectForKey:LEFTSIDEPANEWIDTH_KEY]; - NSNumber *rightWidth = [savedNormalSetup objectForKey:RIGHTSIDEPANEWIDTH_KEY]; - if (leftWidth && rightWidth) - [self applyLeftSideWidth:[leftWidth doubleValue] rightSideWidth:[rightWidth doubleValue]]; + if (interactionMode != SKNormalMode) { + interactionMode = SKNormalMode; + NSColor *backgroundColor = [PDFView defaultBackgroundColor]; + [pdfView setBackgroundColor:backgroundColor]; + [secondaryPdfView setBackgroundColor:backgroundColor]; + if ([[[NSUserDefaults standardUserDefaults] dictionaryForKey:SKDefaultFullScreenPDFDisplaySettingsKey] count]) + [self applyPDFSettings:savedNormalSetup rewind:YES]; + NSNumber *leftWidth = [savedNormalSetup objectForKey:LEFTSIDEPANEWIDTH_KEY]; + NSNumber *rightWidth = [savedNormalSetup objectForKey:RIGHTSIDEPANEWIDTH_KEY]; + if (leftWidth && rightWidth) + [self applyLeftSideWidth:[leftWidth doubleValue] rightSideWidth:[rightWidth doubleValue]]; + } } } - (void)windowWillEnterFullScreen:(NSNotification *)notification { mwcFlags.isSwitchingFullScreen = 1; - mwcFlags.didUpdateFullScreenDisplay = 0; - interactionMode = SKFullScreenMode; if ([[pdfView document] isLocked] == NO || [savedNormalSetup count] == 0) [savedNormalSetup setDictionary:[self currentPDFSettings]]; NSString *frameString = NSStringFromRect([[self window] frame]); @@ -654,28 +655,19 @@ } [touchBarController interactionModeChanged]; mwcFlags.isSwitchingFullScreen = 0; - mwcFlags.didUpdateFullScreenDisplay = 0; } - (void)windowDidFailToEnterFullScreen:(NSWindow *)window { - if (interactionMode == SKFullScreenMode) { - interactionMode = SKNormalMode; - if (mwcFlags.didUpdateFullScreenDisplay) - [self window:window willBecomeFullScreen:NO]; - } + [self window:window willBecomeFullScreen:NO]; if ([[pdfView document] isLocked] == NO || [savedNormalSetup count] == 1) [savedNormalSetup removeAllObjects]; [self forceSubwindowsOnTop:NO]; savedNormalWindow = nil; - interactionMode = SKNormalMode; mwcFlags.isSwitchingFullScreen = 0; - mwcFlags.didUpdateFullScreenDisplay = 0; } - (void)windowWillExitFullScreen:(NSNotification *)notification { mwcFlags.isSwitchingFullScreen = 1; - mwcFlags.didUpdateFullScreenDisplay = 0; - interactionMode = SKNormalMode; } - (NSArray *)customWindowsToExitFullScreenForWindow:(NSWindow *)window { @@ -736,7 +728,6 @@ [savedNormalSetup removeAllObjects]; [self forceSubwindowsOnTop:NO]; mwcFlags.isSwitchingFullScreen = 0; - mwcFlags.didUpdateFullScreenDisplay = 0; if (mwcFlags.wantsPresentationOrFullScreen) { mwcFlags.wantsPresentationOrFullScreen = 0; // make sure the window fully finishes full screen @@ -748,14 +739,9 @@ } - (void)windowDidFailToExitFullScreen:(NSWindow *)window { - if (interactionMode == SKNormalMode) { - interactionMode = SKFullScreenMode; - if (mwcFlags.didUpdateFullScreenDisplay) - [self window:window willBecomeFullScreen:YES]; - } + [self window:window willBecomeFullScreen:YES]; savedNormalWindow = nil; mwcFlags.isSwitchingFullScreen = 0; - mwcFlags.didUpdateFullScreenDisplay = 0; mwcFlags.wantsPresentationOrFullScreen = 0; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-05-29 17:09:55
|
Revision: 15324 http://sourceforge.net/p/skim-app/code/15324 Author: hofman Date: 2025-05-29 17:09:53 +0000 (Thu, 29 May 2025) Log Message: ----------- Update display settings for full screen switching when the window changes its fullscreen style mask Modified Paths: -------------- trunk/SKMainWindow.h trunk/SKMainWindow.m trunk/SKMainWindowController.h trunk/SKMainWindowController_FullScreen.m Modified: trunk/SKMainWindow.h =================================================================== --- trunk/SKMainWindow.h 2025-05-29 15:51:07 UTC (rev 15323) +++ trunk/SKMainWindow.h 2025-05-29 17:09:53 UTC (rev 15324) @@ -49,6 +49,7 @@ @protocol SKMainWindowDelegate <NSWindowDelegate> @optional - (void)window:(NSWindow *)window willSendEvent:(NSEvent *)event; +- (void)window:(NSWindow *)window willBecomeFullScreen:(BOOL)fullScreen; @end @interface SKMainWindow : NSWindow { Modified: trunk/SKMainWindow.m =================================================================== --- trunk/SKMainWindow.m 2025-05-29 15:51:07 UTC (rev 15323) +++ trunk/SKMainWindow.m 2025-05-29 17:09:53 UTC (rev 15324) @@ -68,6 +68,13 @@ [self setFrame:frameRect display:YES]; } +- (void)setStyleMask:(NSWindowStyleMask)styleMask { + if ((styleMask & NSWindowStyleMaskFullScreen) != ([self styleMask] & NSWindowStyleMaskFullScreen) && [[self delegate] respondsToSelector:@selector(window:willBecomeFullScreen:)]) { + [[self delegate] window:self willBecomeFullScreen:0 != (styleMask & NSWindowStyleMaskFullScreen)]; + } + [super setStyleMask:styleMask]; +} + - (void)sendEvent:(NSEvent *)theEvent { if ([theEvent type] == NSEventTypeLeftMouseDown || [theEvent type] == NSEventTypeRightMouseDown || [theEvent type] == NSEventTypeKeyDown) { if ([[self delegate] respondsToSelector:@selector(window:willSendEvent:)]) Modified: trunk/SKMainWindowController.h =================================================================== --- trunk/SKMainWindowController.h 2025-05-29 15:51:07 UTC (rev 15323) +++ trunk/SKMainWindowController.h 2025-05-29 17:09:53 UTC (rev 15324) @@ -196,6 +196,7 @@ unsigned int isEditingPDF:1; unsigned int isEditingTable:1; unsigned int isSwitchingFullScreen:1; + unsigned int didUpdateFullScreenDisplay:1; unsigned int isAnimatingFindBar:1; unsigned int wantsPresentationOrFullScreen:1; unsigned int hasCropped:1; Modified: trunk/SKMainWindowController_FullScreen.m =================================================================== --- trunk/SKMainWindowController_FullScreen.m 2025-05-29 15:51:07 UTC (rev 15323) +++ trunk/SKMainWindowController_FullScreen.m 2025-05-29 17:09:53 UTC (rev 15324) @@ -554,19 +554,38 @@ return openWindows; } +- (void)window:(NSWindow *)windoww willBecomeFullScreen:(BOOL)fullScreen { + if (mwcFlags.didUpdateFullScreenDisplay) + return; + mwcFlags.didUpdateFullScreenDisplay = 1; + if (fullScreen) { + NSColor *backgroundColor = [PDFView defaultFullScreenBackgroundColor]; + NSDictionary *fullScreenSetup = [[NSUserDefaults standardUserDefaults] dictionaryForKey:SKDefaultFullScreenPDFDisplaySettingsKey]; + [pdfView setBackgroundColor:backgroundColor]; + [secondaryPdfView setBackgroundColor:backgroundColor]; + if ([[pdfView document] isLocked] == NO && [fullScreenSetup count]) + [self applyPDFSettings:fullScreenSetup rewind:YES]; + } else { + NSColor *backgroundColor = [PDFView defaultBackgroundColor]; + [pdfView setBackgroundColor:backgroundColor]; + [secondaryPdfView setBackgroundColor:backgroundColor]; + if ([[[NSUserDefaults standardUserDefaults] dictionaryForKey:SKDefaultFullScreenPDFDisplaySettingsKey] count]) + [self applyPDFSettings:savedNormalSetup rewind:YES]; + NSNumber *leftWidth = [savedNormalSetup objectForKey:LEFTSIDEPANEWIDTH_KEY]; + NSNumber *rightWidth = [savedNormalSetup objectForKey:RIGHTSIDEPANEWIDTH_KEY]; + if (leftWidth && rightWidth) + [self applyLeftSideWidth:[leftWidth doubleValue] rightSideWidth:[rightWidth doubleValue]]; + } +} + - (void)windowWillEnterFullScreen:(NSNotification *)notification { mwcFlags.isSwitchingFullScreen = 1; + mwcFlags.didUpdateFullScreenDisplay = 0; interactionMode = SKFullScreenMode; if ([[pdfView document] isLocked] == NO || [savedNormalSetup count] == 0) [savedNormalSetup setDictionary:[self currentPDFSettings]]; NSString *frameString = NSStringFromRect([[self window] frame]); [savedNormalSetup setObject:frameString forKey:MAINWINDOWFRAME_KEY]; - NSColor *backgroundColor = [PDFView defaultFullScreenBackgroundColor]; - NSDictionary *fullScreenSetup = [[NSUserDefaults standardUserDefaults] dictionaryForKey:SKDefaultFullScreenPDFDisplaySettingsKey]; - [pdfView setBackgroundColor:backgroundColor]; - [secondaryPdfView setBackgroundColor:backgroundColor]; - if ([[pdfView document] isLocked] == NO && [fullScreenSetup count]) - [self applyPDFSettings:fullScreenSetup rewind:YES]; [self forceSubwindowsOnTop:YES]; } @@ -597,6 +616,7 @@ [self displayStaticContentForWindowOrdered:NSWindowBelow]; [(SKMainWindow *)window setDisableConstrainedFrame:YES]; [window setFrame:frame display:YES]; + [self window:window willBecomeFullScreen:YES]; setAlphaValueOfTitleBarControls(window, 0.0, NO); [(SKMainWindow *)window setDisableConstrainedFrame:NO]; [NSAnimationContext runAnimationGroup:^(NSAnimationContext *context) { @@ -610,6 +630,7 @@ }]; } else { [(SKMainWindow *)window setDisableConstrainedFrame:YES]; + [self window:window willBecomeFullScreen:YES]; [NSAnimationContext runAnimationGroup:^(NSAnimationContext *context) { [context setDuration:duration - 0.02]; if (@available(macOS 12.0, *)) @@ -633,17 +654,14 @@ } [touchBarController interactionModeChanged]; mwcFlags.isSwitchingFullScreen = 0; + mwcFlags.didUpdateFullScreenDisplay = 0; } - (void)windowDidFailToEnterFullScreen:(NSWindow *)window { if (interactionMode == SKFullScreenMode) { interactionMode = SKNormalMode; - NSColor *backgroundColor = [PDFView defaultBackgroundColor]; - NSDictionary *fullScreenSetup = [[NSUserDefaults standardUserDefaults] dictionaryForKey:SKDefaultFullScreenPDFDisplaySettingsKey]; - [pdfView setBackgroundColor:backgroundColor]; - [secondaryPdfView setBackgroundColor:backgroundColor]; - if ([[pdfView document] isLocked] == NO && [fullScreenSetup count]) - [self applyPDFSettings:savedNormalSetup rewind:YES]; + if (mwcFlags.didUpdateFullScreenDisplay) + [self window:window willBecomeFullScreen:NO]; } if ([[pdfView document] isLocked] == NO || [savedNormalSetup count] == 1) [savedNormalSetup removeAllObjects]; @@ -651,20 +669,13 @@ savedNormalWindow = nil; interactionMode = SKNormalMode; mwcFlags.isSwitchingFullScreen = 0; + mwcFlags.didUpdateFullScreenDisplay = 0; } - (void)windowWillExitFullScreen:(NSNotification *)notification { mwcFlags.isSwitchingFullScreen = 1; + mwcFlags.didUpdateFullScreenDisplay = 0; interactionMode = SKNormalMode; - NSColor *backgroundColor = [PDFView defaultBackgroundColor]; - [pdfView setBackgroundColor:backgroundColor]; - [secondaryPdfView setBackgroundColor:backgroundColor]; - if ([[[NSUserDefaults standardUserDefaults] dictionaryForKey:SKDefaultFullScreenPDFDisplaySettingsKey] count]) - [self applyPDFSettings:savedNormalSetup rewind:YES]; - NSNumber *leftWidth = [savedNormalSetup objectForKey:LEFTSIDEPANEWIDTH_KEY]; - NSNumber *rightWidth = [savedNormalSetup objectForKey:RIGHTSIDEPANEWIDTH_KEY]; - if (leftWidth && rightWidth) - [self applyLeftSideWidth:[leftWidth doubleValue] rightSideWidth:[rightWidth doubleValue]]; } - (NSArray *)customWindowsToExitFullScreenForWindow:(NSWindow *)window { @@ -725,6 +736,7 @@ [savedNormalSetup removeAllObjects]; [self forceSubwindowsOnTop:NO]; mwcFlags.isSwitchingFullScreen = 0; + mwcFlags.didUpdateFullScreenDisplay = 0; if (mwcFlags.wantsPresentationOrFullScreen) { mwcFlags.wantsPresentationOrFullScreen = 0; // make sure the window fully finishes full screen @@ -738,15 +750,12 @@ - (void)windowDidFailToExitFullScreen:(NSWindow *)window { if (interactionMode == SKNormalMode) { interactionMode = SKFullScreenMode; - NSColor *backgroundColor = [PDFView defaultFullScreenBackgroundColor]; - NSDictionary *fullScreenSetup = [[NSUserDefaults standardUserDefaults] dictionaryForKey:SKDefaultFullScreenPDFDisplaySettingsKey]; - [pdfView setBackgroundColor:backgroundColor]; - [secondaryPdfView setBackgroundColor:backgroundColor]; - if ([[pdfView document] isLocked] == NO && [fullScreenSetup count]) - [self applyPDFSettings:fullScreenSetup rewind:YES]; + if (mwcFlags.didUpdateFullScreenDisplay) + [self window:window willBecomeFullScreen:YES]; } savedNormalWindow = nil; mwcFlags.isSwitchingFullScreen = 0; + mwcFlags.didUpdateFullScreenDisplay = 0; mwcFlags.wantsPresentationOrFullScreen = 0; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-05-29 15:51:10
|
Revision: 15323 http://sourceforge.net/p/skim-app/code/15323 Author: hofman Date: 2025-05-29 15:51:07 +0000 (Thu, 29 May 2025) Log Message: ----------- rename property Modified Paths: -------------- trunk/SKMainWindowController.m trunk/SKOverviewView.h trunk/SKOverviewView.m Modified: trunk/SKMainWindowController.m =================================================================== --- trunk/SKMainWindowController.m 2025-05-29 15:42:05 UTC (rev 15322) +++ trunk/SKMainWindowController.m 2025-05-29 15:51:07 UTC (rev 15323) @@ -1634,7 +1634,7 @@ [(NSVisualEffectView *)[overviewView backgroundView] setMaterial:isPresentation ? NSVisualEffectMaterialDark : NSVisualEffectMaterialSidebar]; [[overviewView visibleItems] setValue:[NSNumber numberWithInteger:isPresentation ? NSBackgroundStyleEmphasized : NSBackgroundStyleNormal] forKey:@"backgroundStyle"]; } - [overviewView setPerformActionOnSingleClick:isPresentation]; + [overviewView setSendActionOnSingleClick:isPresentation]; [[SKImageToolTipWindow sharedToolTipWindow] orderOut:nil]; Modified: trunk/SKOverviewView.h =================================================================== --- trunk/SKOverviewView.h 2025-05-29 15:42:05 UTC (rev 15322) +++ trunk/SKOverviewView.h 2025-05-29 15:51:07 UTC (rev 15323) @@ -44,13 +44,13 @@ @interface SKOverviewView : NSCollectionView { SEL action; - BOOL performActionOnSingleClick; + BOOL sendActionOnSingleClick; SKTypeSelectHelper *typeSelectHelper; NSMutableArray *cachedViews; } @property (nonatomic) SEL action; -@property (nonatomic) BOOL performActionOnSingleClick; +@property (nonatomic) BOOL sendActionOnSingleClick; @property (nonatomic, nullable, strong) SKTypeSelectHelper *typeSelectHelper; - (nullable id)newViewWithIdentifier:(NSString *)identifier; Modified: trunk/SKOverviewView.m =================================================================== --- trunk/SKOverviewView.m 2025-05-29 15:42:05 UTC (rev 15322) +++ trunk/SKOverviewView.m 2025-05-29 15:51:07 UTC (rev 15323) @@ -49,7 +49,7 @@ @implementation SKOverviewView -@synthesize action, performActionOnSingleClick, typeSelectHelper; +@synthesize action, sendActionOnSingleClick, typeSelectHelper; - (void)keyDown:(NSEvent *)theEvent { unichar eventChar = [theEvent firstCharacter]; @@ -58,7 +58,7 @@ if ((eventChar == NSNewlineCharacter || eventChar == NSEnterCharacter || eventChar == NSCarriageReturnCharacter) && modifiers == 0 && [self action]) { [self tryToPerform:[self action] with:self]; - } else if (eventChar == 'p' && modifiers == 0 && [self performActionOnSingleClick]) { + } else if (eventChar == 'p' && modifiers == 0 && [self sendActionOnSingleClick] && [self action]) { [self tryToPerform:[self action] with:self]; } else if ((eventChar == NSDownArrowFunctionKey && standardModifiers == NSEventModifierFlagOption) || (eventChar == NSRightArrowFunctionKey && standardModifiers == NSEventModifierFlagCommand) || (eventChar == NSPageDownFunctionKey && standardModifiers == 0)) { [self tryToPerform:@selector(doGoToNextPage:) with:self]; @@ -113,7 +113,7 @@ } - (void)mouseDown:(NSEvent *)theEvent { - SEL action = (([theEvent clickCount] == 1 && [self performActionOnSingleClick]) || [theEvent clickCount] == 2) ? [self action] : NULL; + SEL action = (([theEvent clickCount] == 1 && [self sendActionOnSingleClick]) || [theEvent clickCount] == 2) ? [self action] : NULL; if (action && [NSApp willDragMouse]) action = NULL; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-05-29 15:42:18
|
Revision: 15322 http://sourceforge.net/p/skim-app/code/15322 Author: hofman Date: 2025-05-29 15:42:05 +0000 (Thu, 29 May 2025) Log Message: ----------- Only one action for overviewview, boolean property to decide whether to use on single click Modified Paths: -------------- trunk/SKMainWindowController.m trunk/SKOverviewView.h trunk/SKOverviewView.m Modified: trunk/SKMainWindowController.m =================================================================== --- trunk/SKMainWindowController.m 2025-05-29 14:36:01 UTC (rev 15321) +++ trunk/SKMainWindowController.m 2025-05-29 15:42:05 UTC (rev 15322) @@ -1602,7 +1602,7 @@ [overviewView setDataSource:(id<NSCollectionViewDataSource>)self]; [overviewView setSelectionIndexes:[NSIndexSet indexSetWithIndex:[[pdfView currentPage] pageIndex]]]; [overviewView setTypeSelectHelper:[leftSideController.thumbnailTableView typeSelectHelper]]; - [overviewView setDoubleClickAction:@selector(hideOverview:)]; + [overviewView setAction:@selector(hideOverview:)]; [overviewView addObserver:self forKeyPath:@"selectionIndexPaths" options:0 context:&SKMainWindowThumbnailSelectionObservationContext]; [overviewContentView setTranslatesAutoresizingMaskIntoConstraints:NO]; } @@ -1634,7 +1634,7 @@ [(NSVisualEffectView *)[overviewView backgroundView] setMaterial:isPresentation ? NSVisualEffectMaterialDark : NSVisualEffectMaterialSidebar]; [[overviewView visibleItems] setValue:[NSNumber numberWithInteger:isPresentation ? NSBackgroundStyleEmphasized : NSBackgroundStyleNormal] forKey:@"backgroundStyle"]; } - [overviewView setSingleClickAction:isPresentation ? @selector(hideOverview:) : NULL]; + [overviewView setPerformActionOnSingleClick:isPresentation]; [[SKImageToolTipWindow sharedToolTipWindow] orderOut:nil]; Modified: trunk/SKOverviewView.h =================================================================== --- trunk/SKOverviewView.h 2025-05-29 14:36:01 UTC (rev 15321) +++ trunk/SKOverviewView.h 2025-05-29 15:42:05 UTC (rev 15322) @@ -43,12 +43,14 @@ @class SKTypeSelectHelper; @interface SKOverviewView : NSCollectionView { - SEL singleClickAction, doubleClickAction; + SEL action; + BOOL performActionOnSingleClick; SKTypeSelectHelper *typeSelectHelper; NSMutableArray *cachedViews; } -@property (nonatomic) SEL singleClickAction, doubleClickAction; +@property (nonatomic) SEL action; +@property (nonatomic) BOOL performActionOnSingleClick; @property (nonatomic, nullable, strong) SKTypeSelectHelper *typeSelectHelper; - (nullable id)newViewWithIdentifier:(NSString *)identifier; Modified: trunk/SKOverviewView.m =================================================================== --- trunk/SKOverviewView.m 2025-05-29 14:36:01 UTC (rev 15321) +++ trunk/SKOverviewView.m 2025-05-29 15:42:05 UTC (rev 15322) @@ -49,7 +49,7 @@ @implementation SKOverviewView -@synthesize singleClickAction, doubleClickAction, typeSelectHelper; +@synthesize action, performActionOnSingleClick, typeSelectHelper; - (void)keyDown:(NSEvent *)theEvent { unichar eventChar = [theEvent firstCharacter]; @@ -56,10 +56,10 @@ NSUInteger modifiers = [theEvent deviceIndependentModifierFlags] & ~NSEventModifierFlagCapsLock; NSUInteger standardModifiers = modifiers & ~NSEventModifierFlagNumericPad & ~NSEventModifierFlagFunction; - if ((eventChar == NSNewlineCharacter || eventChar == NSEnterCharacter || eventChar == NSCarriageReturnCharacter) && modifiers == 0 && [self doubleClickAction]) { - [self tryToPerform:[self doubleClickAction] with:self]; - } else if (eventChar == 'p' && modifiers == 0 && [self singleClickAction]) { - [self tryToPerform:[self singleClickAction] with:self]; + if ((eventChar == NSNewlineCharacter || eventChar == NSEnterCharacter || eventChar == NSCarriageReturnCharacter) && modifiers == 0 && [self action]) { + [self tryToPerform:[self action] with:self]; + } else if (eventChar == 'p' && modifiers == 0 && [self performActionOnSingleClick]) { + [self tryToPerform:[self action] with:self]; } else if ((eventChar == NSDownArrowFunctionKey && standardModifiers == NSEventModifierFlagOption) || (eventChar == NSRightArrowFunctionKey && standardModifiers == NSEventModifierFlagCommand) || (eventChar == NSPageDownFunctionKey && standardModifiers == 0)) { [self tryToPerform:@selector(doGoToNextPage:) with:self]; } else if ((eventChar == NSUpArrowFunctionKey && standardModifiers == NSEventModifierFlagOption) || (eventChar == NSLeftArrowFunctionKey && standardModifiers == NSEventModifierFlagCommand) || (eventChar == NSPageUpFunctionKey && standardModifiers == 0)) { @@ -113,7 +113,7 @@ } - (void)mouseDown:(NSEvent *)theEvent { - SEL action = [theEvent clickCount] == 1 ? [self singleClickAction] : [theEvent clickCount] == 2 ? [self doubleClickAction] : NULL; + SEL action = (([theEvent clickCount] == 1 && [self performActionOnSingleClick]) || [theEvent clickCount] == 2) ? [self action] : NULL; if (action && [NSApp willDragMouse]) action = NULL; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-05-29 14:36:09
|
Revision: 15321 http://sourceforge.net/p/skim-app/code/15321 Author: hofman Date: 2025-05-29 14:36:01 +0000 (Thu, 29 May 2025) Log Message: ----------- use tryToPerform:with: to forward cancelOperation: Modified Paths: -------------- trunk/SKFullScreenWindow.m Modified: trunk/SKFullScreenWindow.m =================================================================== --- trunk/SKFullScreenWindow.m 2025-05-29 14:06:58 UTC (rev 15320) +++ trunk/SKFullScreenWindow.m 2025-05-29 14:36:01 UTC (rev 15321) @@ -62,8 +62,7 @@ - (void)cancelOperation:(id)sender { // for some reason this action method is not passed on to the window controller, so we do this ourselves - if ([[self windowController] respondsToSelector:_cmd]) - [[self windowController] cancelOperation:self]; + [[self windowController] tryToPerform:_cmd with:self]; } @end This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-05-29 14:07:03
|
Revision: 15320 http://sourceforge.net/p/skim-app/code/15320 Author: hofman Date: 2025-05-29 14:06:58 +0000 (Thu, 29 May 2025) Log Message: ----------- Handle cancelOperation: in presentation view for some cases Modified Paths: -------------- trunk/SKMainWindowController_Actions.m trunk/SKPresentationView.h trunk/SKPresentationView.m Modified: trunk/SKMainWindowController_Actions.m =================================================================== --- trunk/SKMainWindowController_Actions.m 2025-05-29 09:27:56 UTC (rev 15319) +++ trunk/SKMainWindowController_Actions.m 2025-05-29 14:06:58 UTC (rev 15320) @@ -1277,23 +1277,12 @@ } - (void)cancelOperation:(id)sender { - // passed on from SKSideWindow or SKFullScreenWindow - if ([self interactionMode] == SKPresentationMode) { - if ([self leftSidePaneIsOpen]) - [self toggleLeftSidePane:sender]; - else if ([self hasOverview]) - [self hideOverviewAnimating:YES]; - else if ([presentationView hasBlackout]) - [presentationView toggleBlackout:sender]; - else if ([presentationView showingCursorStyleWindow]) - [presentationView closeCursorStyleWindow:sender]; - else - [self exitPresentation]; - } else if ([self hasOverview]) { + if ([self hasOverview]) [self hideOverviewAnimating:YES]; - } else if ([self canExitFullscreen]) { + else if ([self canExitPresentation]) + [self exitPresentation]; + else if ([self canExitFullscreen]) [self exitFullscreen]; - } } - (void)scrollUp:(id)sender { Modified: trunk/SKPresentationView.h =================================================================== --- trunk/SKPresentationView.h 2025-05-29 09:27:56 UTC (rev 15319) +++ trunk/SKPresentationView.h 2025-05-29 14:06:58 UTC (rev 15320) @@ -99,12 +99,8 @@ @property (nonatomic) BOOL removeCursorShadow; @property (nonatomic) BOOL drawInPresentation; -@property (nonatomic) BOOL showingCursorStyleWindow; - - (void)toggleAutoActualSize:(nullable id)sender; -- (void)toggleBlackout:(nullable id)sender; - - (void)exitPresentation:(nullable id)sender; - (void)showCursorStyleWindow:(nullable id)sender; Modified: trunk/SKPresentationView.m =================================================================== --- trunk/SKPresentationView.m 2025-05-29 09:27:56 UTC (rev 15319) +++ trunk/SKPresentationView.m 2025-05-29 14:06:58 UTC (rev 15320) @@ -418,7 +418,7 @@ @implementation SKPresentationView -@dynamic autoScales, cursorStyle, hasBlackout, removeCursorShadow, drawInPresentation, showingCursorStyleWindow; +@dynamic autoScales, cursorStyle, hasBlackout, removeCursorShadow, drawInPresentation; + (void)initialize { SKINITIALIZE; @@ -635,10 +635,6 @@ return pvFlags.enableDrawing; } -- (BOOL)showingCursorStyleWindow { - return [cursorWindow isVisible]; -} - #pragma mark Actions - (void)toggleAutoActualSize:(id)sender { @@ -701,6 +697,21 @@ [[NSUserDefaults standardUserDefaults] setBool:NO == pvFlags.enableDrawing forKey:SKDisableDrawingInPresentationKey]; } +- (void)cancelOperation:(id)sender { + for (NSWindow *window in [[self window] childWindows]) { + if (window != navWindow && window != cursorWindow) { + [self tryToPerform:@selector(toggleLeftSidePane:) with:sender]; + return; + } + } + if ([self hasBlackout]) + [self toggleBlackout:sender]; + else if ([cursorWindow isVisible]) + [self closeCursorStyleWindow:sender]; + else + [[self window] tryToPerform:_cmd with:sender]; +} + - (BOOL)validateMenuItem:(NSMenuItem *)menuItem { if ([menuItem action] == @selector(goToNextPage:)) return [self canGoToNextPage]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-05-29 09:28:01
|
Revision: 15319 http://sourceforge.net/p/skim-app/code/15319 Author: hofman Date: 2025-05-29 09:27:56 +0000 (Thu, 29 May 2025) Log Message: ----------- recalculate keyviewloop after showing or hiding overview Modified Paths: -------------- trunk/SKMainWindowController.m Modified: trunk/SKMainWindowController.m =================================================================== --- trunk/SKMainWindowController.m 2025-05-29 09:16:45 UTC (rev 15318) +++ trunk/SKMainWindowController.m 2025-05-29 09:27:56 UTC (rev 15319) @@ -1649,6 +1649,7 @@ [NSLayoutConstraint activateConstraints:constraints]; } completionHandler:^{ + [[self window] recalculateKeyViewLoop]; [touchBarController overviewChanged]; }]; } else { @@ -1690,6 +1691,7 @@ [NSLayoutConstraint activateConstraints:constraints]; } completionHandler:^{ + [[self window] recalculateKeyViewLoop]; [touchBarController overviewChanged]; [noteToolbarController validateButtons]; [[newKeyView window] makeFirstResponder:newKeyView]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-05-29 09:16:48
|
Revision: 15318 http://sourceforge.net/p/skim-app/code/15318 Author: hofman Date: 2025-05-29 09:16:45 +0000 (Thu, 29 May 2025) Log Message: ----------- Don't override nextResponder in side window, actions should reach the window controller through the main window. Implement cancelOperation by sending toggleLeftSidePane: to parent window's windowController. Modified Paths: -------------- trunk/SKSideWindow.m Modified: trunk/SKSideWindow.m =================================================================== --- trunk/SKSideWindow.m 2025-05-28 14:29:30 UTC (rev 15317) +++ trunk/SKSideWindow.m 2025-05-29 09:16:45 UTC (rev 15318) @@ -44,6 +44,7 @@ #import "NSColor_SKExtensions.h" #import "NSView_SKExtensions.h" #import "NSImage_SKExtensions.h" +#import "SKMainWindowController_Actions.h" #define DEFAULT_WINDOW_WIDTH 300.0 #define DEFAULT_WINDOW_HEIGHT 400.0 @@ -163,20 +164,14 @@ - (void)keyDown:(NSEvent *)theEvent { if ([theEvent firstCharacter] == 't' && [theEvent deviceIndependentModifierFlags] == 0) - [self cancelOperation:self]; + [[[self parentWindow] windowController] tryToPerform:@selector(toggleLeftSidePane:) with:self]; else [super keyDown:theEvent]; } - (void)cancelOperation:(id)sender { - // for some reason this action method is not passed on up the responder chain, so we do this ourselves - if ([[self nextResponder] respondsToSelector:@selector(cancelOperation:)]) - [[self nextResponder] cancelOperation:self]; + [[[self parentWindow] windowController] tryToPerform:@selector(toggleLeftSidePane:) with:self]; } - -- (NSResponder *)nextResponder { - return [[self parentWindow] windowController]; -} - (void)resizeWithEvent:(NSEvent *)theEvent { NSPoint initialLocation = [theEvent locationOnScreen]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-05-28 14:29:33
|
Revision: 15317 http://sourceforge.net/p/skim-app/code/15317 Author: hofman Date: 2025-05-28 14:29:30 +0000 (Wed, 28 May 2025) Log Message: ----------- No need for presentation wwindow to be a subclass of SKMainWindow. Implement rightMouseDown: instead of intercepting riht mouse down events. Modified Paths: -------------- trunk/SKFullScreenWindow.h trunk/SKFullScreenWindow.m trunk/SKMainWindowController_FullScreen.m trunk/SKPresentationView.m Modified: trunk/SKFullScreenWindow.h =================================================================== --- trunk/SKFullScreenWindow.h 2025-05-28 09:39:56 UTC (rev 15316) +++ trunk/SKFullScreenWindow.h 2025-05-28 14:29:30 UTC (rev 15317) @@ -37,19 +37,13 @@ */ #import <Cocoa/Cocoa.h> -#import "SKMainWindow.h" NS_ASSUME_NONNULL_BEGIN -@interface SKFullScreenWindow : SKMainWindow +@interface SKFullScreenWindow : NSWindow - (instancetype)initWithContentRect:(NSRect)contentRect; @end - -@interface NSWindowController (SKMainFullScreenWindow) -- (BOOL)handleRightMouseDown:(NSEvent *)theEvent; -@end - NS_ASSUME_NONNULL_END Modified: trunk/SKFullScreenWindow.m =================================================================== --- trunk/SKFullScreenWindow.m 2025-05-28 09:39:56 UTC (rev 15316) +++ trunk/SKFullScreenWindow.m 2025-05-28 14:29:30 UTC (rev 15317) @@ -52,7 +52,6 @@ [self setFrame:contentRect display:NO]; [self setAnimationBehavior:NSWindowAnimationBehaviorNone]; [self setCollectionBehavior:NSWindowCollectionBehaviorManaged]; - [[self contentView] setWantsLayer:YES]; } return self; } @@ -61,17 +60,9 @@ - (BOOL)canBecomeMainWindow { return YES; } -- (void)sendEvent:(NSEvent *)theEvent { - if ([theEvent type] == NSEventTypeRightMouseDown || ([theEvent type] == NSEventTypeLeftMouseDown && ([theEvent modifierFlags] & NSEventModifierFlagControl))) { - if ([[self windowController] respondsToSelector:@selector(handleRightMouseDown:)] && [[self windowController] handleRightMouseDown:theEvent]) - return; - } - [super sendEvent:theEvent]; -} - - (void)cancelOperation:(id)sender { // for some reason this action method is not passed on to the window controller, so we do this ourselves - if ([[self windowController] respondsToSelector:@selector(cancelOperation:)]) + if ([[self windowController] respondsToSelector:_cmd]) [[self windowController] cancelOperation:self]; } Modified: trunk/SKMainWindowController_FullScreen.m =================================================================== --- trunk/SKMainWindowController_FullScreen.m 2025-05-28 09:39:56 UTC (rev 15316) +++ trunk/SKMainWindowController_FullScreen.m 2025-05-28 14:29:30 UTC (rev 15317) @@ -145,14 +145,6 @@ #pragma mark Presentation Support Methods -- (BOOL)handleRightMouseDown:(NSEvent *)theEvent { - if ([self interactionMode] == SKPresentationMode) { - [self doGoToPreviousPage:nil]; - return YES; - } - return NO; -} - - (void)showNotesForPresentationWindow:(NSWindow *)window { PDFDocument *pdfDoc = [[self presentationNotesDocument] pdfDocument]; NSInteger offset = [self presentationNotesOffset]; Modified: trunk/SKPresentationView.m =================================================================== --- trunk/SKPresentationView.m 2025-05-28 09:39:56 UTC (rev 15316) +++ trunk/SKPresentationView.m 2025-05-28 14:29:30 UTC (rev 15317) @@ -806,6 +806,10 @@ } } +- (void)rightMouseDown:(NSEvent *)theEvent { + [self goToPreviousPage:nil]; +} + - (void)mouseMoved:(NSEvent *)theEvent { pvFlags.cursorHidden = NO; [self setCursorForMouse:theEvent]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |