Revision: 26407
          http://sourceforge.net/p/bibdesk/svn/26407
Author:   hofman
Date:     2021-07-12 16:06:05 +0000 (Mon, 12 Jul 2021)
Log Message:
-----------
Use demi font rather than bold font for required fields

Modified Paths:
--------------
    trunk/bibdesk/BDSKEditor.m

Modified: trunk/bibdesk/BDSKEditor.m
===================================================================
--- trunk/bibdesk/BDSKEditor.m  2021-07-12 15:42:44 UTC (rev 26406)
+++ trunk/bibdesk/BDSKEditor.m  2021-07-12 16:06:05 UTC (rev 26407)
@@ -3183,6 +3183,24 @@
 
 #pragma mark TableView delegate methods
 
+- (NSFont *)fieldNameFont {
+    static NSFont *fieldNameFont = nil;
+    if (fieldNameFont == nil) {
+        fieldNameFont = [[NSFont systemFontOfSize:0.0] retain];
+    }
+    return fieldNameFont;
+}
+
+- (NSFont *)defaultFieldNameFont {
+    static NSFont *defaultFieldNameFont = nil;
+    if (defaultFieldNameFont == nil) {
+        NSFontManager *fm = [NSFontManager sharedFontManager];
+        defaultFieldNameFont =
+        [[fm convertWeight:YES ofFont:[fm convertWeight:YES ofFont:[NSFont 
systemFontOfSize:0.0]]] retain];
+    }
+    return defaultFieldNameFont;
+}
+
 - (NSView *)tableView:(NSTableView *)tv viewForTableColumn:(NSTableColumn 
*)tableColumn row:(NSInteger)row {
     NSString *tcID = [tableColumn identifier];
     NSTableCellView *view = [tv makeViewWithIdentifier:tcID owner:self];
@@ -3193,7 +3211,7 @@
         if ([tcID isEqualToString:@"field"]) {
             value = [field localizedFieldName];
             BOOL isDefault = [[[BDSKTypeManager sharedManager] 
requiredFieldsForType:[publication pubType]] containsObject:field];
-            [textField setFont:isDefault ? [NSFont boldSystemFontOfSize:13.0] 
: [NSFont systemFontOfSize:13.0]];
+            [textField setFont:isDefault ? [self defaultFieldNameFont] : [self 
fieldNameFont]];
         } else {
             value = [publication valueOfField:field];
             NSFormatter *formatter = tableCellFormatter;
@@ -3397,13 +3415,11 @@
             NSInteger row, numberOfRows = [fields count];
             CGFloat width = [citeKeyTitle intrinsicContentSize].width + 4.0;
             NSArray *required = [[BDSKTypeManager sharedManager] 
requiredFieldsForType:[publication pubType]];
-            NSFont *font = [NSFont systemFontOfSize:13.0];
-            NSFont *boldFont = [NSFont boldSystemFontOfSize:13.0];
-
+            
             for (row = 0; row < numberOfRows; row++) {
                 NSString *field = [fields objectAtIndex:row];
                 [cell setObjectValue:[field localizedFieldName]];
-                [cell setFont:[required containsObject:field] ? boldFont : 
font];
+                [cell setFont:[required containsObject:field] ? [self 
defaultFieldNameFont] : [self fieldNameFont]];
                 width = fmax(width, ceil([cell cellSize].width));
             }
             [tableColumn setMinWidth:width];

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.



_______________________________________________
Bibdesk-commit mailing list
Bibdesk-commit@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit

Reply via email to