Skip to content

Instantly share code, notes, and snippets.

@dchest
Created August 15, 2012 19:46
Show Gist options
  • Save dchest/3363006 to your computer and use it in GitHub Desktop.
Save dchest/3363006 to your computer and use it in GitHub Desktop.
CRTransparentSearchFieldCell -- transparent search field cell
#import <Cocoa/Cocoa.h>
@interface CRTransparentSearchFieldCell : NSSearchFieldCell
@end
#import "CRTransparentSearchFieldCell.h"
@implementation CRTransparentSearchFieldCell
- (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView {
// Draw border.
[[NSColor colorWithDeviceWhite:0 alpha:0.4] set];
[[NSBezierPath bezierPathWithRoundedRect:NSInsetRect(cellFrame, 0.5, 0.5)
xRadius:cellFrame.size.height/2.0
yRadius:cellFrame.size.height/2.0] stroke];
// Draw buttons and text.
[self drawInteriorWithFrame:cellFrame inView:controlView];
}
@end
@dchest
Copy link
Author

dchest commented Aug 15, 2012

Oops, there's a bug.

@dchest
Copy link
Author

dchest commented Aug 15, 2012

Fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment