Properties: Fix handling of mixed value selections
This commit is contained in:
parent
5638122d3d
commit
890103a012
|
@ -227,6 +227,7 @@ void PROPERTIES_PANEL::rebuildProperties( const SELECTION& aSelection )
|
|||
// Either determine the common value for a property or "<...>" to indicate multiple values
|
||||
bool available = true;
|
||||
bool writeable = true;
|
||||
bool different = false;
|
||||
wxVariant commonVal;
|
||||
|
||||
for( EDA_ITEM* item : aSelection )
|
||||
|
@ -241,15 +242,20 @@ void PROPERTIES_PANEL::rebuildProperties( const SELECTION& aSelection )
|
|||
if( !property->Writeable( item ) )
|
||||
writeable = false;
|
||||
|
||||
wxVariant value = commonVal;
|
||||
wxVariant value;
|
||||
|
||||
if( getItemValue( item, property, value ) )
|
||||
{
|
||||
// Null value indicates different property values between items
|
||||
if( !commonVal.IsNull() && value != commonVal )
|
||||
if( !different && !commonVal.IsNull() && value != commonVal )
|
||||
{
|
||||
different = true;
|
||||
commonVal.MakeNull();
|
||||
else
|
||||
}
|
||||
else if( !different )
|
||||
{
|
||||
commonVal = value;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -123,6 +123,7 @@ void PCB_PROPERTIES_PANEL::updatePropertyValues( const SELECTION& aSelection )
|
|||
wxCHECK2( property, continue );
|
||||
|
||||
bool writeable = true;
|
||||
bool different = false;
|
||||
wxVariant commonVal;
|
||||
|
||||
for( EDA_ITEM* edaItem : aSelection )
|
||||
|
@ -134,10 +135,15 @@ void PCB_PROPERTIES_PANEL::updatePropertyValues( const SELECTION& aSelection )
|
|||
if( getItemValue( edaItem, property, value ) )
|
||||
{
|
||||
// Null value indicates different property values between items
|
||||
if( !commonVal.IsNull() && value != commonVal )
|
||||
if( !different && !commonVal.IsNull() && value != commonVal )
|
||||
{
|
||||
different = true;
|
||||
commonVal.MakeNull();
|
||||
else
|
||||
}
|
||||
else if( !different )
|
||||
{
|
||||
commonVal = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue