From 89fb2990df54dab7d13808563657e63cb6e7d10b Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Tue, 20 Jan 2026 11:56:44 -0600 Subject: [PATCH] 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 --- Engine/source/gui/controls/guiTreeViewCtrl.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Engine/source/gui/controls/guiTreeViewCtrl.cpp b/Engine/source/gui/controls/guiTreeViewCtrl.cpp index daf014fb3..e0a2d90e0 100644 --- a/Engine/source/gui/controls/guiTreeViewCtrl.cpp +++ b/Engine/source/gui/controls/guiTreeViewCtrl.cpp @@ -3389,7 +3389,7 @@ void GuiTreeViewCtrl::onMouseDown(const GuiEvent & event) mPossibleRenameItem = NULL; mRenamingItem = NULL; mTempItem = NULL; - + bool wasSelected = isSelected(item); // if( event.modifier & SI_MULTISELECT ) { @@ -3473,8 +3473,7 @@ void GuiTreeViewCtrl::onMouseDown(const GuiEvent & event) else if ( !hitFlags.test(OnImage) ) { mTempItem = item; - - bool wasSelected = isSelected( item ); + bool multiSelect = getSelectedItemsCount() > 1; if( !wasSelected || !multiSelect ) @@ -3520,7 +3519,7 @@ void GuiTreeViewCtrl::onMouseDown(const GuiEvent & event) return; // - if ( mFullRowSelect || hitFlags.test( OnImage ) ) + if ((mFullRowSelect || hitFlags.test(OnImage)) && wasSelected) { item->setExpanded(!item->isExpanded()); if( !item->isInspectorData() && item->mState.test(Item::VirtualParent) )