load the status bar background in the init method, because awakeFromNib drew the back with a white background on launch

This commit is contained in:
Mitchell Livingston
2007-11-07 00:35:03 +00:00
parent 4a301fdf82
commit 6253979516
2 changed files with 16 additions and 6 deletions

View File

@@ -3265,8 +3265,8 @@ void sleepCallBack(void * controller, io_service_t y, natural_t messageType, voi
NSRect oldFrame = [fSearchFilterField frame],
frame = NSMakeRect(pointX, oldFrame.origin.y, NSMaxX(oldFrame) - pointX, oldFrame.size.height);
BOOL show;
if (show = (frame.size.width >= SEARCH_FILTER_MIN_WIDTH))
BOOL show = frame.size.width >= SEARCH_FILTER_MIN_WIDTH;
if (show)
{
//make sure it is not too long
if (frame.size.width > SEARCH_FILTER_MAX_WIDTH)

View File

@@ -27,11 +27,21 @@
@implementation StatusBarView
- (void) awakeFromNib
- (id) initWithFrame: (NSRect) rect
{
NSColor * beginningColor = [NSColor colorWithCalibratedRed: 208.0/255.0 green: 208.0/255.0 blue: 208.0/255.0 alpha: 1.0];
NSColor * endingColor = [NSColor colorWithCalibratedRed: 233.0/255.0 green: 233.0/255.0 blue: 233.0/255.0 alpha: 1.0];
fGradient = [[CTGradient gradientWithBeginningColor: beginningColor endingColor: endingColor] retain];
if ((self = [super initWithFrame: rect]))
{
NSColor * beginningColor = [NSColor colorWithCalibratedRed: 208.0/255.0 green: 208.0/255.0 blue: 208.0/255.0 alpha: 1.0];
NSColor * endingColor = [NSColor colorWithCalibratedRed: 233.0/255.0 green: 233.0/255.0 blue: 233.0/255.0 alpha: 1.0];
fGradient = [[CTGradient gradientWithBeginningColor: beginningColor endingColor: endingColor] retain];
}
return self;
}
- (void) dealloc
{
[fGradient release];
[super dealloc];
}
- (BOOL) isOpaque