mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-15 16:44:36 +00:00
fix clicking a treeview element tripping expand/collapse
set the wasselected check earlier in the test chain, and test against it so just selecting it doesn't automatically also trip expand/collapse
This commit is contained in:
parent
475142b847
commit
89fb2990df
1 changed files with 3 additions and 4 deletions
|
|
@ -3389,7 +3389,7 @@ void GuiTreeViewCtrl::onMouseDown(const GuiEvent & event)
|
||||||
mPossibleRenameItem = NULL;
|
mPossibleRenameItem = NULL;
|
||||||
mRenamingItem = NULL;
|
mRenamingItem = NULL;
|
||||||
mTempItem = NULL;
|
mTempItem = NULL;
|
||||||
|
bool wasSelected = isSelected(item);
|
||||||
//
|
//
|
||||||
if( event.modifier & SI_MULTISELECT )
|
if( event.modifier & SI_MULTISELECT )
|
||||||
{
|
{
|
||||||
|
|
@ -3474,7 +3474,6 @@ void GuiTreeViewCtrl::onMouseDown(const GuiEvent & event)
|
||||||
{
|
{
|
||||||
mTempItem = item;
|
mTempItem = item;
|
||||||
|
|
||||||
bool wasSelected = isSelected( item );
|
|
||||||
bool multiSelect = getSelectedItemsCount() > 1;
|
bool multiSelect = getSelectedItemsCount() > 1;
|
||||||
|
|
||||||
if( !wasSelected || !multiSelect )
|
if( !wasSelected || !multiSelect )
|
||||||
|
|
@ -3520,7 +3519,7 @@ void GuiTreeViewCtrl::onMouseDown(const GuiEvent & event)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
//
|
//
|
||||||
if ( mFullRowSelect || hitFlags.test( OnImage ) )
|
if ((mFullRowSelect || hitFlags.test(OnImage)) && wasSelected)
|
||||||
{
|
{
|
||||||
item->setExpanded(!item->isExpanded());
|
item->setExpanded(!item->isExpanded());
|
||||||
if( !item->isInspectorData() && item->mState.test(Item::VirtualParent) )
|
if( !item->isInspectorData() && item->mState.test(Item::VirtualParent) )
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue