summaryrefslogtreecommitdiffstats
path: root/macosx/HBToolbarBadgedItem.m
diff options
context:
space:
mode:
authorDamiano Galassi <[email protected]>2018-07-10 20:06:09 +0200
committerDamiano Galassi <[email protected]>2018-07-10 20:06:09 +0200
commitf6a000f1c97f4aa0e4fc6f7751dc5bedb8e3a0bf (patch)
tree966d59d56302aae46ac334d0e2939058ed9ac0e4 /macosx/HBToolbarBadgedItem.m
parent44d7c56f5551c2b862811c70ae457fd5f2a5c797 (diff)
MacGui: remove a bunch of unneeded compatibility code.
Diffstat (limited to 'macosx/HBToolbarBadgedItem.m')
-rw-r--r--macosx/HBToolbarBadgedItem.m16
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