Revision: 15090
http://sourceforge.net/p/skim-app/code/15090
Author: hofman
Date: 2025-04-06 17:02:43 +0000 (Sun, 06 Apr 2025)
Log Message:
-----------
reset text color in font panel when deactivating a font wwell with text color
Modified Paths:
--------------
trunk/SKFontWell.m
Modified: trunk/SKFontWell.m
===================================================================
--- trunk/SKFontWell.m 2025-04-06 16:11:42 UTC (rev 15089)
+++ trunk/SKFontWell.m 2025-04-06 17:02:43 UTC (rev 15090)
@@ -164,10 +164,13 @@
- (void)changeActive:(id)sender {
if ([self isEnabled]) {
- if ([self isActive])
+ if ([self isActive]) {
[self activate];
- else
+ } else {
[self deactivate];
+ if ([self hasTextColor])
+ [[NSFontManager sharedFontManager]
setSelectedAttributes:@{NSForegroundColorAttributeName: [NSColor textColor]}
isMultiple:NO];
+ }
}
}
@@ -192,9 +195,12 @@
}
- (void)deactivate {
+ BOOL wasActive = [self isActive];
[[NSNotificationCenter defaultCenter] removeObserver:self];
[self setState:NSControlStateValueOff];
[self setNeedsDisplay:YES];
+ if (wasActive && [self hasTextColor])
+ [[NSFontManager sharedFontManager]
setSelectedAttributes:@{NSForegroundColorAttributeName: [NSColor textColor]}
isMultiple:NO];
}
- (void)fontChanged {
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