Skip to content
Permalink
Browse files

Link color buttons to their data defined buttons in symbology

  • Loading branch information
nyalldawson committed Jan 11, 2019
1 parent e569331 commit cfa1d54fefe5cfc2f8e6da052b4f0f716c8c685c
Showing with 43 additions and 0 deletions.
  1. +5 −0 src/gui/symbology/qgsellipsesymbollayerwidget.cpp
  2. +38 −0 src/gui/symbology/qgssymbollayerwidget.cpp
@@ -57,6 +57,11 @@ QgsEllipseSymbolLayerWidget::QgsEllipseSymbolLayerWidget( QgsVectorLayer *vl, QW
btnChangeColorStroke->setShowNoColor( true );
btnChangeColorStroke->setNoColorString( tr( "Transparent Stroke" ) );

mFillColorDDBtn->setFlags( QgsPropertyOverrideButton::FlagDisableCheckedWidgetOnlyWhenProjectColorSet );
mFillColorDDBtn->registerEnabledWidget( btnChangeColorFill, false );
mStrokeColorDDBtn->setFlags( QgsPropertyOverrideButton::FlagDisableCheckedWidgetOnlyWhenProjectColorSet );
mStrokeColorDDBtn->registerEnabledWidget( btnChangeColorStroke, false );

spinOffsetX->setClearValue( 0.0 );
spinOffsetY->setClearValue( 0.0 );
mRotationSpinBox->setClearValue( 0.0 );
@@ -195,6 +195,9 @@ QgsSimpleLineSymbolLayerWidget::QgsSimpleLineSymbolLayerWidget( QgsVectorLayer *
btnChangeColor->setColorDialogTitle( tr( "Select Line Color" ) );
btnChangeColor->setContext( QStringLiteral( "symbology" ) );

mColorDDBtn->setFlags( QgsPropertyOverrideButton::FlagDisableCheckedWidgetOnlyWhenProjectColorSet );
mColorDDBtn->registerEnabledWidget( btnChangeColor, false );

mRingFilterComboBox->addItem( QgsApplication::getThemeIcon( QStringLiteral( "mIconAllRings.svg" ) ), tr( "All Rings" ), QgsLineSymbolLayer::AllRings );
mRingFilterComboBox->addItem( QgsApplication::getThemeIcon( QStringLiteral( "mIconExteriorRing.svg" ) ), tr( "Exterior Ring Only" ), QgsLineSymbolLayer::ExteriorRingOnly );
mRingFilterComboBox->addItem( QgsApplication::getThemeIcon( QStringLiteral( "mIconInteriorRings.svg" ) ), tr( "Interior Rings Only" ), QgsLineSymbolLayer::InteriorRingsOnly );
@@ -465,6 +468,11 @@ QgsSimpleMarkerSymbolLayerWidget::QgsSimpleMarkerSymbolLayerWidget( QgsVectorLay
btnChangeColorStroke->setShowNoColor( true );
btnChangeColorStroke->setNoColorString( tr( "Transparent Stroke" ) );

mFillColorDDBtn->setFlags( QgsPropertyOverrideButton::FlagDisableCheckedWidgetOnlyWhenProjectColorSet );
mFillColorDDBtn->registerEnabledWidget( btnChangeColorFill, false );
mStrokeColorDDBtn->setFlags( QgsPropertyOverrideButton::FlagDisableCheckedWidgetOnlyWhenProjectColorSet );
mStrokeColorDDBtn->registerEnabledWidget( btnChangeColorStroke, false );

spinOffsetX->setClearValue( 0.0 );
spinOffsetY->setClearValue( 0.0 );
spinAngle->setClearValue( 0.0 );
@@ -758,6 +766,11 @@ QgsSimpleFillSymbolLayerWidget::QgsSimpleFillSymbolLayerWidget( QgsVectorLayer *
connect( cboJoinStyle, static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ), this, &QgsSimpleFillSymbolLayerWidget::strokeStyleChanged );
connect( spinOffsetX, static_cast < void ( QDoubleSpinBox::* )( double ) > ( &QDoubleSpinBox::valueChanged ), this, &QgsSimpleFillSymbolLayerWidget::offsetChanged );
connect( spinOffsetY, static_cast < void ( QDoubleSpinBox::* )( double ) > ( &QDoubleSpinBox::valueChanged ), this, &QgsSimpleFillSymbolLayerWidget::offsetChanged );

mFillColorDDBtn->setFlags( QgsPropertyOverrideButton::FlagDisableCheckedWidgetOnlyWhenProjectColorSet );
mFillColorDDBtn->registerEnabledWidget( btnChangeColor, false );
mStrokeColorDDBtn->setFlags( QgsPropertyOverrideButton::FlagDisableCheckedWidgetOnlyWhenProjectColorSet );
mStrokeColorDDBtn->registerEnabledWidget( btnChangeStrokeColor, false );
}

void QgsSimpleFillSymbolLayerWidget::setSymbolLayer( QgsSymbolLayer *layer )
@@ -1078,6 +1091,11 @@ QgsGradientFillSymbolLayerWidget::QgsGradientFillSymbolLayerWidget( QgsVectorLay
btnChangeColor2->setShowNoColor( true );
btnChangeColor2->setNoColorString( tr( "Transparent" ) );

mStartColorDDBtn->setFlags( QgsPropertyOverrideButton::FlagDisableCheckedWidgetOnlyWhenProjectColorSet );
mStartColorDDBtn->registerEnabledWidget( btnChangeColor, false );
mEndColorDDBtn->setFlags( QgsPropertyOverrideButton::FlagDisableCheckedWidgetOnlyWhenProjectColorSet );
mEndColorDDBtn->registerEnabledWidget( btnChangeColor2, false );

spinOffsetX->setClearValue( 0.0 );
spinOffsetY->setClearValue( 0.0 );
mSpinAngle->setClearValue( 0.0 );
@@ -1419,6 +1437,11 @@ QgsShapeburstFillSymbolLayerWidget::QgsShapeburstFillSymbolLayerWidget( QgsVecto
btnChangeColor2->setShowNoColor( true );
btnChangeColor2->setNoColorString( tr( "Transparent" ) );

mStartColorDDBtn->setFlags( QgsPropertyOverrideButton::FlagDisableCheckedWidgetOnlyWhenProjectColorSet );
mStartColorDDBtn->registerEnabledWidget( btnChangeColor, false );
mEndColorDDBtn->setFlags( QgsPropertyOverrideButton::FlagDisableCheckedWidgetOnlyWhenProjectColorSet );
mEndColorDDBtn->registerEnabledWidget( btnChangeColor2, false );

spinOffsetX->setClearValue( 0.0 );
spinOffsetY->setClearValue( 0.0 );

@@ -1869,6 +1892,11 @@ QgsSvgMarkerSymbolLayerWidget::QgsSvgMarkerSymbolLayerWidget( QgsVectorLayer *vl
mChangeStrokeColorButton->setColorDialogTitle( tr( "Select Stroke Color" ) );
mChangeStrokeColorButton->setContext( QStringLiteral( "symbology" ) );

mFillColorDDBtn->setFlags( QgsPropertyOverrideButton::FlagDisableCheckedWidgetOnlyWhenProjectColorSet );
mFillColorDDBtn->registerEnabledWidget( mChangeColorButton, false );
mStrokeColorDDBtn->setFlags( QgsPropertyOverrideButton::FlagDisableCheckedWidgetOnlyWhenProjectColorSet );
mStrokeColorDDBtn->registerEnabledWidget( mChangeStrokeColorButton, false );

spinOffsetX->setClearValue( 0.0 );
spinOffsetY->setClearValue( 0.0 );
spinAngle->setClearValue( 0.0 );
@@ -2312,6 +2340,11 @@ QgsSVGFillSymbolLayerWidget::QgsSVGFillSymbolLayerWidget( QgsVectorLayer *vl, QW
mChangeStrokeColorButton->setColorDialogTitle( tr( "Select Stroke Color" ) );
mChangeStrokeColorButton->setContext( QStringLiteral( "symbology" ) );

mFilColorDDBtn->setFlags( QgsPropertyOverrideButton::FlagDisableCheckedWidgetOnlyWhenProjectColorSet );
mFilColorDDBtn->registerEnabledWidget( mChangeColorButton, false );
mStrokeColorDDBtn->setFlags( QgsPropertyOverrideButton::FlagDisableCheckedWidgetOnlyWhenProjectColorSet );
mStrokeColorDDBtn->registerEnabledWidget( mChangeStrokeColorButton, false );

connect( mSvgListView->selectionModel(), &QItemSelectionModel::currentChanged, this, &QgsSVGFillSymbolLayerWidget::setFile );
connect( mSvgTreeView->selectionModel(), &QItemSelectionModel::currentChanged, this, &QgsSVGFillSymbolLayerWidget::populateIcons );
}
@@ -2834,6 +2867,11 @@ QgsFontMarkerSymbolLayerWidget::QgsFontMarkerSymbolLayerWidget( QgsVectorLayer *
btnStrokeColor->setColorDialogTitle( tr( "Select Symbol Stroke Color" ) );
btnStrokeColor->setContext( QStringLiteral( "symbology" ) );

mColorDDBtn->setFlags( QgsPropertyOverrideButton::FlagDisableCheckedWidgetOnlyWhenProjectColorSet );
mColorDDBtn->registerEnabledWidget( btnColor, false );
mStrokeColorDDBtn->setFlags( QgsPropertyOverrideButton::FlagDisableCheckedWidgetOnlyWhenProjectColorSet );
mStrokeColorDDBtn->registerEnabledWidget( btnStrokeColor, false );

spinOffsetX->setClearValue( 0.0 );
spinOffsetY->setClearValue( 0.0 );
spinAngle->setClearValue( 0.0 );

0 comments on commit cfa1d54

Please sign in to comment.
You can’t perform that action at this time.