@@ -62,8 +62,6 @@ QgsLabelDialog::QgsLabelDialog ( QgsLabel *label, QWidget *parent )
62
62
this , SLOT (changeBufferColor ()) );
63
63
connect ( pbnDefaultFontColor, SIGNAL (clicked ()),
64
64
this , SLOT (changeFontColor ()) );
65
- connect ( chkUseBuffer, SIGNAL (toggled (bool )),
66
- this , SLOT (chkUseBuffer_toggled (bool )) );
67
65
}
68
66
69
67
@@ -249,7 +247,7 @@ void QgsLabelDialog::init ( )
249
247
}
250
248
else // defaults for when no offset is defined
251
249
{
252
- spinBufferSize->setValue (0 );
250
+ spinBufferSize->setValue (1 );
253
251
}
254
252
// set the state of the buffer enabled checkbox
255
253
chkUseBuffer->setChecked (myLabelAttributes->bufferEnabled ());
@@ -264,9 +262,9 @@ void QgsLabelDialog::init ( )
264
262
265
263
void QgsLabelDialog::changeFont ( void )
266
264
{
267
- #ifdef QGISDEBUG
265
+ #ifdef QGISDEBUG
268
266
std::cerr << " QgsLabelDialog::changeFont()" << std::endl;
269
- #endif
267
+ #endif
270
268
bool resultFlag;
271
269
mFont = QFontDialog::getFont (&resultFlag, mFont , this );
272
270
if ( resultFlag )
@@ -282,20 +280,24 @@ void QgsLabelDialog::changeFont ( void )
282
280
283
281
void QgsLabelDialog::changeFontColor (void )
284
282
{
285
- #ifdef QGISDEBUG
283
+ #ifdef QGISDEBUG
286
284
std::cerr << " QgsLabelDialog::changeFontColor()" << std::endl;
287
- #endif
285
+ #endif
288
286
mFontColor = QColorDialog::getColor ( mFontColor );
289
- lblSample->setPaletteForegroundColor (mFontColor );
287
+ QPalette palette = lblSample->palette ();
288
+ palette.setColor (lblSample->foregroundRole (), mBufferColor );
289
+ lblSample->setPalette (palette);
290
290
}
291
291
292
292
void QgsLabelDialog::changeBufferColor (void )
293
293
{
294
- #ifdef QGISDEBUG
294
+ #ifdef QGISDEBUG
295
295
std::cerr << " QgsLabelDialog::changeBufferColor()" << std::endl;
296
- #endif
296
+ #endif
297
297
mBufferColor = QColorDialog::getColor ( mBufferColor );
298
- lblSample->setPaletteBackgroundColor (mBufferColor );
298
+ QPalette palette = lblSample->palette ();
299
+ palette.setColor (lblSample->backgroundRole (), mBufferColor );
300
+ lblSample->setPalette (palette);
299
301
}
300
302
301
303
@@ -313,16 +315,16 @@ int QgsLabelDialog::itemNoForField(QString theFieldName, QStringList theFieldLis
313
315
314
316
QgsLabelDialog::~QgsLabelDialog ()
315
317
{
316
- #ifdef QGISDEBUG
318
+ #ifdef QGISDEBUG
317
319
std::cerr << " QgsLabelDialog::~QgsLabelDialog()" << std::endl;
318
- #endif
320
+ #endif
319
321
}
320
322
321
323
void QgsLabelDialog::apply ()
322
324
{
323
- #ifdef QGISDEBUG
325
+ #ifdef QGISDEBUG
324
326
std::cerr << " QgsLabelDialog::apply()" << std::endl;
325
- #endif
327
+ #endif
326
328
327
329
// set the label props that are NOT bound to a field in the attributes tbl
328
330
// All of these are set in the layerAttributes member of the layer
0 commit comments