Revision: 14873
          http://sourceforge.net/p/skim-app/code/14873
Author:   hofman
Date:     2025-01-25 10:56:02 +0000 (Sat, 25 Jan 2025)
Log Message:
-----------
contextual menu for status bar for preferences to display note or page bounds

Modified Paths:
--------------
    trunk/SKMainWindowController.m
    trunk/SKMainWindowController_Actions.h
    trunk/SKMainWindowController_Actions.m
    trunk/SKMainWindowController_UI.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/SKMainWindowController.m
===================================================================
--- trunk/SKMainWindowController.m      2025-01-25 10:28:59 UTC (rev 14872)
+++ trunk/SKMainWindowController.m      2025-01-25 10:56:02 UTC (rev 14873)
@@ -352,6 +352,12 @@
     if ([sud boolForKey:SKShowStatusBarKey] == NO)
         [self toggleStatusBar:nil];
     
+    NSMenu *menu = [[NSMenu alloc] init];
+    [menu addItemWithTitle:NSLocalizedString(@"Display note size", @"Menu item 
title") action:@selector(toggleDisplayNoteBounds:) target:self];
+    [menu addItemWithTitle:NSLocalizedString(@"Display page size", @"Menu item 
title") action:@selector(toggleDisplayPageBounds:) target:self];
+    
+    [statusBar setMenu:menu];
+
     NSInteger windowSizeOption = [sud 
integerForKey:SKInitialWindowSizeOptionKey];
     if (hasWindowSetup) {
         NSString *rectString = [savedNormalSetup 
objectForKey:MAINWINDOWFRAME_KEY];
@@ -458,7 +464,7 @@
     noteTypeSheetController = [[SKNoteTypeSheetController alloc] init];
     [noteTypeSheetController setDelegate:self];
     
-    NSMenu *menu = [[rightSideController.noteOutlineView headerView] menu];
+    menu = [[rightSideController.noteOutlineView headerView] menu];
     [menu addItem:[NSMenuItem separatorItem]];
     [[menu addItemWithTitle:NSLocalizedString(@"Note Type", @"Menu item 
title") action:NULL keyEquivalent:@""] setSubmenu:[noteTypeSheetController 
noteTypeMenu]];
     

Modified: trunk/SKMainWindowController_Actions.h
===================================================================
--- trunk/SKMainWindowController_Actions.h      2025-01-25 10:28:59 UTC (rev 
14872)
+++ trunk/SKMainWindowController_Actions.h      2025-01-25 10:56:02 UTC (rev 
14873)
@@ -134,6 +134,8 @@
 - (void)goToSelectedOutlineItem:(nullable id)sender;
 - (void)goToSelectedFindResults:(nullable id)sender;
 - (void)toggleSelectedSnapshots:(nullable id)sender;
+- (void)toggleDisplayNoteBounds:(nullable id)sender;
+- (void)toggleDisplayPageBounds:(nullable id)sender;
 
 @end
 

Modified: trunk/SKMainWindowController_Actions.m
===================================================================
--- trunk/SKMainWindowController_Actions.m      2025-01-25 10:28:59 UTC (rev 
14872)
+++ trunk/SKMainWindowController_Actions.m      2025-01-25 10:56:02 UTC (rev 
14873)
@@ -1161,6 +1161,16 @@
     [sud setInteger:value forKey:SKDisableUpdateContentsFromEnclosedTextKey];
 }
 
+- (void)toggleDisplayNoteBounds:(nullable id)sender {
+    NSUserDefaults *sud = [NSUserDefaults standardUserDefaults];
+    [sud setBool:NO == [sud boolForKey:SKDisplayNoteBoundsKey] 
forKey:SKDisplayNoteBoundsKey];
+}
+
+- (void)toggleDisplayPageBounds:(nullable id)sender {
+    NSUserDefaults *sud = [NSUserDefaults standardUserDefaults];
+    [sud setBool:NO == [sud boolForKey:SKDisplayPageBoundsKey] 
forKey:SKDisplayPageBoundsKey];
+}
+
 - (IBAction)performFindPanelAction:(id)sender {
     if ([self interactionMode] == SKPresentationMode) {
         NSBeep();

Modified: trunk/SKMainWindowController_UI.m
===================================================================
--- trunk/SKMainWindowController_UI.m   2025-01-25 10:28:59 UTC (rev 14872)
+++ trunk/SKMainWindowController_UI.m   2025-01-25 10:56:02 UTC (rev 14873)
@@ -1957,6 +1957,12 @@
     } else if (action == @selector(centerSelectionInVisibleArea:)) {
         return [self interactionMode] != SKPresentationMode &&
                [[pdfView currentSelection] hasCharacters];
+    } else if (action == @selector(toggleDisplayNoteBounds:)) {
+        [menuItem setState:[[NSUserDefaults standardUserDefaults] 
boolForKey:SKDisplayNoteBoundsKey] ? NSControlStateValueOn : 
NSControlStateValueOff];
+        return YES;
+    } else if (action == @selector(toggleDisplayPageBounds:)) {
+        [menuItem setState:[[NSUserDefaults standardUserDefaults] 
boolForKey:SKDisplayPageBoundsKey] ? NSControlStateValueOn : 
NSControlStateValueOff];
+        return YES;
     }
     return YES;
 }

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
Skim-app-commit@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to