mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 15:00:48 +00:00
fixups for checiking application icon size
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@27778 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
d0d81bf1b1
commit
6312db17ff
2 changed files with 25 additions and 4 deletions
|
@ -1,3 +1,11 @@
|
||||||
|
2009-02-04 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
|
* Source/NSApplication.m: Don't attempt to set app icon until
|
||||||
|
creating the window (if we are going to create it).
|
||||||
|
Fix size checks when setting image to cope if window does not
|
||||||
|
exist (was previously the normal case) to avoid streams of X
|
||||||
|
errors on most systems and segmentation fault on sparc.
|
||||||
|
|
||||||
2009-02-04 01:53-EST Gregory John Casamento <greg_casamento@yahoo.com>
|
2009-02-04 01:53-EST Gregory John Casamento <greg_casamento@yahoo.com>
|
||||||
|
|
||||||
* Source/GSNibLoader.m: Correct the message to indicate an issue
|
* Source/GSNibLoader.m: Correct the message to indicate an issue
|
||||||
|
|
|
@ -950,11 +950,11 @@ static NSSize scaledIconSizeForSize(NSSize imageSize)
|
||||||
{
|
{
|
||||||
image = [NSImage imageNamed: @"GNUstep"];
|
image = [NSImage imageNamed: @"GNUstep"];
|
||||||
}
|
}
|
||||||
[self setApplicationIconImage: image];
|
|
||||||
if (![defs boolForKey: @"GSSuppressAppIcon"])
|
if (![defs boolForKey: @"GSSuppressAppIcon"])
|
||||||
{
|
{
|
||||||
[self _appIconInit];
|
[self _appIconInit];
|
||||||
}
|
}
|
||||||
|
[self setApplicationIconImage: image];
|
||||||
|
|
||||||
mainModelFile = [infoDict objectForKey: @"NSMainNibFile"];
|
mainModelFile = [infoDict objectForKey: @"NSMainNibFile"];
|
||||||
if (mainModelFile != nil && [mainModelFile isEqual: @""] == NO)
|
if (mainModelFile != nil && [mainModelFile isEqual: @""] == NO)
|
||||||
|
@ -2133,7 +2133,7 @@ image.</p><p>See Also: -applicationIconImage</p>
|
||||||
NSEnumerator *iterator = [[self windows] objectEnumerator];
|
NSEnumerator *iterator = [[self windows] objectEnumerator];
|
||||||
NSWindow *current;
|
NSWindow *current;
|
||||||
NSImage *old_app_icon = _app_icon;
|
NSImage *old_app_icon = _app_icon;
|
||||||
NSSize miniWindowSize = [_app_icon_window frame].size;
|
NSSize miniWindowSize;
|
||||||
NSSize imageSize = [anImage size];
|
NSSize imageSize = [anImage size];
|
||||||
|
|
||||||
RETAIN(old_app_icon);
|
RETAIN(old_app_icon);
|
||||||
|
@ -2141,9 +2141,22 @@ image.</p><p>See Also: -applicationIconImage</p>
|
||||||
[anImage setName: @"NSApplicationIcon"];
|
[anImage setName: @"NSApplicationIcon"];
|
||||||
[anImage setScalesWhenResized: YES];
|
[anImage setScalesWhenResized: YES];
|
||||||
|
|
||||||
|
if (_app_icon_window == nil)
|
||||||
|
{
|
||||||
|
miniWindowSize = NSMakeSize(48, 48);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
miniWindowSize = [_app_icon_window frame].size;
|
||||||
|
if (miniWindowSize.width <= 0 || miniWindowSize.height <= 0)
|
||||||
|
{
|
||||||
|
miniWindowSize = NSMakeSize(48, 48);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// restrict size when the icon is larger than the mini window.
|
// restrict size when the icon is larger than the mini window.
|
||||||
if(imageSize.width > miniWindowSize.width ||
|
if (imageSize.width > miniWindowSize.width
|
||||||
imageSize.height > miniWindowSize.height)
|
|| imageSize.height > miniWindowSize.height)
|
||||||
{
|
{
|
||||||
[anImage setSize: miniWindowSize];
|
[anImage setSize: miniWindowSize];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue