From 11177bf65857e14cff4be0f01aa303bc7322650d 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. (cherry picked from commit 3f2e3d89e2a0cbb106f55f48a1e0ecd180ef0c18) --- 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 f800bc037f..0d892dc2bc 100644 --- a/common/widgets/properties_panel.cpp +++ b/common/widgets/properties_panel.cpp @@ -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 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 )