mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-20 02:50:46 -06:00
Apply changed font settings to edit dock without restart
See issue #894.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ public slots:
|
||||
virtual void setFocus();
|
||||
virtual void reject();
|
||||
void setReadOnly(bool ro);
|
||||
void reloadSettings();
|
||||
|
||||
protected:
|
||||
virtual void showEvent(QShowEvent* ev);
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user