Preview for the Data Browser font in Preferences

The 'Displayed text' boxes preview now the Data Browser font that the user
sets in the corresponding widgets.

See issue #1263
This commit is contained in:
mgrojo
2017-12-12 00:08:22 +01:00
parent bfb607c4b7
commit 387449b751
2 changed files with 14 additions and 0 deletions

View File

@@ -29,6 +29,9 @@ PreferencesDialog::PreferencesDialog(QWidget* parent)
ui->fr_null_bg->installEventFilter(this);
ui->fr_null_fg->installEventFilter(this);
connect(ui->comboDataBrowserFont, SIGNAL(currentIndexChanged(int)), this, SLOT(updatePreviewFont()));
connect(ui->spinDataBrowserFontSize, SIGNAL(valueChanged(int)), this, SLOT(updatePreviewFont()));
#ifndef CHECKNEWVERSION
ui->labelUpdates->setVisible(false);
ui->checkUpdates->setVisible(false);
@@ -546,3 +549,13 @@ void PreferencesDialog::chooseRemoteCloneDirectory()
if(!s.isEmpty())
ui->editRemoteCloneDirectory->setText(s);
}
void PreferencesDialog::updatePreviewFont()
{
QFont textFont(ui->comboDataBrowserFont->currentText());
textFont.setPointSize(ui->spinDataBrowserFontSize->value());
ui->txtRegular->setFont(textFont);
textFont.setItalic(true);
ui->txtNull->setFont(textFont);
ui->txtBlob->setFont(textFont);
}