Add GSUseWindowmakerIconBackground default.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@19771 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Alexander Malmberg 2004-07-22 23:57:46 +00:00
parent 73dbff47ec
commit 002efa32ed
4 changed files with 78 additions and 11 deletions

View file

@ -66,6 +66,7 @@
#include "AppKit/NSWorkspace.h"
#include "AppKit/NSNibLoading.h"
#include "AppKit/NSPageLayout.h"
#include "AppKit/PSOperators.h"
#include "GNUstepGUI/GSDisplayServer.h"
#include "GNUstepGUI/GSServicesManager.h"
@ -342,16 +343,26 @@ NSApplication *NSApp = nil;
// Class variables
static NSCell* dragCell = nil;
static NSCell* tileCell = nil;
static BOOL useWindowmakerIconBackground = NO;
+ (void) initialize
{
NSImage *defImage = [NSImage imageNamed: @"GNUstep"];
NSImage *tileImage = [NSImage imageNamed: @"common_Tile"];
NSImage *tileImage;
dragCell = [[NSCell alloc] initImageCell: defImage];
[dragCell setBordered: NO];
tileCell = [[NSCell alloc] initImageCell: tileImage];
[tileCell setBordered: NO];
if ([[NSUserDefaults standardUserDefaults]
boolForKey: @"GSUseWindowmakerIconBackground"])
{
useWindowmakerIconBackground = YES;
}
else
{
tileImage = [NSImage imageNamed: @"common_Tile"];
tileCell = [[NSCell alloc] initImageCell: tileImage];
[tileCell setBordered: NO];
}
}
- (BOOL) acceptsFirstMouse: (NSEvent*)theEvent
@ -379,7 +390,19 @@ static NSCell* tileCell = nil;
- (void) drawRect: (NSRect)rect
{
[tileCell drawWithFrame: NSMakeRect(0,0,64,64) inView: self];
if (useWindowmakerIconBackground)
{
PScompositerect(_bounds.origin.x,
_bounds.origin.y,
_bounds.size.width,
_bounds.size.height,
NSCompositeClear);
}
else
{
[tileCell drawWithFrame: NSMakeRect(0,0,64,64) inView: self];
}
[dragCell drawWithFrame: NSMakeRect(8,8,48,48) inView: self];
if ([NSApp isHidden])
{

View file

@ -341,15 +341,24 @@ has blocked and waited for events.
@end
static NSCell *tileCell = nil;
static BOOL useWindowmakerIconBackground = NO;
@implementation NSMiniWindowView
+ (void) initialize
{
NSImage *tileImage = [NSImage imageNamed: @"common_MiniWindowTile"];
tileCell = [[NSCell alloc] initImageCell: tileImage];
[tileCell setBordered: NO];
NSImage *tileImage;
if ([[NSUserDefaults standardUserDefaults]
boolForKey: @"GSUseWindowmakerIconBackground"])
{
useWindowmakerIconBackground = YES;
}
else
{
tileImage = [NSImage imageNamed: @"common_Tile"];
tileCell = [[NSCell alloc] initImageCell: tileImage];
[tileCell setBordered: NO];
}
}
- (BOOL) acceptsFirstMouse: (NSEvent*)theEvent
@ -365,8 +374,19 @@ static NSCell *tileCell = nil;
}
- (void) drawRect: (NSRect)rect
{
[tileCell drawWithFrame: NSMakeRect(0,0,64,64) inView: self];
{
if (useWindowmakerIconBackground)
{
PScompositerect(_bounds.origin.x,
_bounds.origin.y,
_bounds.size.width,
_bounds.size.height,
NSCompositeClear);
}
else
{
[tileCell drawWithFrame: NSMakeRect(0,0,64,64) inView: self];
}
[imageCell drawWithFrame: NSMakeRect(8,4,48,48) inView: self];
[titleCell drawWithFrame: NSMakeRect(1,52,62,11) inView: self];
}
@ -453,7 +473,8 @@ static NSCell *tileCell = nil;
[titleCell setEditable: NO];
[titleCell setBordered: NO];
[titleCell setAlignment: NSCenterTextAlignment];
[titleCell setDrawsBackground: NO];
[titleCell setDrawsBackground: YES];
[titleCell setBackgroundColor: [NSColor blackColor]];
[titleCell setTextColor: [NSColor whiteColor]];
[titleCell setFont: [NSFont systemFontOfSize: 8]];
}