@@ -1756,20 +1756,20 @@ QgsSvgMarkerSymbolLayerWidget::QgsSvgMarkerSymbolLayerWidget( const QgsVectorLay
1756
1756
connect ( viewGroups->selectionModel (), &QItemSelectionModel::currentChanged, this , &QgsSvgMarkerSymbolLayerWidget::populateIcons );
1757
1757
connect ( spinWidth, static_cast < void ( QDoubleSpinBox::* )( double ) > ( &QDoubleSpinBox::valueChanged ), this , &QgsSvgMarkerSymbolLayerWidget::setWidth );
1758
1758
connect ( spinHeight, static_cast < void ( QDoubleSpinBox::* )( double ) > ( &QDoubleSpinBox::valueChanged ), this , &QgsSvgMarkerSymbolLayerWidget::setHeight );
1759
- connect ( checkBoxAspectRatio , static_cast < void ( QCheckBox ::* )( int ) > ( &QCheckBox::stateChanged ), this , &QgsSvgMarkerSymbolLayerWidget::stateChangedAspectRatio );
1759
+ connect ( mLockAspectRatio , static_cast < void ( QgsRatioLockButton ::* )( bool ) > ( &QgsRatioLockButton::lockChanged ), this , &QgsSvgMarkerSymbolLayerWidget::stateChangedAspectRatio );
1760
1760
connect ( spinAngle, static_cast < void ( QDoubleSpinBox::* )( double ) > ( &QDoubleSpinBox::valueChanged ), this , &QgsSvgMarkerSymbolLayerWidget::setAngle );
1761
1761
connect ( spinOffsetX, static_cast < void ( QDoubleSpinBox::* )( double ) > ( &QDoubleSpinBox::valueChanged ), this , &QgsSvgMarkerSymbolLayerWidget::setOffset );
1762
1762
connect ( spinOffsetY, static_cast < void ( QDoubleSpinBox::* )( double ) > ( &QDoubleSpinBox::valueChanged ), this , &QgsSvgMarkerSymbolLayerWidget::setOffset );
1763
1763
connect ( this , &QgsSymbolLayerWidget::changed, this , &QgsSvgMarkerSymbolLayerWidget::updateAssistantSymbol );
1764
1764
1765
+
1765
1766
// make a temporary symbol for the size assistant preview
1766
1767
mAssistantPreviewSymbol .reset ( new QgsMarkerSymbol () );
1767
1768
1768
1769
if ( vectorLayer () )
1769
1770
{
1770
1771
mWidthDDBtn ->setSymbol ( mAssistantPreviewSymbol );
1771
1772
mHeightDDBtn ->setSymbol ( mAssistantPreviewSymbol );
1772
- mAspectRatioDDBtn ->setSymbol ( mAssistantPreviewSymbol );
1773
1773
}
1774
1774
}
1775
1775
@@ -1878,7 +1878,7 @@ void QgsSvgMarkerSymbolLayerWidget::setGuiForSvg( const QgsSvgMarkerSymbolLayer
1878
1878
}
1879
1879
spinHeight->blockSignals ( false );
1880
1880
spinHeight->setEnabled ( !preservedAspectRatio );
1881
- checkBoxAspectRatio-> setChecked ( preservedAspectRatio );
1881
+ mLockAspectRatio -> setLocked ( preservedAspectRatio );
1882
1882
}
1883
1883
1884
1884
void QgsSvgMarkerSymbolLayerWidget::updateAssistantSymbol ()
@@ -1963,7 +1963,6 @@ void QgsSvgMarkerSymbolLayerWidget::setSymbolLayer( QgsSymbolLayer *layer )
1963
1963
1964
1964
registerDataDefinedButton ( mWidthDDBtn , QgsSymbolLayer::PropertyWidth );
1965
1965
registerDataDefinedButton ( mHeightDDBtn , QgsSymbolLayer::PropertyHeight );
1966
- registerDataDefinedButton ( mAspectRatioDDBtn , QgsSymbolLayer::PropertyPreserveAspectRatio );
1967
1966
registerDataDefinedButton ( mStrokeWidthDDBtn , QgsSymbolLayer::PropertyStrokeWidth );
1968
1967
registerDataDefinedButton ( mAngleDDBtn , QgsSymbolLayer::PropertyAngle );
1969
1968
registerDataDefinedButton ( mOffsetDDBtn , QgsSymbolLayer::PropertyOffset );
@@ -2000,7 +1999,7 @@ void QgsSvgMarkerSymbolLayerWidget::setWidth()
2000
1999
{
2001
2000
spinHeight->setValue ( spinWidth->value () );
2002
2001
}
2003
- else if ( checkBoxAspectRatio-> isChecked () )
2002
+ else if ( mLockAspectRatio -> locked () )
2004
2003
{
2005
2004
spinHeight->setValue ( spinWidth->value () * defaultAspectRatio );
2006
2005
}
@@ -2023,7 +2022,7 @@ void QgsSvgMarkerSymbolLayerWidget::setHeight()
2023
2022
{
2024
2023
spinWidth->setValue ( spinHeight->value () );
2025
2024
}
2026
- else if ( checkBoxAspectRatio-> isChecked () )
2025
+ else if ( mLockAspectRatio -> locked () )
2027
2026
{
2028
2027
spinWidth->setValue ( spinHeight->value () / defaultAspectRatio );
2029
2028
}
@@ -2039,7 +2038,7 @@ void QgsSvgMarkerSymbolLayerWidget::setHeight()
2039
2038
2040
2039
void QgsSvgMarkerSymbolLayerWidget::stateChangedAspectRatio ()
2041
2040
{
2042
- spinHeight->setEnabled ( !checkBoxAspectRatio-> isChecked () );
2041
+ spinHeight->setEnabled ( !mLockAspectRatio -> locked () );
2043
2042
setWidth ();
2044
2043
emit changed ();
2045
2044
}
0 commit comments