| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent f28ecc0 commit c4b2ffc
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -212,8 +212,11 @@ TableBrowser::TableBrowser(QWidget* parent) : | |||
| 212 | 212 | ||
| 213 | 213 | connect(ui->dataTable, &ExtendedTableWidget::currentIndexChanged, this, [this](const QModelIndex ¤t, const QModelIndex &) { | |
| 214 | 214 | // Get cell current format for updating the format toolbar values. Block signals, so the format change is not reapplied. | |
| 215 | + QString font_string = m_model->data(current, Qt::FontRole).toString(); | ||
| 215 | 216 | QFont font; | |
| 216 | - font.fromString(m_model->data(current, Qt::FontRole).toString()); | ||
| 217 | + if(!font_string.isEmpty()) | ||
| 218 | + font.fromString(font_string); | ||
| 219 | + | ||
| 217 | 220 | ui->fontComboBox->blockSignals(true); | |
| 218 | 221 | ui->fontComboBox->setCurrentFont(font); | |
| 219 | 222 | ui->fontComboBox->blockSignals(false); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -353,7 +353,7 @@ QVariant SqliteTableModel::data(const QModelIndex &index, int role) const | |||
| 353 | 353 | return QVariant(); | |
| 354 | 354 | return decode(data); | |
| 355 | 355 | } else if(role == Qt::FontRole) { | |
| 356 | - QFont font; | ||
| 356 | + QFont font = m_font; | ||
| 357 | 357 | if(!row_available || data.isNull() || isBinary(data)) | |
| 358 | 358 | font.setItalic(true); | |
| 359 | 359 | else { | |
@@ -1175,6 +1175,8 @@ void SqliteTableModel::reloadSettings() | |||
| 1175 | 1175 | m_nullBgColour = QColor(Settings::getValue("databrowser", "null_bg_colour").toString()); | |
| 1176 | 1176 | m_binFgColour = QColor(Settings::getValue("databrowser", "bin_fg_colour").toString()); | |
| 1177 | 1177 | m_binBgColour = QColor(Settings::getValue("databrowser", "bin_bg_colour").toString()); | |
| 1178 | + m_font = QFont(Settings::getValue("databrowser", "font").toString()); | ||
| 1179 | + m_font.setPointSize(Settings::getValue("databrowser", "fontsize").toInt()); | ||
| 1178 | 1180 | m_symbolLimit = Settings::getValue("databrowser", "symbol_limit").toInt(); | |
| 1179 | 1181 | m_imagePreviewEnabled = Settings::getValue("databrowser", "image_preview").toBool(); | |
| 1180 | 1182 | m_chunkSize = static_cast<std::size_t>(Settings::getValue("db", "prefetchsize").toUInt()); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -3,6 +3,7 @@ | |||
| 3 | 3 | ||
| 4 | 4 | #include <QAbstractTableModel> | |
| 5 | 5 | #include <QColor> | |
| 6 | + #include <QFont> | ||
| 6 | 7 | ||
| 7 | 8 | #include <map> | |
| 8 | 9 | #include <memory> | |
@@ -235,6 +236,7 @@ public slots: | |||
| 235 | 236 | QColor m_nullBgColour; | |
| 236 | 237 | QColor m_binFgColour; | |
| 237 | 238 | QColor m_binBgColour; | |
| 239 | + QFont m_font; | ||
| 238 | 240 | int m_symbolLimit; | |
| 239 | 241 | bool m_imagePreviewEnabled; | |
| 240 | 242 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments