mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 20:00:48 +00:00
* Source/NSBox.m (-calcSizesAllowingNegative): Protect against
_cell being nil. * Source/NSBox.m (-initWithCoder:): Add a few default values. * Source/NSMenu.m (-_setGeometry): Protect against _aWindow being nil. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@38003 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
3e8bcc22f4
commit
1a4ce08eb3
3 changed files with 43 additions and 4 deletions
|
@ -1,3 +1,10 @@
|
||||||
|
2014-07-04 Fred Kiefer <FredKiefer@gmx.de>
|
||||||
|
|
||||||
|
* Source/NSBox.m (-calcSizesAllowingNegative): Protect against
|
||||||
|
_cell being nil.
|
||||||
|
* Source/NSBox.m (-initWithCoder:): Add a few default values.
|
||||||
|
* Source/NSMenu.m (-_setGeometry): Protect against _aWindow being nil.
|
||||||
|
|
||||||
2014-07-04 Fred Kiefer <FredKiefer@gmx.de>
|
2014-07-04 Fred Kiefer <FredKiefer@gmx.de>
|
||||||
|
|
||||||
* Source/GSWindowDecorationView.m (-changeWindowHeight:): Add
|
* Source/GSWindowDecorationView.m (-changeWindowHeight:): Add
|
||||||
|
|
|
@ -572,6 +572,10 @@
|
||||||
|
|
||||||
[self setBorderType: borderType];
|
[self setBorderType: borderType];
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_border_type = NSGrooveBorder;
|
||||||
|
}
|
||||||
if ([aDecoder containsValueForKey: @"NSTitlePosition"])
|
if ([aDecoder containsValueForKey: @"NSTitlePosition"])
|
||||||
{
|
{
|
||||||
NSTitlePosition titlePosition = [aDecoder decodeIntForKey:
|
NSTitlePosition titlePosition = [aDecoder decodeIntForKey:
|
||||||
|
@ -579,6 +583,10 @@
|
||||||
|
|
||||||
[self setTitlePosition: titlePosition];
|
[self setTitlePosition: titlePosition];
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_title_position = NSAtTop;
|
||||||
|
}
|
||||||
if ([aDecoder containsValueForKey: @"NSTransparent"])
|
if ([aDecoder containsValueForKey: @"NSTransparent"])
|
||||||
{
|
{
|
||||||
// On Apple this is always NO, we keep it for old GNUstep archives
|
// On Apple this is always NO, we keep it for old GNUstep archives
|
||||||
|
@ -598,12 +606,27 @@
|
||||||
|
|
||||||
ASSIGN(_cell, titleCell);
|
ASSIGN(_cell, titleCell);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_cell = [[NSCell alloc] initTextCell: @"Title"];
|
||||||
|
[_cell setAlignment: NSCenterTextAlignment];
|
||||||
|
[_cell setBordered: NO];
|
||||||
|
[_cell setEditable: NO];
|
||||||
|
[self setTitleFont: [NSFont systemFontOfSize:
|
||||||
|
[NSFont smallSystemFontSize]]];
|
||||||
|
}
|
||||||
if ([aDecoder containsValueForKey: @"NSContentView"])
|
if ([aDecoder containsValueForKey: @"NSContentView"])
|
||||||
{
|
{
|
||||||
NSView *contentView = [aDecoder decodeObjectForKey: @"NSContentView"];
|
NSView *contentView = [aDecoder decodeObjectForKey: @"NSContentView"];
|
||||||
|
|
||||||
[self setContentView: contentView];
|
[self setContentView: contentView];
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
NSView *cv = [NSView new];
|
||||||
|
[self setContentView: cv];
|
||||||
|
RELEASE(cv);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -662,6 +685,12 @@
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Don't try to compute anything while the title cell hasn't been set.
|
||||||
|
if (_cell == nil)
|
||||||
|
{
|
||||||
|
return r;
|
||||||
|
}
|
||||||
|
|
||||||
switch (_title_position)
|
switch (_title_position)
|
||||||
{
|
{
|
||||||
case NSNoTitle:
|
case NSNoTitle:
|
||||||
|
|
|
@ -501,11 +501,14 @@ static BOOL menuBarVisible = YES;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
origin = NSMakePoint(0, [[_aWindow screen] visibleFrame].size.height
|
if ((_aWindow != nil) && ([_aWindow screen] != nil))
|
||||||
- [_aWindow frame].size.height);
|
{
|
||||||
|
origin = NSMakePoint(0, [[_aWindow screen] visibleFrame].size.height
|
||||||
|
- [_aWindow frame].size.height);
|
||||||
|
|
||||||
[_aWindow setFrameOrigin: origin];
|
[_aWindow setFrameOrigin: origin];
|
||||||
[_bWindow setFrameOrigin: origin];
|
[_bWindow setFrameOrigin: origin];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue