mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-20 14:47:31 +00:00
* 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:
parent
3df40fcbc7
commit
81252d87b5
2 changed files with 15 additions and 7 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue