Revision: 15078
          http://sourceforge.net/p/skim-app/code/15078
Author:   hofman
Date:     2025-04-03 21:33:36 +0000 (Thu, 03 Apr 2025)
Log Message:
-----------
update text color in font panel when text color changes

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

Modified: trunk/SKFontWell.m
===================================================================
--- trunk/SKFontWell.m  2025-04-03 17:24:08 UTC (rev 15077)
+++ trunk/SKFontWell.m  2025-04-03 21:33:36 UTC (rev 15078)
@@ -180,6 +180,8 @@
     [nc postNotificationName:SKFontWellWillBecomeActiveNotification 
object:self];
     
     [fm setSelectedFont:[self font] isMultiple:NO];
+    if ([self hasTextColor])
+        [fm setSelectedAttributes:@{NSForegroundColorAttributeName: [self 
textColor]} isMultiple:NO];
     [fm orderFrontFontPanel:self];
     
     [nc addObserver:self selector:@selector(fontWellWillBecomeActive:)
@@ -205,6 +207,12 @@
     NSAccessibilityPostNotification([self cell], 
NSAccessibilityValueChangedNotification);
 }
 
+- (void)textColorChanged {
+    if ([self isActive])
+        [[NSFontManager sharedFontManager] 
setSelectedAttributes:@{NSForegroundColorAttributeName: [self textColor]} 
isMultiple:NO];
+    [self setNeedsDisplay:YES];
+}
+
 - (void)propagateValue:(id)value forBinding:(NSString *)binding {
     updatedBinding = binding;
     [super propagateValue:value forBinding:binding];
@@ -246,7 +254,7 @@
     BOOL didChange = [[self textColor] isEqual:newTextColor] == NO;
     [[self cell] setTextColor:newTextColor];
     if (didChange)
-        [self setNeedsDisplay:YES];
+        [self textColorChanged];
 }
 
 - (BOOL)hasTextColor {

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