mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-20 02:50:46 -06:00
Try setting a saner default row height in the data browser
Maybe this helps with issue #419.
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
#include "sqlitetablemodel.h"
|
||||
#include "FilterTableHeader.h"
|
||||
#include "sqlitetypes.h"
|
||||
#include "Settings.h"
|
||||
|
||||
#include <QApplication>
|
||||
#include <QClipboard>
|
||||
@@ -77,6 +78,17 @@ ExtendedTableWidget::ExtendedTableWidget(QWidget* parent) :
|
||||
verticalHeader()->setContextMenuPolicy(Qt::CustomContextMenu);
|
||||
}
|
||||
|
||||
void ExtendedTableWidget::reloadSettings()
|
||||
{
|
||||
// Set the new font and font size
|
||||
QFont dataBrowserFont(Settings::getValue("databrowser", "font").toString());
|
||||
dataBrowserFont.setPointSize(Settings::getValue("databrowser", "fontsize").toInt());
|
||||
setFont(dataBrowserFont);
|
||||
|
||||
// Set new default row height depending on the font size
|
||||
verticalHeader()->setDefaultSectionSize(verticalHeader()->fontMetrics().height()+10);
|
||||
}
|
||||
|
||||
void ExtendedTableWidget::copy()
|
||||
{
|
||||
QModelIndexList indices = selectionModel()->selectedIndexes();
|
||||
|
||||
@@ -20,6 +20,9 @@ public:
|
||||
public:
|
||||
QSet<int> selectedCols();
|
||||
|
||||
public slots:
|
||||
void reloadSettings();
|
||||
|
||||
signals:
|
||||
void foreignKeyClicked(const QString& table, const QString& column, const QByteArray& value);
|
||||
void switchTable(bool next); // 'next' parameter is set to true if next table should be selected and to false if previous table should be selected
|
||||
|
||||
@@ -1692,9 +1692,7 @@ void MainWindow::loadExtensionsFromSettings()
|
||||
void MainWindow::reloadSettings()
|
||||
{
|
||||
// Set data browser font
|
||||
QFont dataBrowserFont(Settings::getValue("databrowser", "font").toString());
|
||||
dataBrowserFont.setPointSize(Settings::getValue("databrowser", "fontsize").toInt());
|
||||
ui->dataTable->setFont(dataBrowserFont);
|
||||
ui->dataTable->reloadSettings();
|
||||
|
||||
// Set prefetch sizes for lazy population of table models
|
||||
m_browseTableModel->setChunkSize(Settings::getValue("db", "prefetchsize").toInt());
|
||||
|
||||
Reference in New Issue
Block a user