* Source/NSOutlineView (-mouseDown:): Check item expandability before

expanding or collapsing.



git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@24477 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Matt Rice 2007-02-05 18:06:03 +00:00
parent 3df40fcbc7
commit 81252d87b5
2 changed files with 15 additions and 7 deletions

View file

@ -1,3 +1,8 @@
2007-02-05 Matt Rice <ratmice@gmail.com>
* Source/NSOutlineView (-mouseDown:): Check item expandability before
expanding or collapsing.
2007-02-05 Fred Kiefer <FredKiefer@gmx.de>
* Headers/AppKit/NSMenuItem.h: Add MacOS 10.3 methods and

View file

@ -836,11 +836,12 @@ static NSImage *unexpandable = nil;
&& [_tableColumns objectAtIndex: _clickedColumn] == _outlineTableColumn)
{
NSImage *image;
id item = [self itemAtRow:_clickedRow];
int level = [self levelForRow: _clickedRow];
int position = 0;
if ([self isItemExpanded: [self itemAtRow: _clickedRow]])
if ([self isItemExpanded: item])
{
image = expanded;
}
@ -856,15 +857,17 @@ static NSImage *unexpandable = nil;
position += _columnOrigins[_clickedColumn];
if (location.x >= position && location.x <= position + [image size].width)
if ([self isExpandable:item]
&& location.x >= position
&& location.x <= position + [image size].width)
{
if (![self isItemExpanded: [self itemAtRow: _clickedRow]])
if (![self isItemExpanded: item])
{
[self expandItem: [self itemAtRow: _clickedRow]];
[self expandItem: item];
}
else
{
[self collapseItem: [self itemAtRow: _clickedRow]];
[self collapseItem: item];
}
return;
}