Revision: 14987
http://sourceforge.net/p/skim-app/code/14987
Author: hofman
Date: 2025-03-18 16:21:23 +0000 (Tue, 18 Mar 2025)
Log Message:
-----------
Don't use Toggle tool tips fo toolbar items, dynamically change tool tip to
Show or Hide
Modified Paths:
--------------
trunk/SKMainToolbarController.m
trunk/de.lproj/Localizable.strings
trunk/en.lproj/Localizable.strings
trunk/es.lproj/Localizable.strings
trunk/fr.lproj/Localizable.strings
trunk/it.lproj/Localizable.strings
trunk/ja.lproj/Localizable.strings
trunk/nl.lproj/Localizable.strings
trunk/pl.lproj/Localizable.strings
trunk/ru.lproj/Localizable.strings
trunk/zh_CN.lproj/Localizable.strings
trunk/zh_TW.lproj/Localizable.strings
Modified: trunk/SKMainToolbarController.m
===================================================================
--- trunk/SKMainToolbarController.m 2025-03-18 09:57:31 UTC (rev 14986)
+++ trunk/SKMainToolbarController.m 2025-03-18 16:21:23 UTC (rev 14987)
@@ -63,6 +63,7 @@
#import "SKShareMenuController.h"
#import "NSFont_SKExtensions.h"
#import "SKNoteToolbarController.h"
+#import "NSObject_SKExtensions.h"
#define SKDocumentToolbarIdentifier @"SKDocumentToolbar"
@@ -134,6 +135,8 @@
@interface SKMainToolbarController (SKPrivate)
- (void)handleColorSwatchFrameChangedNotification:(NSNotification
*)notification;
- (void)updateColorsMenu:(NSMenu *)menu;
+- (void)updatePaneItemToolTips;
+- (void)updateSplitPDFItemToolTips;
@end
@@ -526,7 +529,7 @@
menu = [menuItem submenu];
[item setLabels:NSLocalizedString(@"Notes", @"Toolbar item
label")];
- [item setToolTip:NSLocalizedString(@"Show Note Toolbar", @"Tool
tip message")];
+ [item setToolTip:[mainController hasNoteToolbar] ?
NSLocalizedString(@"Hide Note Toolbar", @"Tool tip message") :
NSLocalizedString(@"Show Note Toolbar", @"Tool tip message")];
[item setView:notesButton];
[item setMenuFormRepresentation:menuItem];
@@ -836,7 +839,7 @@
menuItem = [[NSMenuItem alloc]
initWithTitle:NSLocalizedString(@"Contents Pane", @"Menu item title")
action:@selector(toggleLeftSidePane:) target:mainController];
[item setLabels:NSLocalizedString(@"Contents Pane", @"Toolbar item
label")];
- [item setToolTip:NSLocalizedString(@"Toggle Contents Pane", @"Tool
tip message")];
+ [item setToolTip:[mainController leftSidePaneIsOpen] ?
NSLocalizedString(@"Hide Contents Pane", @"Tool tip message") :
NSLocalizedString(@"Show Contents Pane", @"Tool tip message")];
[item setView:leftPaneButton];
[item setMenuFormRepresentation:menuItem];
@@ -845,7 +848,7 @@
menuItem = [[NSMenuItem alloc]
initWithTitle:NSLocalizedString(@"Notes Pane", @"Menu item title")
action:@selector(toggleRightSidePane:) target:mainController];
[item setLabels:NSLocalizedString(@"Notes Pane", @"Toolbar item
label")];
- [item setToolTip:NSLocalizedString(@"Toggle Notes Pane", @"Tool
tip message")];
+ [item setToolTip:[mainController rightSidePaneIsOpen] ?
NSLocalizedString(@"Hide Notes Pane", @"Tool tip message") :
NSLocalizedString(@"Show Notes Pane", @"Tool tip message")];
[item setView:rightPaneButton];
[item setMenuFormRepresentation:menuItem];
@@ -854,7 +857,7 @@
menuItem = [[NSMenuItem alloc]
initWithTitle:NSLocalizedString(@"Notes Pane", @"Menu item title")
action:@selector(toggleSplitPDF:) target:mainController];
[item setLabels:NSLocalizedString(@"Split PDF", @"Toolbar item
label")];
- [item setToolTip:NSLocalizedString(@"Toggle Split PDF", @"Tool tip
message")];
+ [item setToolTip:[(NSView *)mainController.secondaryPdfView
window] ? NSLocalizedString(@"Hide Split PDF", @"Tool tip message") :
NSLocalizedString(@"Show Split PDF", @"Tool tip message")];
[item setView:splitPDFButton];
[item setMenuFormRepresentation:menuItem];
@@ -1079,9 +1082,20 @@
- (void)noteToolbarDidShowOrHide {
[notesButton setSelected:[mainController hasNoteToolbar] forSegment:0];
- [[toolbarItems objectForKey:SKDocumentToolbarNotesItemIdentifier]
setToolTip:[mainController hasNoteToolbar] ? NSLocalizedString(@"Hide Note
Toolbar", @"Tool tip message") : NSLocalizedString(@"Show Note Toolbar", @"Tool
tip message")];
}
+- (void)updatePaneItemToolTips {
+ NSToolbarItem *item = [toolbarItems
objectForKey:SKDocumentToolbarContentsPaneItemIdentifier];
+ [item setToolTip:[mainController leftSidePaneIsOpen] ?
NSLocalizedString(@"Hide Contents Pane", @"Tool tip message") :
NSLocalizedString(@"Show Contents Pane", @"Tool tip message")];
+ item = [toolbarItems
objectForKey:SKDocumentToolbarNotesPaneItemIdentifier];
+ [item setToolTip:[mainController rightSidePaneIsOpen] ?
NSLocalizedString(@"Hide Notes Pane", @"Tool tip message") :
NSLocalizedString(@"Show Notes Pane", @"Tool tip message")];
+}
+
+- (void)updateSplitPDFItemToolTips {
+ NSToolbarItem *item = [toolbarItems
objectForKey:SKDocumentToolbarSplitPDFItemIdentifier];
+ [item setToolTip:[(NSView *)mainController.secondaryPdfView window] ?
NSLocalizedString(@"Hide Split PDF", @"Tool tip message") :
NSLocalizedString(@"Show Split PDF", @"Tool tip message")];
+}
+
- (IBAction)goToPreviousNextFirstLastPage:(id)sender {
NSInteger tag = [sender selectedTag];
if (tag == -1)
@@ -1425,6 +1439,14 @@
[pacerButton setImage:[NSImage imageNamed:name] forSegment:0];
}
+- (void)handleSplitViewDidResizeSubviewsNotification:(NSNotification
*)notification {
+ [self performSelectorOnce:@selector(updatePaneItemToolTips)
afterDelay:0.1];
+}
+
+- (void)handlePDFSplitViewDidResizeSubviewsNotification:(NSNotification
*)notification {
+ [self performSelectorOnce:@selector(updateSplitPDFItemToolTips)
afterDelay:0.1];
+}
+
- (void)registerForNotifications {
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
@@ -1456,7 +1478,11 @@
name:PDFViewDisplayBoxChangedNotification
object:mainController.pdfView];
[nc addObserver:self selector:@selector(handleChangedHistoryNotification:)
name:PDFViewChangedHistoryNotification
object:mainController.pdfView];
-
+ [nc addObserver:self
selector:@selector(handleSplitViewDidResizeSubviewsNotification:)
+ name:NSSplitViewDidResizeSubviewsNotification
object:mainController.splitView];
+ [nc addObserver:self
selector:@selector(handlePDFSplitViewDidResizeSubviewsNotification:)
+ name:NSSplitViewDidResizeSubviewsNotification
object:mainController.pdfSplitView];
+
[self handleChangedHistoryNotification:nil];
[self handlePageChangedNotification:nil];
[self handleScaleChangedNotification:nil];
Modified: trunk/de.lproj/Localizable.strings
===================================================================
(Binary files differ)
Modified: trunk/en.lproj/Localizable.strings
===================================================================
(Binary files differ)
Modified: trunk/es.lproj/Localizable.strings
===================================================================
(Binary files differ)
Modified: trunk/fr.lproj/Localizable.strings
===================================================================
(Binary files differ)
Modified: trunk/it.lproj/Localizable.strings
===================================================================
(Binary files differ)
Modified: trunk/ja.lproj/Localizable.strings
===================================================================
(Binary files differ)
Modified: trunk/nl.lproj/Localizable.strings
===================================================================
(Binary files differ)
Modified: trunk/pl.lproj/Localizable.strings
===================================================================
(Binary files differ)
Modified: trunk/ru.lproj/Localizable.strings
===================================================================
(Binary files differ)
Modified: trunk/zh_CN.lproj/Localizable.strings
===================================================================
(Binary files differ)
Modified: trunk/zh_TW.lproj/Localizable.strings
===================================================================
(Binary files differ)
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