diff options
author | Damiano Galassi <[email protected]> | 2018-07-10 20:06:09 +0200 |
---|---|---|
committer | Damiano Galassi <[email protected]> | 2018-07-10 20:06:09 +0200 |
commit | f6a000f1c97f4aa0e4fc6f7751dc5bedb8e3a0bf (patch) | |
tree | 966d59d56302aae46ac334d0e2939058ed9ac0e4 /macosx/HBToolbarBadgedItem.m | |
parent | 44d7c56f5551c2b862811c70ae457fd5f2a5c797 (diff) |
MacGui: remove a bunch of unneeded compatibility code.
Diffstat (limited to 'macosx/HBToolbarBadgedItem.m')
-rw-r--r-- | macosx/HBToolbarBadgedItem.m | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/macosx/HBToolbarBadgedItem.m b/macosx/HBToolbarBadgedItem.m index dfce12f5b..bae3ab133 100644 --- a/macosx/HBToolbarBadgedItem.m +++ b/macosx/HBToolbarBadgedItem.m @@ -85,19 +85,6 @@ #pragma mark -- Private Methods -- (CGColorRef)copyNSColorToCGColor:(NSColor *)color -{ - // CGColor property of NSColor has been added only in 10.8, - // we need to support 10.7 too. - NSInteger numberOfComponents = [color numberOfComponents]; - CGFloat components[numberOfComponents]; - CGColorSpaceRef colorSpace = [[color colorSpace] CGColorSpace]; - [color getComponents:(CGFloat *)&components]; - CGColorRef cgColor = CGColorCreate(colorSpace, components); - - return cgColor; -} - - (void)HB_refreshBadge { if (_badgeValue.length) @@ -194,9 +181,8 @@ CGContextAddArcToPoint(context, maxx, maxy, midx, maxy, radius); CGContextAddArcToPoint(context, minx, maxy, minx, midy, radius); CGContextClosePath(context); - CGColorRef fillColor = [self copyNSColorToCGColor:_badgeFillColor]; + CGColorRef fillColor = _badgeFillColor.CGColor; CGContextSetFillColorWithColor(context,fillColor); - CFRelease(fillColor); CGContextDrawPath(context, kCGPathFill); // Draw the text |