Fix selected item count in the properties panel

The code for updating selected item count is skipped if the properties
items don't change.


(cherry picked from commit 3f2e3d89e2)
This commit is contained in:
wh201906 2024-03-15 23:36:47 +08:00 committed by Jon Evans
parent 81f55dfc9c
commit 11177bf658
1 changed files with 8 additions and 9 deletions

View File

@ -174,6 +174,14 @@ void PROPERTIES_PANEL::rebuildProperties( const SELECTION& aSelection )
reset();
return;
}
else if( aSelection.Size() == 1 )
{
m_caption->SetLabel( aSelection.Front()->GetFriendlyName() );
}
else
{
m_caption->SetLabel( wxString::Format( _( "%d objects selected" ), aSelection.Size() ) );
}
// Get all the selected types
std::set<TYPE_ID> types;
@ -292,15 +300,6 @@ void PROPERTIES_PANEL::rebuildProperties( const SELECTION& aSelection )
}
}
if( aSelection.Size() > 1 )
{
m_caption->SetLabel( wxString::Format( _( "%d objects selected" ), aSelection.Size() ) );
}
else
{
m_caption->SetLabel( aSelection.Front()->GetFriendlyName() );
}
const wxString unspecifiedGroupCaption = _( "Basic Properties" );
for( const wxString& groupName : groupDisplayOrder )