Revision: 12759
          http://sourceforge.net/p/skim-app/code/12759
Author:   hofman
Date:     2022-02-02 15:51:41 +0000 (Wed, 02 Feb 2022)
Log Message:
-----------
Add menu items for note auto sizing to Notes menu

Modified Paths:
--------------
    trunk/Base.lproj/MainMenu.xib
    trunk/SKMainWindowController_Actions.h
    trunk/SKMainWindowController_Actions.m
    trunk/SKMainWindowController_UI.m
    trunk/SKPDFView.h
    trunk/de.lproj/MainMenu.strings
    trunk/en.lproj/MainMenu.strings
    trunk/es.lproj/MainMenu.strings
    trunk/fr.lproj/MainMenu.strings
    trunk/it.lproj/MainMenu.strings
    trunk/ja.lproj/MainMenu.strings
    trunk/nl.lproj/MainMenu.strings
    trunk/pl.lproj/MainMenu.strings
    trunk/ru.lproj/MainMenu.strings
    trunk/zh_CN.lproj/MainMenu.strings
    trunk/zh_TW.lproj/MainMenu.strings

Modified: trunk/Base.lproj/MainMenu.xib
===================================================================
--- trunk/Base.lproj/MainMenu.xib       2022-02-02 10:29:12 UTC (rev 12758)
+++ trunk/Base.lproj/MainMenu.xib       2022-02-02 15:51:41 UTC (rev 12759)
@@ -564,14 +564,28 @@
                                 <modifierMask key="keyEquivalentModifierMask" 
command="YES"/>
                             </menuItem>
                             <menuItem title="Edit Note" id="691">
+                                <modifierMask key="keyEquivalentModifierMask"/>
                                 <connections>
                                     <action selector="editNote:" target="-1" 
id="692"/>
                                 </connections>
                             </menuItem>
+                            <menuItem title="Auto Size Note" id="SPb-oA-liH">
+                                <modifierMask key="keyEquivalentModifierMask"/>
+                                <connections>
+                                    <action selector="autoSizeNote:" 
target="-1" id="iVs-qE-Gfg"/>
+                                </connections>
+                            </menuItem>
+                            <menuItem title="Auto Size Note Unconstrained" 
tag="1" alternate="YES" id="pVh-3T-0lA">
+                                <modifierMask key="keyEquivalentModifierMask" 
option="YES"/>
+                                <connections>
+                                    <action selector="autoSizeNote:" 
target="-1" id="8sA-N6-OFa"/>
+                                </connections>
+                            </menuItem>
                             <menuItem isSeparatorItem="YES" id="781">
                                 <modifierMask key="keyEquivalentModifierMask" 
command="YES"/>
                             </menuItem>
                             <menuItem title="Hide Notes" id="782">
+                                <modifierMask key="keyEquivalentModifierMask"/>
                                 <connections>
                                     <action selector="toggleHideNotes:" 
target="-1" id="784"/>
                                 </connections>

Modified: trunk/SKMainWindowController_Actions.h
===================================================================
--- trunk/SKMainWindowController_Actions.h      2022-02-02 10:29:12 UTC (rev 
12758)
+++ trunk/SKMainWindowController_Actions.h      2022-02-02 15:51:41 UTC (rev 
12759)
@@ -50,6 +50,7 @@
 - (IBAction)alignCenter:(id)sender;
 - (IBAction)createNewNote:(id)sender;
 - (IBAction)editNote:(id)sender;
+- (IBAction)autoSizeNote:(id)sender;
 - (IBAction)toggleHideNotes:(id)sender;
 - (IBAction)takeSnapshot:(id)sender;
 - (IBAction)changeDisplaySinglePages:(id)sender;

Modified: trunk/SKMainWindowController_Actions.m
===================================================================
--- trunk/SKMainWindowController_Actions.m      2022-02-02 10:29:12 UTC (rev 
12758)
+++ trunk/SKMainWindowController_Actions.m      2022-02-02 15:51:41 UTC (rev 
12759)
@@ -266,6 +266,12 @@
     } else NSBeep();
 }
 
