Skip to content
Permalink
Browse files
Add missing offset widgets for lineburst symbol layer
  • Loading branch information
nyalldawson committed Oct 29, 2021
1 parent ccf5ff0 commit d3d3b5e83c083969de53a34258484e91089cfcde
Showing with 210 additions and 108 deletions.
  1. +28 −1 src/gui/symbology/qgssymbollayerwidget.cpp
  2. +182 −107 src/ui/symbollayer/widget_gradientline.ui
@@ -4906,7 +4906,8 @@ QgsLineburstSymbolLayerWidget::QgsLineburstSymbolLayerWidget( QgsVectorLayer *vl

mPenWidthUnitWidget->setUnits( QgsUnitTypes::RenderUnitList() << QgsUnitTypes::RenderMillimeters << QgsUnitTypes::RenderMetersInMapUnits << QgsUnitTypes::RenderMapUnits << QgsUnitTypes::RenderPixels
<< QgsUnitTypes::RenderPoints << QgsUnitTypes::RenderInches );

mOffsetUnitWidget->setUnits( QgsUnitTypes::RenderUnitList() << QgsUnitTypes::RenderMillimeters << QgsUnitTypes::RenderMetersInMapUnits << QgsUnitTypes::RenderMapUnits << QgsUnitTypes::RenderPixels
<< QgsUnitTypes::RenderPoints << QgsUnitTypes::RenderInches );

connect( mPenWidthUnitWidget, &QgsUnitSelectionWidget::changed, this, [ = ]
{
@@ -4927,6 +4928,26 @@ QgsLineburstSymbolLayerWidget::QgsLineburstSymbolLayerWidget( QgsVectorLayer *vl
}
} );

connect( mOffsetUnitWidget, &QgsUnitSelectionWidget::changed, this, [ = ]
{
if ( mLayer )
{
mLayer->setOffsetUnit( mOffsetUnitWidget->unit() );
mLayer->setOffsetMapUnitScale( mOffsetUnitWidget->getMapUnitScale() );
emit changed();
}
} );

spinOffset->setClearValue( 0.0 );
connect( spinOffset, qOverload< double >( &QDoubleSpinBox::valueChanged ), this, [ = ]( double val )
{
if ( mLayer )
{
mLayer->setOffset( val );
emit changed();
}
} );

connect( cboCapStyle, static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ), this, [ = ]
{
if ( mLayer )
@@ -4993,12 +5014,18 @@ void QgsLineburstSymbolLayerWidget::setSymbolLayer( QgsSymbolLayer *layer )
whileBlocking( spinWidth )->setValue( mLayer->width() );
whileBlocking( mPenWidthUnitWidget )->setUnit( mLayer->widthUnit() );
whileBlocking( mPenWidthUnitWidget )->setMapUnitScale( mLayer->widthMapUnitScale() );

whileBlocking( mOffsetUnitWidget )->setUnit( mLayer->offsetUnit() );
whileBlocking( mOffsetUnitWidget )->setMapUnitScale( mLayer->offsetMapUnitScale() );
whileBlocking( spinOffset )->setValue( mLayer->offset() );

whileBlocking( cboJoinStyle )->setPenJoinStyle( mLayer->penJoinStyle() );
whileBlocking( cboCapStyle )->setPenCapStyle( mLayer->penCapStyle() );

registerDataDefinedButton( mStartColorDDBtn, QgsSymbolLayer::PropertyStrokeColor );
registerDataDefinedButton( mEndColorDDBtn, QgsSymbolLayer::PropertySecondaryColor );
registerDataDefinedButton( mPenWidthDDBtn, QgsSymbolLayer::PropertyStrokeWidth );
registerDataDefinedButton( mOffsetDDBtn, QgsSymbolLayer::PropertyOffset );
registerDataDefinedButton( mJoinStyleDDBtn, QgsSymbolLayer::PropertyJoinStyle );
registerDataDefinedButton( mCapStyleDDBtn, QgsSymbolLayer::PropertyCapStyle );
}
Loading

0 comments on commit d3d3b5e

Please sign in to comment.