summaryrefslogtreecommitdiffstats
path: root/macosx/HBHUDButtonCell.m
blob: a5e4119ec2f48c4b9f58be32bdcfe4b1e70350c9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/*  HBHUDButtonCell.m $

 This file is part of the HandBrake source code.
 Homepage: <http://handbrake.fr/>.
 It may be used under the terms of the GNU General Public License. */

#import "HBHUDButtonCell.h"

@implementation HBHUDButtonCell

- (NSRect)drawTitle:(NSAttributedString *)title withFrame:(NSRect)frame inView:(NSView *)controlView
{
    NSAttributedString *attrLabel = title;

    if (!NSClassFromString(@"NSVisualEffectView"))
    {
        attrLabel = [[NSAttributedString alloc] initWithString:[title string]
                                                                    attributes:@{ NSFontAttributeName:[NSFont systemFontOfSize:[NSFont systemFontSizeForControlSize:self.controlSize]],
                                                                                  NSForegroundColorAttributeName: [NSColor whiteColor]}];
    }

    return [super drawTitle:attrLabel withFrame:frame inView:controlView];
}

@end