From 3f2e3d89e2a0cbb106f55f48a1e0ecd180ef0c18 Mon Sep 17 00:00:00 2001 From: wh201906 Date: Fri, 15 Mar 2024 23:36:47 +0800 Subject: [PATCH] Fix selected item count in the properties panel The code for updating selected item count is skipped if the properties items don't change. --- common/widgets/properties_panel.cpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/common/widgets/properties_panel.cpp b/common/widgets/properties_panel.cpp index 3095022b2d..88471d546f 100644 --- a/common/widgets/properties_panel.cpp +++ b/common/widgets/properties_panel.cpp @@ -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 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 )