Revision: 15069 http://sourceforge.net/p/skim-app/code/15069 Author: hofman Date: 2025-04-02 09:35:29 +0000 (Wed, 02 Apr 2025) Log Message: ----------- There is no need for fontName and fontSize properties.
Modified Paths: -------------- trunk/SKFontWell.h trunk/SKFontWell.m Modified: trunk/SKFontWell.h =================================================================== --- trunk/SKFontWell.h 2025-04-01 09:05:47 UTC (rev 15068) +++ trunk/SKFontWell.h 2025-04-02 09:35:29 UTC (rev 15069) @@ -47,8 +47,6 @@ } @property (nonatomic, getter=isActive) BOOL active; -@property (nonatomic, copy) NSString *fontName; -@property (nonatomic) CGFloat fontSize; @property (nonatomic, nullable, copy) NSColor *textColor; @property (nonatomic) BOOL hasTextColor; Modified: trunk/SKFontWell.m =================================================================== --- trunk/SKFontWell.m 2025-04-01 09:05:47 UTC (rev 15068) +++ trunk/SKFontWell.m 2025-04-02 09:35:29 UTC (rev 15069) @@ -47,8 +47,6 @@ #define SKFontWellWillBecomeActiveNotification @"SKFontWellWillBecomeActiveNotification" -#define FONTNAME_KEY @"fontName" -#define FONTSIZE_KEY @"fontSize" #define TEXTCOLOR_KEY @"textColor" #define HASTEXTCOLOR_KEY @"hasTextColor" @@ -65,15 +63,8 @@ @implementation SKFontWell -@dynamic active, fontName, fontSize, textColor, hasTextColor; +@dynamic active, textColor, hasTextColor; -+ (NSSet *)keyPathsForValuesAffectingValueForKey:(NSString *)key { - NSSet *keyPaths = [super keyPathsForValuesAffectingValueForKey:key]; - if ([key isEqualToString:FONTNAME_KEY] || [key isEqualToString:FONTSIZE_KEY]) - keyPaths = [keyPaths setByAddingObjectsFromSet:[NSSet setWithObjects:FONT_KEY, nil]]; - return keyPaths; -} - + (Class)cellClass { return [SKFontWellCell class]; } @@ -206,7 +197,7 @@ - (void)fontChanged { if ([self isActive]) [[NSFontManager sharedFontManager] setSelectedFont:[self font] isMultiple:NO]; - [self setTitle:[NSString stringWithFormat:@"%@ %.0f", [[self font] displayName], [self fontSize]]]; + [self setTitle:[NSString stringWithFormat:@"%@ %.0f", [[self font] displayName], [[self font] pointSize]]]; [self setNeedsDisplay:YES]; NSAccessibilityPostNotification([self cell], NSAccessibilityValueChangedNotification); } @@ -242,26 +233,6 @@ [self fontChanged]; } -- (NSString *)fontName { - return [[self font] fontName]; -} - -- (void)setFontName:(NSString *)fontName { - NSFont *newFont = [NSFont fontWithName:fontName size:[[self font] pointSize]]; - if (newFont) - [self setFont:newFont]; -} - -- (CGFloat)fontSize { - return [[self font] pointSize]; -} - -- (void)setFontSize:(CGFloat)pointSize { - NSFont *newFont = [NSFont fontWithName:[[self font] fontName] size:pointSize]; - if (newFont) - [self setFont:newFont]; -} - - (NSColor *)textColor { return [[self cell] textColor]; } @@ -323,7 +294,7 @@ NSFontDescriptor *fontDescriptor = ([fontDescriptors isKindOfClass:[NSArray class]] && [fontDescriptors count]) ? [fontDescriptors objectAtIndex:0] : nil; if ([fontDescriptor isKindOfClass:[NSFontDescriptor class]]) { NSNumber *size = [[fontDescriptor fontAttributes] objectForKey:NSFontSizeAttribute] ?: [dict objectForKey:NSFontSizeAttribute]; - CGFloat fontSize = [size respondsToSelector:@selector(doubleValue)] ? [size doubleValue] : [self fontSize]; + CGFloat fontSize = [size respondsToSelector:@selector(doubleValue)] ? [size doubleValue] : [[self font] pointSize]; droppedFont = [NSFont fontWithDescriptor:fontDescriptor size:fontSize]; } } 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