+- (IBAction)autoSizeNote:(id)sender{
+    if ([pdfView hideNotes] == NO) {
+        [pdfView autoSizeActiveAnnotation:sender];
+    } else NSBeep();
+}
+
 - (IBAction)toggleHideNotes:(id)sender{
     NSNumber *wasHidden = [NSNumber numberWithBool:[pdfView hideNotes]];
     [notes setValue:wasHidden forKey:@"shouldDisplay"];

Modified: trunk/SKMainWindowController_UI.m
===================================================================
--- trunk/SKMainWindowController_UI.m   2022-02-02 10:29:12 UTC (rev 12758)
+++ trunk/SKMainWindowController_UI.m   2022-02-02 15:51:41 UTC (rev 12759)
@@ -1636,10 +1636,13 @@
         return [self interactionMode] != SKPresentationMode && [self 
hasOverview] == NO && [[self pdfDocument] allowsNotes] && ([pdfView toolMode] 
== SKTextToolMode || [pdfView toolMode] == SKNoteToolMode) && [pdfView 
hideNotes] == NO;
     } else if (action == @selector(editNote:)) {
         PDFAnnotation *annotation = [pdfView activeAnnotation];
-        return [self interactionMode] != SKPresentationMode && [self 
hasOverview] == NO && [annotation isSkimNote] && ([annotation isEditable]);
+        return [self interactionMode] != SKPresentationMode && [self 
hasOverview] == NO && [annotation isSkimNote] && [annotation isEditable];
+    } else if (action == @selector(autoSizeNote:)) {
+        PDFAnnotation *annotation = [pdfView activeAnnotation];
+        return [self interactionMode] != SKPresentationMode && [self 
hasOverview] == NO && [annotation isSkimNote] && ([annotation isResizable] && 
[annotation isLine] == NO);
     } else if (action == @selector(alignLeft:) || action == 
@selector(alignRight:) || action == @selector(alignCenter:)) {
         PDFAnnotation *annotation = [pdfView activeAnnotation];
-        return [self interactionMode] != SKPresentationMode && [self 
hasOverview] == NO && [annotation isSkimNote] && ([annotation isEditable]) && 
[annotation isText];
+        return [self interactionMode] != SKPresentationMode && [self 
hasOverview] == NO && [annotation isSkimNote] && [annotation isEditable] && 
[annotation isText];
     } else if (action == @selector(toggleHideNotes:)) {
         if ([pdfView hideNotes])
             [menuItem setTitle:NSLocalizedString(@"Show Notes", @"Menu item 
title")];

Modified: trunk/SKPDFView.h
===================================================================
--- trunk/SKPDFView.h   2022-02-02 10:29:12 UTC (rev 12758)
+++ trunk/SKPDFView.h   2022-02-02 15:51:41 UTC (rev 12759)
@@ -230,6 +230,8 @@
 - (void)editThisAnnotation:(id)sender;
 - (void)editAnnotation:(PDFAnnotation *)annotation;
 
+- (void)autoSizeActiveAnnotation:(PDFAnnotation *)annotation;
+
 - (void)selectNextActiveAnnotation:(id)sender;
 - (void)selectPreviousActiveAnnotation:(id)sender;
 

Modified: trunk/de.lproj/MainMenu.strings
===================================================================
(Binary files differ)

Modified: trunk/en.lproj/MainMenu.strings
===================================================================
(Binary files differ)

Modified: trunk/es.lproj/MainMenu.strings
===================================================================
(Binary files differ)

Modified: trunk/fr.lproj/MainMenu.strings
===================================================================
(Binary files differ)

Modified: trunk/it.lproj/MainMenu.strings
===================================================================
(Binary files differ)

Modified: trunk/ja.lproj/MainMenu.strings
===================================================================
(Binary files differ)

Modified: trunk/nl.lproj/MainMenu.strings
===================================================================
(Binary files differ)

Modified: trunk/pl.lproj/MainMenu.strings
===================================================================
(Binary files differ)

Modified: trunk/ru.lproj/MainMenu.strings
===================================================================
(Binary files differ)

Modified: trunk/zh_CN.lproj/MainMenu.strings
===================================================================
(Binary files differ)

Modified: trunk/zh_TW.lproj/MainMenu.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