Revision: 14061
          http://sourceforge.net/p/skim-app/code/14061
Author:   hofman
Date:     2024-02-19 17:00:57 +0000 (Mon, 19 Feb 2024)
Log Message:
-----------
Update text note font preferences when changing font through panel while 
holding Shift

Modified Paths:
--------------
    trunk/SKMainWindowController_Actions.m

Modified: trunk/SKMainWindowController_Actions.m
===================================================================
--- trunk/SKMainWindowController_Actions.m      2024-02-19 16:34:36 UTC (rev 
14060)
+++ trunk/SKMainWindowController_Actions.m      2024-02-19 17:00:57 UTC (rev 
14061)
@@ -80,6 +80,7 @@
 #import "PDFSelection_SKExtensions.h"
 #import "SKOutlineView.h"
 #import "SKOverviewView.h"
+#import "NSUserDefaults_SKExtensions.h"
 
 #define STATUSBAR_HEIGHT 22.0
 
@@ -114,9 +115,14 @@
     PDFAnnotation *annotation = [pdfView currentAnnotation];
     if (mwcFlags.updatingFont == 0 && [self hasOverview] == NO && [annotation 
isSkimNote] && [annotation isText]) {
         NSFont *font = [sender convertFont:[annotation font]];
+        BOOL isShift = ([NSEvent standardModifierFlags] & 
NSEventModifierFlagShift) != 0;
         mwcFlags.updatingFont = 1;
         [annotation setFont:font];
         mwcFlags.updatingFont = 0;
+        if (isShift && [sender currentFontAction] == NSViaPanelFontAction) {
+            [[NSUserDefaults standardUserDefaults] setObject:[font fontName] 
forKey:SKFreeTextNoteFontNameKey];
+            [[NSUserDefaults standardUserDefaults] setDouble:[font pointSize] 
forKey:SKFreeTextNoteFontSizeKey];
+        }
     }
 }
 
@@ -126,9 +132,12 @@
         NSColor *color = [annotation fontColor];
         NSColor *newColor = [[sender convertAttributes:[NSDictionary 
dictionaryWithObjectsAndKeys:color, NSForegroundColorAttributeName, nil]] 
valueForKey:NSForegroundColorAttributeName];
         if ([newColor isEqual:color] == NO) {
+            BOOL isShift = ([NSEvent standardModifierFlags] & 
NSEventModifierFlagShift) != 0;
             mwcFlags.updatingFontAttributes = 1;
             [annotation setFontColor:newColor];
             mwcFlags.updatingFontAttributes = 0;
+            if (isShift)
+                [[NSUserDefaults standardUserDefaults] setColor:newColor 
forKey:SKFreeTextNoteFontColorKey];
         }
     }
 }

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

Reply via email to