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:
alexm 2004-07-22 23:57:46 +00:00
parent e2c690726d
commit fc236ac493
4 changed files with 78 additions and 11 deletions

View file

@ -1,3 +1,14 @@
2004-07-23 01:54 Matt Rice <ratmice@yahoo.com>
* Documentation/GuiUser/DefaultsSummary.gsdoc: Document
GSUseWindowmakerIconBackground.
* Source/NSApplication.m ([NSAppIconView +initialize],
[NSAppIconView -drawRect:]): If the GSUseWindowmakerIconBackground
default is YES, do a clear composite of the background instead
of using the tile.
* Source/NSWindow.m ([NSMiniWindowView +initialize],
[NSMiniWindowView -drawRect:]): Idem.
2004-07-22 04:46 Chad Hardin <cehardin@mac.com> 2004-07-22 04:46 Chad Hardin <cehardin@mac.com>
* Headers/AppKit/NSPageLayout.h: Changed to MVC and a whole new UI. * Headers/AppKit/NSPageLayout.h: Changed to MVC and a whole new UI.

View file

@ -144,6 +144,18 @@
specification are used in [NSWorkspace iconForFile:] when available. specification are used in [NSWorkspace iconForFile:] when available.
</p> </p>
</desc> </desc>
<term>GSUseWindowmakerIconBackground</term>
<desc>
<p>
A boolean value, <code>NO</code> by default. When set to YES,
GNUstep uses the windowmaker icon background
for app icons and mini-windows.
</p>
<p>
Note that this only works when using back-art, and the
XWindowBuffer-shape-hack default must be set to YES.
</p>
</desc>
<term>GSLogWorkspaceTimeout</term> <term>GSLogWorkspaceTimeout</term>
<desc> <desc>
<p> <p>

View file

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

View file

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