diff --git a/ChangeLog b/ChangeLog index b7e3fd9b4..05586469f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2010-12-31 Fred Kiefer + + * Source/GSToolbarView.m (initSystemExtensionsColors): Remove this + function and the NSColor extensions as these no longer get + used. The colours for NSToolbar are handled by GSTheme. + 2010-12-30 Wolfgang Lux * Source/NSMenuView.m (-locationForSubmenu:): diff --git a/Source/GSToolbarView.m b/Source/GSToolbarView.m index a3753fe44..735e52934 100644 --- a/Source/GSToolbarView.m +++ b/Source/GSToolbarView.m @@ -37,8 +37,6 @@ #import #import "AppKit/NSButton.h" #import "AppKit/NSClipView.h" -#import "AppKit/NSColor.h" -#import "AppKit/NSColorList.h" #import "AppKit/NSDragging.h" #import "AppKit/NSEvent.h" #import "AppKit/NSImage.h" @@ -67,77 +65,9 @@ static const int ClippedItemsViewWidth = 28; // Internal static const int current_version = 1; -static NSColorList *SystemExtensionsColors; static int draggedItemIndex = NSNotFound; -// Toolbar color extensions - -static void initSystemExtensionsColors(void) -{ - NSColor *toolbarBackgroundColor; - NSColor *toolbarBorderColor; - NSDictionary *colors; - - /* Set up a dictionary containing the names of all the system extensions - colours as keys and with colours as values. */ - toolbarBorderColor = [NSColor colorWithCalibratedRed: 0.5 - green: 0.5 - blue: 0.5 - alpha: 1.0]; - - // Window background color by tranparency - toolbarBackgroundColor = [NSColor clearColor]; - - colors = [[NSDictionary alloc] initWithObjectsAndKeys: - toolbarBackgroundColor, @"toolbarBackgroundColor", - toolbarBorderColor, @"toolbarBorderColor", nil]; - - SystemExtensionsColors = [NSColorList colorListNamed: @"System extensions"]; - if (SystemExtensionsColors == nil) - { - SystemExtensionsColors = [[NSColorList alloc] initWithName: @"System extensions"]; - } - - { - NSEnumerator *e; - NSString *colorKey; - NSColor *color; - BOOL changed = NO; - - // Set up default system extensions colors - - e = [colors keyEnumerator]; - - while ((colorKey = (NSString *)[e nextObject])) - { - if ([SystemExtensionsColors colorWithKey: colorKey]) - continue; - - color = [colors objectForKey: colorKey]; - [SystemExtensionsColors setColor: color forKey: colorKey]; - - changed = YES; - } - RELEASE(colors); - - if (changed) - [SystemExtensionsColors writeToFile: nil]; - } -} - -@implementation NSColor (GSToolbarViewAdditions) -+ (NSColor *) toolbarBackgroundColor -{ - return [SystemExtensionsColors colorWithKey: @"toolbarBackgroundColor"]; -} - -+ (NSColor *) toolbarBorderColor -{ - return [SystemExtensionsColors colorWithKey: @"toolbarBorderColor"]; -} -@end - /* * Toolbar related code */ @@ -275,7 +205,8 @@ static void initSystemExtensionsColors(void) + (void) initialize { if (self == [GSToolbarView class]) - initSystemExtensionsColors(); + { + } } - (id) initWithFrame: (NSRect)frame @@ -514,7 +445,7 @@ static void initSystemExtensionsColors(void) - (BOOL) isOpaque { - if ([[NSColor toolbarBackgroundColor] alphaComponent] < 1.0) + if ([[[GSTheme theme] toolbarBackgroundColor] alphaComponent] < 1.0) { return NO; }