diff --git a/mozilla/camino/src/browser/BrowserWindowController.mm b/mozilla/camino/src/browser/BrowserWindowController.mm index e81b5b854f6..4f69019ff1e 100644 --- a/mozilla/camino/src/browser/BrowserWindowController.mm +++ b/mozilla/camino/src/browser/BrowserWindowController.mm @@ -45,6 +45,7 @@ #import "NSSplitView+Utils.h" #import "NSMenu+Utils.h" #import "NSPasteboard+Utils.h" +#import "NSWorkspace+Utils.h" #import "BrowserWindowController.h" #import "BrowserWindow.h" @@ -132,6 +133,12 @@ #include "nsAppDirectoryServiceDefs.h" +#if MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4 +@interface NSWindow(LeopardSDKDeclarations) +- (void)setContentBorderThickness:(float)borderThickness forEdge:(NSRectEdge)edge; +@end +#endif + static NSString* const BrowserToolbarIdentifier = @"Browser Window Toolbar Combined"; static NSString* const BackToolbarItemIdentifier = @"Back Toolbar Item"; static NSString* const ForwardToolbarItemIdentifier = @"Forward Toolbar Item"; @@ -864,11 +871,16 @@ enum BWCOpenDest { [mStatusBar setHidden:YES]; mustResizeChrome = YES; } - // due to a cocoa issue with it updating the bounding box of two rects - // that both needing updating instead of just the two individual rects - // (radar 2194819), we need to make the text area opaque. - [mStatus setBackgroundColor:[NSColor windowBackgroundColor]]; - [mStatus setDrawsBackground:YES]; + if ([NSWorkspace isLeopardOrHigher]) { + [[self window] setContentBorderThickness:NSHeight([mStatusBar bounds]) forEdge:NSMinYEdge]; + } + else { + // due to a cocoa issue with it updating the bounding box of two rects + // that both needing updating instead of just the two individual rects + // (radar 2194819), we need to make the text area opaque. + [mStatus setBackgroundColor:[NSColor windowBackgroundColor]]; + [mStatus setDrawsBackground:YES]; + } // Set up the menus in the search fields [self setUpSearchFields]; @@ -1846,8 +1858,25 @@ enum BWCOpenDest { - (void)updateStatus:(NSString*)status { - if (![[mStatus stringValue] isEqualToString:status]) + if ([[mStatus stringValue] isEqualToString:status]) + return; + + if ([NSWorkspace isLeopardOrHigher]) { + // On 10.5+, give the text an etched look for the textured status bar. + static NSDictionary* shadowAttributes = nil; + if (!shadowAttributes) { + NSShadow* shadow = [[[NSShadow alloc] init] autorelease]; + [shadow setShadowOffset:NSMakeSize(0.0, -2.0)]; + [shadow setShadowColor:[NSColor colorWithCalibratedWhite:1.0 alpha:0.6]]; + shadowAttributes = [[NSDictionary dictionaryWithObject:shadow forKey:NSShadowAttributeName] retain]; + } + NSAttributedString* shadowedStatus = [[[NSAttributedString alloc] initWithString:status + attributes:shadowAttributes] autorelease]; + [mStatus setAttributedStringValue:shadowedStatus]; + } + else { [mStatus setStringValue:status]; + } } - (void)updateLocationFields:(NSString*)url ignoreTyping:(BOOL)ignoreTyping diff --git a/mozilla/camino/src/browser/StatusBarView.mm b/mozilla/camino/src/browser/StatusBarView.mm index 1c140ce13e8..6205c59860a 100644 --- a/mozilla/camino/src/browser/StatusBarView.mm +++ b/mozilla/camino/src/browser/StatusBarView.mm @@ -38,6 +38,8 @@ #import "StatusBarView.h" +#import "NSWorkspace+Utils.h" + @implementation StatusBarView // @@ -49,13 +51,15 @@ { [super drawRect:aRect]; - // optimize drawing a bit so we're not *always* redrawing our top header. Only - // draw if the area we're asked to draw overlaps with the top line. - NSRect frame = [self frame]; - if (NSMaxY(frame) <= NSMaxY(aRect)) { - NSPoint leftPoint = NSMakePoint(frame.origin.x, frame.origin.y + frame.size.height); - NSPoint rightPoint = NSMakePoint(frame.origin.x + frame.size.width, frame.origin.y + frame.size.height); - [NSBezierPath strokeLineFromPoint:leftPoint toPoint:rightPoint]; + if (![NSWorkspace isLeopardOrHigher]) { + // optimize drawing a bit so we're not *always* redrawing our top header. Only + // draw if the area we're asked to draw overlaps with the top line. + NSRect frame = [self frame]; + if (NSMaxY(frame) <= NSMaxY(aRect)) { + NSPoint leftPoint = NSMakePoint(frame.origin.x, frame.origin.y + frame.size.height); + NSPoint rightPoint = NSMakePoint(frame.origin.x + frame.size.width, frame.origin.y + frame.size.height); + [NSBezierPath strokeLineFromPoint:leftPoint toPoint:rightPoint]; + } } } diff --git a/mozilla/camino/src/extensions/NSWorkspace+Utils.h b/mozilla/camino/src/extensions/NSWorkspace+Utils.h index 261f674a4e3..eec52a7a410 100644 --- a/mozilla/camino/src/extensions/NSWorkspace+Utils.h +++ b/mozilla/camino/src/extensions/NSWorkspace+Utils.h @@ -57,6 +57,7 @@ - (NSString*)displayNameForFile:(NSURL*)inFileURL; // OS feature checks ++ (BOOL)isLeopardOrHigher; + (BOOL)isTigerOrHigher; + (BOOL)supportsSpotlight; + (BOOL)supportsUnifiedToolbar; diff --git a/mozilla/camino/src/extensions/NSWorkspace+Utils.m b/mozilla/camino/src/extensions/NSWorkspace+Utils.m index e90505b60b0..0b34e3444e3 100644 --- a/mozilla/camino/src/extensions/NSWorkspace+Utils.m +++ b/mozilla/camino/src/extensions/NSWorkspace+Utils.m @@ -186,6 +186,20 @@ return sSystemVersion; } +// +// +isLeopardOrHigher +// +// returns YES if we're on 10.5 or better +// ++ (BOOL)isLeopardOrHigher +{ +#if MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_4 + return YES; +#else + return [self systemVersion] >= 0x1050; +#endif +} + // // +isTigerOrHigher //