mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 12:00:52 +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
|
@ -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
|
||||
|
|
|
@ -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…
Reference in a new issue