diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index 33f4d6e0..6cb9909b 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -1421,6 +1421,11 @@ void MainWindow::reloadSettings() logfont.setStyleHint(QFont::TypeWriter); logfont.setPointSize(log_fontsize); + // Set data browser font + QFont dataBrowserFont(PreferencesDialog::getSettingsValue("databrowser", "font").toString()); + dataBrowserFont.setPointSize(PreferencesDialog::getSettingsValue("databrowser", "fontsize").toInt()); + ui->dataTable->setFont(dataBrowserFont); + // Set prefetch sizes for lazy population of table models m_browseTableModel->setChunkSize(prefetch_size); for(int i=0; i < ui->tabSqlAreas->count(); ++i) diff --git a/src/PreferencesDialog.cpp b/src/PreferencesDialog.cpp index 9f49cb23..0be1f5f1 100644 --- a/src/PreferencesDialog.cpp +++ b/src/PreferencesDialog.cpp @@ -62,6 +62,8 @@ void PreferencesDialog::loadSettings() ui->foreignKeysCheckBox->setChecked(getSettingsValue("db", "foreignkeys").toBool()); ui->spinPrefetchSize->setValue(getSettingsValue("db", "prefetchsize").toInt()); + ui->comboDataBrowserFont->setCurrentIndex(ui->comboEditorFont->findText(getSettingsValue("databrowser", "font").toString())); + ui->spinDataBrowserFontSize->setValue(getSettingsValue("databrowser", "fontsize").toInt()); loadColorSetting(ui->fr_null_fg, "null_fg"); loadColorSetting(ui->fr_null_bg, "null_bg"); loadColorSetting(ui->fr_reg_fg, "reg_fg"); @@ -108,6 +110,8 @@ void PreferencesDialog::saveSettings() setSettingsValue("checkversion", "enabled", ui->checkUpdates->isChecked()); + setSettingsValue("databrowser", "font", ui->comboDataBrowserFont->currentText()); + setSettingsValue("databrowser", "fontsize", ui->spinDataBrowserFontSize->value()); saveColorSetting(ui->fr_null_fg, "null_fg"); saveColorSetting(ui->fr_null_bg, "null_bg"); saveColorSetting(ui->fr_reg_fg, "reg_fg"); @@ -240,6 +244,10 @@ QVariant PreferencesDialog::getSettingsDefaultValue(const QString& group, const // Data Browser/NULL Fields if(group == "databrowser") { + if(name == "font") + return "Sans Serif"; + if(name == "fontsize") + return 10; if (name == "null_text") return "NULL"; if (name == "null_fg_colour") diff --git a/src/PreferencesDialog.ui b/src/PreferencesDialog.ui index e2df06bb..49d3e3fc 100644 --- a/src/PreferencesDialog.ui +++ b/src/PreferencesDialog.ui @@ -7,7 +7,7 @@ 0 0 590 - 405 + 426 @@ -202,7 +202,7 @@ - Remove line breaks in schema view + Remove line breaks in schema &view checkHideSchemaLinebreaks @@ -215,7 +215,7 @@ - &Prefetch block size + Prefetch block si&ze spinPrefetchSize @@ -252,66 +252,49 @@ Data &Browser - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - + + + + + Font + + + + + + &Font + + + comboDataBrowserFont + + + + + + + + + + Font si&ze: + + + spinDataBrowserFontSize + + + + + + + + + - - false - - - QGroupBox { - border: 1px solid gray; - border-radius: 4px; - margin-top: 1ex; -} - -QGroupBox::title { - subcontrol-origin: margin; - subcontrol-position: top left; - left: 10px; - padding: 0 3px 0 3px; -} - NULL fields - - false - - - - 50 - - - 50 - + @@ -343,25 +326,8 @@ QGroupBox::title { - - false - - - QGroupBox { - border: 1px solid gray; - border-radius: 4px; - margin-top: 1ex; -} - -QGroupBox::title { - subcontrol-origin: margin; - subcontrol-position: top left; - left: 10px; - padding: 0 3px 0 3px; -} - - Fields colors + Field colors @@ -522,19 +488,6 @@ QGroupBox::title { - - - - Qt::Vertical - - - - 20 - 274 - - - - @@ -793,7 +746,7 @@ QGroupBox::title { - Horizontal tiling + Hori&zontal tiling checkHorizontalTiling @@ -916,6 +869,8 @@ QGroupBox::title { foreignKeysCheckBox checkHideSchemaLinebreaks spinPrefetchSize + comboDataBrowserFont + spinDataBrowserFontSize txtNull fr_null_fg fr_null_bg @@ -978,8 +933,8 @@ QGroupBox::title { addExtension() - 119 - 79 + 571 + 103 245 @@ -994,8 +949,8 @@ QGroupBox::title { removeExtension() - 119 - 79 + 571 + 141 245 @@ -1010,8 +965,8 @@ QGroupBox::title { showColourDialog(QTreeWidgetItem*,int) - 101 - 46 + 111 + 87 395