Ticket #21407: patch-AKTableView-defaultFontSize.patch

File patch-AKTableView-defaultFontSize.patch, 637 bytes (added by mklein-de (Michael Klein), 14 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];