Changeset 610


Ignore:
Timestamp:
Jul 16, 2006, 4:08:45 PM (16 years ago)
Author:
livings124
Message:

Better fonts for filter bar.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/BarButton.m

    r601 r610  
    108108- (void) setText: (NSString *) text
    109109{
    110     NSShadow * stringShadow = [[NSShadow alloc] init];
    111     [stringShadow setShadowOffset: NSMakeSize(1.0, -1.0)];
    112     [stringShadow setShadowBlurRadius: 1.0];
    113 
    114110    NSDictionary * normalAttributes = [[NSDictionary alloc] initWithObjectsAndKeys:
    115111                [NSColor blackColor], NSForegroundColorAttributeName,
    116                 [NSFont messageFontOfSize: 12.0], NSFontAttributeName,
    117                 stringShadow, NSShadowAttributeName, nil];
     112                [NSFont fontWithName: @"Helvetica" size: 12.0], NSFontAttributeName, nil];
     113   
    118114    NSDictionary * highlightedAttributes = [[NSDictionary alloc] initWithObjectsAndKeys:
    119115                [NSColor whiteColor], NSForegroundColorAttributeName,
    120                 [NSFont messageFontOfSize: 12.0], NSFontAttributeName,
    121                 stringShadow, NSShadowAttributeName, nil];
     116                [NSFont fontWithName: @"Helvetica Bold" size: 12.0], NSFontAttributeName, nil];
    122117   
    123     [stringShadow release];
     118    NSSize textSizeNormal = [text sizeWithAttributes: normalAttributes],
     119            textSizeBold = [text sizeWithAttributes: highlightedAttributes],
     120            buttonSize = [self frame].size;
    124121   
    125     NSSize textSize = [text sizeWithAttributes: normalAttributes],
    126             buttonSize = [self frame].size;
    127     NSRect textRect = NSMakeRect((buttonSize.width - textSize.width) * 0.5,
    128             (buttonSize.height - textSize.height) * 0.5 + 1.5, textSize.width, textSize.height);
     122    NSRect textRectNormal = NSMakeRect((buttonSize.width - textSizeNormal.width) * 0.5,
     123            (buttonSize.height - textSizeNormal.height) * 0.5 + 1.5, textSizeNormal.width, textSizeNormal.height),
     124        textRectBold = NSMakeRect((buttonSize.width - textSizeBold.width) * 0.5,
     125            (buttonSize.height - textSizeBold.height) * 0.5 + 1.5, textSizeBold.width, textSizeBold.height);
    129126   
    130127    //normal button
    131128    [fButtonNormal lockFocus];
    132     [text drawInRect: textRect withAttributes: normalAttributes];
     129    [text drawInRect: textRectNormal withAttributes: normalAttributes];
    133130    [fButtonNormal unlockFocus];
    134131   
    135132    //rolled over button
    136133    [fButtonOver lockFocus];
    137     [text drawInRect: textRect withAttributes: highlightedAttributes];
     134    [text drawInRect: textRectBold withAttributes: highlightedAttributes];
    138135    [fButtonOver unlockFocus];
    139136   
    140137    //pressed button
    141138    [fButtonPressed lockFocus];
    142     [text drawInRect: textRect withAttributes: highlightedAttributes];
     139    [text drawInRect: textRectBold withAttributes: highlightedAttributes];
    143140    [fButtonPressed unlockFocus];
    144141   
    145142    //selected button
    146143    [fButtonSelected lockFocus];
    147     [text drawInRect: textRect withAttributes: highlightedAttributes];
     144    [text drawInRect: textRectBold withAttributes: highlightedAttributes];
    148145    [fButtonSelected unlockFocus];
    149146   
Note: See TracChangeset for help on using the changeset viewer.