Skip to content

Commit

Permalink
made the Flash logo and the gear button more visible on dark backgrounds
Browse files Browse the repository at this point in the history
  • Loading branch information
Simone Manganelli authored and Simone Manganelli committed Aug 23, 2009
1 parent ebe20e9 commit d870653
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions Plugin/Plugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -891,7 +891,7 @@ - (void) _drawBadgeWithPressed: (BOOL) pressed

CGContextRef context = [ [ NSGraphicsContext currentContext ] graphicsPort ];

CGContextSetAlpha( context, pressed ? 0.40 : 0.25 );
CGContextSetAlpha( context, pressed ? 0.50 : 0.35 );
CGContextBeginTransparencyLayer( context, nil );

// Draw everything at full size, centered on the origin.
Expand All @@ -900,14 +900,25 @@ - (void) _drawBadgeWithPressed: (BOOL) pressed
NSRect borderRect = NSMakeRect( loc.x - kFrameXInset, loc.y - kFrameYInset, w, h );

NSBezierPath* fillPath = bezierPathWithRoundedRectCornerRadius( NSInsetRect( borderRect, -2, -2 ), 6 );
[ [ NSColor colorWithCalibratedWhite: 1.0 alpha: 0.25 ] set ];
[ [ NSColor colorWithCalibratedWhite: 1.0 alpha: 0.45 ] set ];
[ fillPath fill ];

NSUInteger thickLineWidth = 5;
NSBezierPath* path = bezierPathWithRoundedRectCornerRadius( borderRect, 4 );
[ [ NSColor blackColor ] set ];
[ path setLineWidth: 3 ];
[ path setLineWidth: thickLineWidth ];
[ path stroke ];

NSUInteger thinLineWidth = 2;
NSRect thinBorderRect = NSMakeRect( loc.x - kFrameXInset - thickLineWidth/4,
loc.y - kFrameYInset - thickLineWidth/4,
w + thickLineWidth/2,
h + thickLineWidth/2);
NSBezierPath* thinPath = bezierPathWithRoundedRectCornerRadius( thinBorderRect, 4 );
[ [ NSColor whiteColor ] set ];
[ thinPath setLineWidth: thinLineWidth ];
[ thinPath stroke ];

[ str drawAtPoint: loc withAttributes: attrs ];

// Now restore the graphics state:
Expand Down

0 comments on commit d870653

Please sign in to comment.