Ignore:
Timestamp:
May 14, 2012, 12:24:39 AM (9 years ago)
Author:
livings124
Message:

Make the "all" and "none" file check buttons localizable

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/InfoFileViewController.m

    r13296 r13297  
    6060   
    6161    [[fFileFilterField cell] setPlaceholderString: NSLocalizedString(@"Filter", "inspector -> file filter")];
     62   
     63    //localize and place all and none buttons
     64    [fCheckAllButton setTitle: NSLocalizedString(@"All", "inspector -> check all")];
     65    [fUncheckAllButton setTitle: NSLocalizedString(@"None", "inspector -> check all")];
     66   
     67    CGRect checkAllFrame = [fCheckAllButton frame];
     68    CGRect uncheckAllFrame = [fUncheckAllButton frame];
     69    const CGFloat oldAllWidth = checkAllFrame.size.width;
     70    const CGFloat oldNoneWidth = uncheckAllFrame.size.width;
     71   
     72    [fCheckAllButton sizeToFit];
     73    [fUncheckAllButton sizeToFit];
     74    const CGFloat newWidth = MAX([fCheckAllButton bounds].size.width, [fUncheckAllButton bounds].size.width);
     75   
     76    const CGFloat uncheckAllChange = newWidth - oldNoneWidth;
     77    uncheckAllFrame.size.width = newWidth;
     78    uncheckAllFrame.origin.x -= uncheckAllChange;
     79    [fUncheckAllButton setFrame: uncheckAllFrame];
     80   
     81    const CGFloat checkAllChange = newWidth - oldAllWidth;
     82    checkAllFrame.size.width = newWidth;
     83    checkAllFrame.origin.x -= (checkAllChange + uncheckAllChange);
     84    [fCheckAllButton setFrame: checkAllFrame];
    6285}
    6386
Note: See TracChangeset for help on using the changeset viewer.