Skip to content
Permalink
Browse files

Link labeling and layout data defined buttons to color buttons

  • Loading branch information
nyalldawson committed Jan 11, 2019
1 parent 8707eee commit fd9bd0a112e726a8dfb9febf33110004928ba0b3
@@ -61,6 +61,11 @@ QgsLayoutPictureWidget::QgsLayoutPictureWidget( QgsLayoutItemPicture *picture )
mStrokeColorButton->setColorDialogTitle( tr( "Select Stroke Color" ) );
mStrokeColorButton->setContext( QStringLiteral( "composer" ) );

mFillColorDDBtn->setFlags( QgsPropertyOverrideButton::FlagDisableCheckedWidgetOnlyWhenProjectColorSet );
mFillColorDDBtn->registerEnabledWidget( mFillColorButton, false );
mStrokeColorDDBtn->setFlags( QgsPropertyOverrideButton::FlagDisableCheckedWidgetOnlyWhenProjectColorSet );
mStrokeColorDDBtn->registerEnabledWidget( mStrokeColorButton, false );

mNorthTypeComboBox->blockSignals( true );
mNorthTypeComboBox->addItem( tr( "Grid north" ), QgsLayoutItemPicture::GridNorth );
mNorthTypeComboBox->addItem( tr( "True north" ), QgsLayoutItemPicture::TrueNorth );
@@ -109,6 +109,13 @@ QgsLayoutScaleBarWidget::QgsLayoutScaleBarWidget( QgsLayoutItemScaleBar *scaleBa
mStrokeColorButton->setNoColorString( tr( "Transparent Line" ) );
mStrokeColorButton->setShowNoColor( true );

mFillColorDDBtn->setFlags( QgsPropertyOverrideButton::FlagDisableCheckedWidgetOnlyWhenProjectColorSet );
mFillColorDDBtn->registerEnabledWidget( mFillColorButton, false );
mFillColor2DDBtn->setFlags( QgsPropertyOverrideButton::FlagDisableCheckedWidgetOnlyWhenProjectColorSet );
mFillColor2DDBtn->registerEnabledWidget( mFillColor2Button, false );
mLineColorDDBtn->setFlags( QgsPropertyOverrideButton::FlagDisableCheckedWidgetOnlyWhenProjectColorSet );
mLineColorDDBtn->registerEnabledWidget( mStrokeColorButton, false );

if ( mScalebar )
{
mFillColorDDBtn->registerExpressionContextGenerator( mScalebar );
@@ -252,6 +252,11 @@ QgsLayoutItemPropertiesWidget::QgsLayoutItemPropertiesWidget( QWidget *parent, Q
mSizeLockAspectRatio->setWidthSpinBox( mWidthSpin );
mSizeLockAspectRatio->setHeightSpinBox( mHeightSpin );

mItemFrameColorDDBtn->setFlags( QgsPropertyOverrideButton::FlagDisableCheckedWidgetOnlyWhenProjectColorSet );
mItemFrameColorDDBtn->registerEnabledWidget( mFrameColorButton, false );
mItemBackgroundColorDDBtn->setFlags( QgsPropertyOverrideButton::FlagDisableCheckedWidgetOnlyWhenProjectColorSet );
mItemBackgroundColorDDBtn->registerEnabledWidget( mBackgroundColorButton, false );

connect( mFrameColorButton, &QgsColorButton::colorChanged, this, &QgsLayoutItemPropertiesWidget::mFrameColorButton_colorChanged );
connect( mBackgroundColorButton, &QgsColorButton::colorChanged, this, &QgsLayoutItemPropertiesWidget::mBackgroundColorButton_colorChanged );
connect( mStrokeWidthSpinBox, static_cast < void ( QDoubleSpinBox::* )( double ) > ( &QDoubleSpinBox::valueChanged ), this, &QgsLayoutItemPropertiesWidget::mStrokeWidthSpinBox_valueChanged );
@@ -164,6 +164,17 @@ void QgsTextFormatWidget::initWidget()
mShadowColorBtn->setContext( QStringLiteral( "labeling" ) );
mShadowColorBtn->setDefaultColor( Qt::black );

mFontColorDDBtn->setFlags( QgsPropertyOverrideButton::FlagDisableCheckedWidgetOnlyWhenProjectColorSet );
mFontColorDDBtn->registerEnabledWidget( btnTextColor, false );
mBufferColorDDBtn->setFlags( QgsPropertyOverrideButton::FlagDisableCheckedWidgetOnlyWhenProjectColorSet );
mBufferColorDDBtn->registerEnabledWidget( btnBufferColor, false );
mShapeStrokeColorDDBtn->setFlags( QgsPropertyOverrideButton::FlagDisableCheckedWidgetOnlyWhenProjectColorSet );
mShapeStrokeColorDDBtn->registerEnabledWidget( mShapeStrokeColorBtn, false );
mShapeFillColorDDBtn->setFlags( QgsPropertyOverrideButton::FlagDisableCheckedWidgetOnlyWhenProjectColorSet );
mShapeFillColorDDBtn->registerEnabledWidget( mShapeFillColorBtn, false );
mShadowColorDDBtn->setFlags( QgsPropertyOverrideButton::FlagDisableCheckedWidgetOnlyWhenProjectColorSet );
mShadowColorDDBtn->registerEnabledWidget( mShadowColorBtn, false );

// set up quadrant offset button group
mQuadrantBtnGrp = new QButtonGroup( this );
mQuadrantBtnGrp->addButton( mPointOffsetAboveLeft, static_cast<int>( QgsPalLayerSettings::QuadrantAboveLeft ) );

0 comments on commit fd9bd0a

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