mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-30 05:40:37 +00:00
* 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. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@31807 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
abd36c5caa
commit
3b7e6aa708
2 changed files with 9 additions and 72 deletions
|
@ -1,3 +1,9 @@
|
|||
2010-12-31 Fred Kiefer <FredKiefer@gmx.de>
|
||||
|
||||
* 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 <wolfgang.lux@gmail.com>
|
||||
|
||||
* Source/NSMenuView.m (-locationForSubmenu:):
|
||||
|
|
|
@ -37,8 +37,6 @@
|
|||
#import <Foundation/NSString.h>
|
||||
#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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue