* Source/NSApplication.m: Add logic to load the icns if it's specified

as the icon file for an application.
	* Source/NSBitmapImageRep+ICNS.m: Limit the size of the representation
	to the 48x48 version. 

In the future I would like GNUstep to take full advantage of this format and display the representation which is most appropriate for a given size.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@26806 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Gregory John Casamento 2008-08-13 01:54:23 +00:00
parent 8b4277dcdc
commit bfde86fcd5
3 changed files with 24 additions and 1 deletions

View file

@ -1,3 +1,10 @@
2008-08-12 21:53-EDT Gregory John Casamento <greg_casamento@yahoo.com>
* Source/NSApplication.m: Add logic to load the icns if it's specified
as the icon file for an application.
* Source/NSBitmapImageRep+ICNS.m: Limit the size of the representation
to the 48x48 version.
2008-08-12 00:52-EDT Gregory John Casamento <greg_casamento@yahoo.com>
* configure: Regenerated file

View file

@ -929,6 +929,17 @@ static NSSize scaledIconSizeForSize(NSSize imageSize)
{
image = [NSImage imageNamed: appIconFile];
}
// Try to look up the icns file.
appIconFile = [infoDict objectForKey: @"CFBundleIconFile"];
if (appIconFile && ![appIconFile isEqual: @""])
{
NSString *fileName = [appIconFile stringByAppendingPathExtension:
@"icns"];
image = [NSImage imageNamed: fileName];
[image setScalesWhenResized: YES];
}
if (image == nil)
{
image = [NSImage imageNamed: @"GNUstep"];

View file

@ -129,7 +129,12 @@ typedef struct pixel_t
h = info.iconHeight;
w = info.iconWidth;
if( w > iconWidth )
//
// Temporarily limit to 48 until we can find a way to
// utilize the other representations in the icns file.
//
// if( w > iconWidth)
if(icns_types_equal(element.elementType,ICNS_48x48_32BIT_DATA))
{
iconWidth = w;
iconHeight = h;