mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-24 03:19:06 +00:00
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:
parent
6aa7d5cdbe
commit
ec25a40565
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user