Better NIB loading for NSWindow.

Ignore missing image in NSButtonCell drawing.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@26591 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Fred Kiefer 2008-06-02 10:35:42 +00:00
parent ddd37df12f
commit b4d065a9bf
3 changed files with 24 additions and 1 deletions

View file

@ -1,3 +1,10 @@
2008-06-02 Fred Kiefer <FredKiefer@gmx.de>
* Source/GSNibCompatibility.m (NSWindowTemplate-initWithCoder:):
Use default maxSize for window if none is given in the NIB file.
* Source/NSButtonCell.m (-drawInteriorWithFrame:inView:): Adjust
the image position if either the image or the text doesn't exist.
2008-05-28 Fred Kiefer <FredKiefer@gmx.de>
* Source/NSMenuItem.m (-setKeyEquivalent:): Warn about

View file

@ -185,9 +185,13 @@ static BOOL _isInInterfaceBuilder = NO;
{
_maxSize = [coder decodeSizeForKey: @"NSMaxSize"];
}
else
{
_maxSize = NSMakeSize (10e4, 10e4);
}
if ([coder containsValueForKey: @"NSWindowRect"])
{
_windowRect = [coder decodeRectForKey: @"NSWindowRect"];
_windowRect = [coder decodeRectForKey: @"NSWindowRect"];
}
if ([coder containsValueForKey: @"NSFrameAutosaveName"])
{

View file

@ -1102,11 +1102,23 @@ typedef struct _GSButtonCellFlags
{
imageSize = [imageToDisplay size];
}
else
{
// When there is no image to display, ignore it in the calculations
imageToDisplay = nil;
ipos = NSNoImage;
}
if (titleToDisplay && ipos != NSImageOnly)
{
titleSize = [titleToDisplay size];
}
else
{
// When there is no text to display, ignore it in the calculations
titleToDisplay = nil;
ipos = NSImageOnly;
}
if (flippedView == YES)
{