New Ticket     Wiki     Browse Source     Timeline     Roadmap     Ticket Reports     Search

Ticket #21407: patch-AKTableView-defaultFontSize.patch

File patch-AKTableView-defaultFontSize.patch, 0.6 KB (added by michael.klein@…, 2 years ago)

Patch to replace deprecated [NSFont defaultLineHeightForFont]

  • CustomViews/AKTableView.m

    old new  
    2222    int fontSize = 
    2323        [AKPrefUtils intValueForPref:AKListFontSizePrefName]; 
    2424    NSFont *font = [NSFont fontWithName:fontName size:fontSize]; 
    25     int newRowHeight = round([font defaultLineHeightForFont] + 1.0); 
     25    NSLayoutManager * lm = [[NSLayoutManager alloc] init]; 
     26    int newRowHeight = round([lm defaultLineHeightForFont:font] + 1.0); 
     27    [lm release]; 
    2628 
    2729    [[[[self tableColumns] objectAtIndex:0] dataCell] setFont:font]; 
    2830    [self setRowHeight:newRowHeight];