Fix selected item count in the properties panel

The code for updating selected item count is skipped if the properties
items don't change.
This commit is contained in:
wh201906 2024-03-15 23:36:47 +08:00 committed by Jon Evans
parent 81855aaaa6
commit 3f2e3d89e2
1 changed files with 8 additions and 9 deletions

View File

@ -184,6 +184,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;
@ -302,15 +310,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 )