Revision: 15776
http://sourceforge.net/p/skim-app/code/15776
Author: hofman
Date: 2025-11-08 23:36:00 +0000 (Sat, 08 Nov 2025)
Log Message:
-----------
update side pane toolbar buttons when collapsed state changes, save state in
tag of button
Modified Paths:
--------------
trunk/SKMainToolbarController.m
Modified: trunk/SKMainToolbarController.m
===================================================================
--- trunk/SKMainToolbarController.m 2025-11-08 23:19:57 UTC (rev 15775)
+++ trunk/SKMainToolbarController.m 2025-11-08 23:36:00 UTC (rev 15776)
@@ -877,6 +877,8 @@
[item setView:leftPaneButton];
[item setMenuFormRepresentation:menuItem];
+ [leftPaneButton setTag:[mainController leftSidePaneIsOpen] == NO];
+
} else if ([identifier
isEqualToString:SKDocumentToolbarNotesPaneItemIdentifier]) {
menuItem = [[NSMenuItem alloc]
initWithTitle:NSLocalizedString(@"Notes Pane", @"Menu item title")
action:@selector(toggleRightSidePane:) target:mainController];
@@ -886,6 +888,8 @@
[item setView:rightPaneButton];
[item setMenuFormRepresentation:menuItem];
+ [rightPaneButton setTag:[mainController rightSidePaneIsOpen] ==
NO];
+
} else if ([identifier
isEqualToString:SKDocumentToolbarSplitPDFItemIdentifier]) {
menuItem = [[NSMenuItem alloc]
initWithTitle:NSLocalizedString(@"Notes Pane", @"Menu item title")
action:@selector(toggleSplitPDF:) target:mainController];
@@ -1116,10 +1120,13 @@
[item setToolTip:[mainController hasNoteToolbar] ?
NSLocalizedString(@"Hide Note Toolbar", @"Tool tip message") :
NSLocalizedString(@"Show Note Toolbar", @"Tool tip message")];
}
-- (void)updatePaneItemToolTips {
+- (void)leftSidePaneDidShowOrHide {
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];
+}
+
+- (void)rightSidePaneDidShowOrHide {
+ NSToolbarItem *item = [toolbarItems
objectForKey:SKDocumentToolbarNotesPaneItemIdentifier];
[item setToolTip:[mainController rightSidePaneIsOpen] ?
NSLocalizedString(@"Hide Notes Pane", @"Tool tip message") :
NSLocalizedString(@"Show Notes Pane", @"Tool tip message")];
}
@@ -1489,7 +1496,17 @@
}
- (void)handleSplitViewDidResizeSubviewsNotification:(NSNotification
*)notification {
- [self performSelectorOnce:@selector(updatePaneItemToolTips)
afterDelay:0.1];
+ NSSplitView *splitView = [notification object];
+ NSInteger isLeftSideViewCollapsed = [splitView
isSubviewCollapsed:[[splitView subviews] firstObject]];
+ NSInteger isRightSideViewCollapsed = [splitView
isSubviewCollapsed:[[splitView subviews] lastObject]];
+ if (isLeftSideViewCollapsed != [leftPaneButton tag]) {
+ [leftPaneButton setTag:isLeftSideViewCollapsed];
+ [self leftSidePaneDidShowOrHide];
+ }
+ if (isRightSideViewCollapsed != [rightPaneButton tag]) {
+ [rightPaneButton setTag:isRightSideViewCollapsed];
+ [self rightSidePaneDidShowOrHide];
+ }
}
- (void)registerForNotifications {
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