Apply changed font settings to edit dock without restart

See issue #894.
This commit is contained in:
Martin Kleusberg
2016-12-19 19:43:28 +01:00
parent 62bfeb03fa
commit f62d78ce15
3 changed files with 14 additions and 7 deletions

View File

@@ -33,14 +33,10 @@ EditDialog::EditDialog(QWidget* parent)
QShortcut* ins = new QShortcut(QKeySequence(Qt::Key_Insert), this);
connect(ins, SIGNAL(activated()), this, SLOT(toggleOverwriteMode()));
// Set the font for the text and hex editors
QFont editorFont(Settings::getSettingsValue("databrowser", "font").toString());
editorFont.setPointSize(Settings::getSettingsValue("databrowser", "fontsize").toInt());
ui->editorText->setFont(editorFont);
hexEdit->setFont(editorFont);
connect(ui->editorText, SIGNAL(textChanged()), this, SLOT(updateApplyButton()));
connect(hexEdit, SIGNAL(dataChanged()), this, SLOT(updateApplyButton()));
reloadSettings();
}
EditDialog::~EditDialog()
@@ -545,3 +541,12 @@ QString EditDialog::humanReadableSize(double byteCount)
return size + " " + yiUnit + "B";
}
void EditDialog::reloadSettings()
{
// Set the font for the text and hex editors
QFont editorFont(Settings::getSettingsValue("databrowser", "font").toString());
editorFont.setPointSize(Settings::getSettingsValue("databrowser", "fontsize").toInt());
ui->editorText->setFont(editorFont);
hexEdit->setFont(editorFont);
}

View File

@@ -24,6 +24,7 @@ public slots:
virtual void setFocus();
virtual void reject();
void setReadOnly(bool ro);
void reloadSettings();
protected:
virtual void showEvent(QShowEvent* ev);

View File

@@ -1681,11 +1681,12 @@ void MainWindow::reloadSettings()
sqlArea->getResultView()->setFont(logfont);
}
// Set font for SQL logs
// Set font for SQL logs and edit dialog
ui->editLogApplication->reloadSettings();
ui->editLogUser->reloadSettings();
ui->editLogApplication->setFont(logfont);
ui->editLogUser->setFont(logfont);
editDock->reloadSettings();
// Load extensions
loadExtensionsFromSettings();