Draw the location bar using a textfield-style border, so that it matches the search field more closely (although the search field needs lightening up).

This commit is contained in:
sfraser%netscape.com 2003-04-13 17:44:49 +00:00
parent 6aa7d5cdbe
commit ec25a40565
2 changed files with 24 additions and 10 deletions

View File

@ -23,8 +23,11 @@
#import <AppKit/AppKit.h>
@interface LocationBar : NSView {
@interface LocationBar : NSView
{
// we'll use a cell to draw the border, since there isn't a method
// we can call to draw a nice bevel ourselves.
NSTextFieldCell* mBorderCell;
}
@end

View File

@ -40,17 +40,28 @@
@implementation LocationBar
- (void)drawRect:(NSRect)aRect
- (id)initWithFrame:(NSRect)frameRect
{
// Frame the border.
//NSDrawLightBezel([self bounds], aRect);
if ((self = [super initWithFrame:frameRect]))
{
mBorderCell = [[NSTextFieldCell alloc] initTextCell:@""];
[mBorderCell setBezeled:YES];
[[NSColor colorWithCalibratedWhite: 0.98 alpha: 1.0] set];
NSRectFill(aRect);
[[NSColor colorWithCalibratedWhite: 0.90 alpha: 1.0] set];
NSFrameRectWithWidth([self bounds], 2.0);
// For 10.2, we could do this, but we'd have to tweak the spacing for the proxy icon
//[mBorderCell setBezelStyle:NSTextFieldRoundedBezel];
}
return self;
}
- (void)dealloc
{
[mBorderCell release];
[super dealloc];
}
- (void)drawRect:(NSRect)aRect
{
[mBorderCell drawWithFrame:[self bounds] inView:self];
}
@end