@@ -48,11 +48,11 @@ QgsLabelingGui::QgsLabelingGui( QgsPalLabeling* lbl, QgsVectorLayer* layer, QgsM
48
48
mRefFont = lblFontPreview->font ();
49
49
mPreviewSize = 24 ;
50
50
51
- connect ( btnTextColor, SIGNAL ( clicked ( ) ), this , SLOT ( changeTextColor () ) );
51
+ connect ( btnTextColor, SIGNAL ( colorChanged ( const QColor& ) ), this , SLOT ( changeTextColor ( const QColor& ) ) );
52
52
connect ( btnChangeFont, SIGNAL ( clicked () ), this , SLOT ( changeTextFont () ) );
53
53
connect ( mFontTranspSpinBox , SIGNAL ( valueChanged ( int ) ), this , SLOT ( updatePreview () ) );
54
54
connect ( chkBuffer, SIGNAL ( toggled ( bool ) ), this , SLOT ( updatePreview () ) );
55
- connect ( btnBufferColor, SIGNAL ( clicked ( ) ), this , SLOT ( changeBufferColor () ) );
55
+ connect ( btnBufferColor, SIGNAL ( colorChanged ( const QColor& ) ), this , SLOT ( changeBufferColor ( const QColor& ) ) );
56
56
connect ( spinBufferSize, SIGNAL ( valueChanged ( double ) ), this , SLOT ( updatePreview () ) );
57
57
connect ( mBufferTranspSpinBox , SIGNAL ( valueChanged ( int ) ), this , SLOT ( updatePreview () ) );
58
58
connect ( mBufferJoinStyleComboBox , SIGNAL ( currentIndexChanged ( int ) ), this , SLOT ( updatePreview () ) );
@@ -661,13 +661,9 @@ void QgsLabelingGui::populateDataDefinedCombos( QgsPalLayerSettings& s )
661
661
setCurrentComboValue ( mAlwaysShowAttributeComboBox , s, QgsPalLayerSettings::AlwaysShow );
662
662
}
663
663
664
- void QgsLabelingGui::changeTextColor ()
664
+ void QgsLabelingGui::changeTextColor ( const QColor &color )
665
665
{
666
- QColor color = QColorDialog::getColor ( btnTextColor->color (), this );
667
- if ( !color.isValid () )
668
- return ;
669
-
670
- btnTextColor->setColor ( color );
666
+ Q_UNUSED ( color )
671
667
updatePreview ();
672
668
}
673
669
@@ -940,13 +936,9 @@ void QgsLabelingGui::updateUi()
940
936
offlineOptions->setEnabled ( offline );
941
937
}
942
938
943
- void QgsLabelingGui::changeBufferColor ()
939
+ void QgsLabelingGui::changeBufferColor ( const QColor &color )
944
940
{
945
- QColor color = QColorDialog::getColor ( btnBufferColor->color (), this );
946
- if ( !color.isValid () )
947
- return ;
948
-
949
- btnBufferColor->setColor ( color );
941
+ Q_UNUSED ( color )
950
942
updatePreview ();
951
943
}
952
944
@@ -1143,13 +1135,8 @@ void QgsLabelingGui::on_mPreviewTextBtn_clicked()
1143
1135
updatePreview ();
1144
1136
}
1145
1137
1146
- void QgsLabelingGui::on_mPreviewBackgroundBtn_clicked ( )
1138
+ void QgsLabelingGui::on_mPreviewBackgroundBtn_colorChanged ( const QColor &color )
1147
1139
{
1148
- QColor color = QColorDialog::getColor ( mPreviewBackgroundBtn ->color (), this );
1149
- if ( !color.isValid () )
1150
- return ;
1151
-
1152
- mPreviewBackgroundBtn ->setColor ( color );
1153
1140
setPreviewBackground ( color );
1154
1141
}
1155
1142
0 commit comments