@@ -31,6 +31,8 @@ PreferencesDialog::PreferencesDialog(QWidget* parent, Tabs tab)
31
31
ui->fr_reg_fg ->installEventFilter (this );
32
32
ui->fr_null_bg ->installEventFilter (this );
33
33
ui->fr_null_fg ->installEventFilter (this );
34
+ ui->fr_formatted_bg ->installEventFilter (this );
35
+ ui->fr_formatted_fg ->installEventFilter (this );
34
36
35
37
connect (ui->comboDataBrowserFont , static_cast <void (QFontComboBox::*)(int )>(&QFontComboBox::currentIndexChanged), this , &PreferencesDialog::updatePreviewFont);
36
38
connect (ui->spinDataBrowserFontSize , static_cast <void (QSpinBox::*)(int )>(&QSpinBox::valueChanged), this , &PreferencesDialog::updatePreviewFont);
@@ -111,6 +113,8 @@ void PreferencesDialog::loadSettings()
111
113
loadColorSetting (ui->fr_bin_bg , " bin_bg" );
112
114
loadColorSetting (ui->fr_reg_fg , " reg_fg" );
113
115
loadColorSetting (ui->fr_reg_bg , " reg_bg" );
116
+ loadColorSetting (ui->fr_formatted_fg , " formatted_fg" );
117
+ loadColorSetting (ui->fr_formatted_bg , " formatted_bg" );
114
118
115
119
ui->spinSymbolLimit ->setValue (Settings::getValue (" databrowser" , " symbol_limit" ).toInt ());
116
120
ui->spinCompleteThreshold ->setValue (Settings::getValue (" databrowser" , " complete_threshold" ).toInt ());
@@ -238,6 +242,8 @@ void PreferencesDialog::saveSettings(bool accept)
238
242
saveColorSetting (ui->fr_null_bg , " null_bg" );
239
243
saveColorSetting (ui->fr_reg_fg , " reg_fg" );
240
244
saveColorSetting (ui->fr_reg_bg , " reg_bg" );
245
+ saveColorSetting (ui->fr_formatted_fg , " formatted_fg" );
246
+ saveColorSetting (ui->fr_formatted_bg , " formatted_bg" );
241
247
saveColorSetting (ui->fr_bin_fg , " bin_fg" );
242
248
saveColorSetting (ui->fr_bin_bg , " bin_bg" );
243
249
Settings::setValue (" databrowser" , " symbol_limit" , ui->spinSymbolLimit ->value ());
@@ -376,6 +382,7 @@ bool PreferencesDialog::eventFilter(QObject *obj, QEvent *event)
376
382
// Use mouse click and enter press on the frames to pop up a colour dialog
377
383
if (obj == ui->fr_bin_bg || obj == ui->fr_bin_fg ||
378
384
obj == ui->fr_reg_bg || obj == ui->fr_reg_fg ||
385
+ obj == ui->fr_formatted_bg || obj == ui->fr_formatted_fg ||
379
386
obj == ui->fr_null_bg || obj == ui->fr_null_fg )
380
387
{
381
388
if (event->type () == QEvent::KeyPress)
@@ -521,6 +528,12 @@ void PreferencesDialog::setColorSetting(QFrame *frame, const QColor &color)
521
528
} else if (frame == ui->fr_reg_fg ) {
522
529
line = ui->txtRegular ;
523
530
role = line->foregroundRole ();
531
+ } else if (frame == ui->fr_formatted_bg ) {
532
+ line = ui->txtFormatted ;
533
+ role = line->backgroundRole ();
534
+ } else if (frame == ui->fr_formatted_fg ) {
535
+ line = ui->txtFormatted ;
536
+ role = line->foregroundRole ();
524
537
} else if (frame == ui->fr_null_bg ) {
525
538
line = ui->txtNull ;
526
539
role = line->backgroundRole ();
@@ -559,6 +572,8 @@ void PreferencesDialog::adjustColorsToStyle(int style)
559
572
setColorSetting (ui->fr_bin_bg , Settings::getDefaultColorValue (" databrowser" , " bin_bg_colour" , appStyle));
560
573
setColorSetting (ui->fr_reg_fg , Settings::getDefaultColorValue (" databrowser" , " reg_fg_colour" , appStyle));
561
574
setColorSetting (ui->fr_reg_bg , Settings::getDefaultColorValue (" databrowser" , " reg_bg_colour" , appStyle));
575
+ setColorSetting (ui->fr_formatted_fg , Settings::getDefaultColorValue (" databrowser" , " formatted_fg_colour" , appStyle));
576
+ setColorSetting (ui->fr_formatted_bg , Settings::getDefaultColorValue (" databrowser" , " formatted_bg_colour" , appStyle));
562
577
563
578
for (int i=0 ; i < ui->treeSyntaxHighlighting ->topLevelItemCount (); ++i)
564
579
{
@@ -666,6 +681,7 @@ void PreferencesDialog::updatePreviewFont()
666
681
QFont textFont (ui->comboDataBrowserFont ->currentText ());
667
682
textFont.setPointSize (ui->spinDataBrowserFontSize ->value ());
668
683
ui->txtRegular ->setFont (textFont);
684
+ ui->txtFormatted ->setFont (textFont);
669
685
textFont.setItalic (true );
670
686
ui->txtNull ->setFont (textFont);
671
687
ui->txtBlob ->setFont (textFont);
0 commit comments