Revision: 14968
http://sourceforge.net/p/skim-app/code/14968
Author: hofman
Date: 2025-03-13 16:28:06 +0000 (Thu, 13 Mar 2025)
Log Message:
-----------
Set subtitle of main window instead of modifyin the title on 11.0+
Modified Paths:
--------------
trunk/SKMainWindowController.h
trunk/SKMainWindowController.m
trunk/SKMainWindowController_FullScreen.m
trunk/SKMainWindowController_UI.m
Modified: trunk/SKMainWindowController.h
===================================================================
--- trunk/SKMainWindowController.h 2025-03-12 23:20:29 UTC (rev 14967)
+++ trunk/SKMainWindowController.h 2025-03-13 16:28:06 UTC (rev 14968)
@@ -326,6 +326,7 @@
- (NSDictionary<NSString *, id> *)currentPDFSettings;
- (void)applyOptions:(NSDictionary<NSString *, id> *)options;
+- (void)updateSubtitle;
- (void)updateLeftStatus;
- (void)updateRightStatus;
Modified: trunk/SKMainWindowController.m
===================================================================
--- trunk/SKMainWindowController.m 2025-03-12 23:20:29 UTC (rev 14967)
+++ trunk/SKMainWindowController.m 2025-03-13 16:28:06 UTC (rev 14968)
@@ -677,6 +677,17 @@
#pragma mark UI updating
+- (void)updateSubtitle {
+ if (@available(macOS 11.0, *)) {
+ if ([pdfView document])
+ [[self window] setSubtitle:[NSString
stringWithFormat:NSLocalizedString(@"Page %ld of %ld", @"Status message"),
(long)([[[self pdfView] currentPage] pageIndex] + 1), (long)[[pdfView document]
pageCount]]];
+ else
+ [[self window] setSubtitle:@""];
+ } else {
+ [self synchronizeWindowTitleWithDocumentName];
+ }
+}
+
- (void)updateLeftStatus {
NSString *message = [NSString stringWithFormat:NSLocalizedString(@"Page
%ld of %ld", @"Status message"), (long)([[[self pdfView] currentPage]
pageIndex] + 1), (long)[[pdfView document] pageCount]];
[[statusBar leftField] setStringValue:message];
Modified: trunk/SKMainWindowController_FullScreen.m
===================================================================
--- trunk/SKMainWindowController_FullScreen.m 2025-03-12 23:20:29 UTC (rev
14967)
+++ trunk/SKMainWindowController_FullScreen.m 2025-03-13 16:28:06 UTC (rev
14968)
@@ -525,7 +525,7 @@
}];
// the page number may have changed
- [self synchronizeWindowTitleWithDocumentName];
+ [self updateSubtitle];
}
- (BOOL)canEnterFullscreen {
Modified: trunk/SKMainWindowController_UI.m
===================================================================
--- trunk/SKMainWindowController_UI.m 2025-03-12 23:20:29 UTC (rev 14967)
+++ trunk/SKMainWindowController_UI.m 2025-03-13 16:28:06 UTC (rev 14968)
@@ -231,10 +231,9 @@
#pragma mark NSWindow delegate protocol
- (NSString *)windowTitleForDocumentDisplayName:(NSString *)displayName {
- if ([pdfView document])
+ if (@available(macOS 11.0, *)) {} else if ([pdfView document])
return [NSString stringWithFormat:NSLocalizedString(@"%@ (page %ld of
%ld)", @"Window title format"), displayName, (long)([[[self pdfView]
currentPage] pageIndex] + 1), (long)[[pdfView document] pageCount]];
- else
- return displayName;
+ return displayName;
}
- (void)windowDidBecomeMain:(NSNotification *)notification {
@@ -2004,7 +2003,7 @@
if (beforeMarkedPage.pageIndex != NSNotFound && [[pdfView currentPage]
pageIndex] != markedPage.pageIndex)
beforeMarkedPage.pageIndex = NSNotFound;
- [self synchronizeWindowTitleWithDocumentName];
+ [self updateSubtitle];
[self updateLeftStatus];
if ([[NSUserDefaults standardUserDefaults]
boolForKey:SKDisplayPageBoundsKey])
[self updateRightStatus];
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit