From da676a0bf305c863f7dc2bf87159deaa1d684bb7 Mon Sep 17 00:00:00 2001 From: "sfraser%netscape.com" Date: Sun, 13 Apr 2003 17:44:49 +0000 Subject: [PATCH] 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). git-svn-id: svn://10.0.0.236/trunk@141101 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/camino/src/browser/LocationBar.h | 7 ++++-- mozilla/camino/src/browser/LocationBar.mm | 27 ++++++++++++++++------- 2 files changed, 24 insertions(+), 10 deletions(-) diff --git a/mozilla/camino/src/browser/LocationBar.h b/mozilla/camino/src/browser/LocationBar.h index 5fe9e3a4a4c..9257ca4edb0 100644 --- a/mozilla/camino/src/browser/LocationBar.h +++ b/mozilla/camino/src/browser/LocationBar.h @@ -23,8 +23,11 @@ #import -@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 diff --git a/mozilla/camino/src/browser/LocationBar.mm b/mozilla/camino/src/browser/LocationBar.mm index f70873d9666..64ff103f003 100644 --- a/mozilla/camino/src/browser/LocationBar.mm +++ b/mozilla/camino/src/browser/LocationBar.mm @@ -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