Issue #1450: resize Name column in DB Schema tab to contents

Resize also the Name column in the Dock since it has usually short content
and there is little space there, so it's better to resize it after every
schema population.
This commit is contained in:
mgrojo
2018-06-30 18:06:35 +02:00
parent 588363b7f6
commit a45a7a39c1

View File

@@ -125,7 +125,6 @@ void MainWindow::init()
// Set up DB schema dock
ui->treeSchemaDock->setModel(dbStructureModel);
ui->treeSchemaDock->setColumnWidth(DbStructureModel::ColumnName, 300);
ui->treeSchemaDock->setColumnHidden(DbStructureModel::ColumnObjectType, true);
ui->treeSchemaDock->setColumnHidden(DbStructureModel::ColumnSchema, true);
@@ -477,8 +476,13 @@ void MainWindow::populateStructure(const QString& old_table)
qobject_cast<SqlExecutionArea*>(ui->tabSqlAreas->widget(i))->getEditor()->reloadKeywords();
// Resize SQL column to fit contents
ui->dbTreeWidget->resizeColumnToContents(3);
ui->treeSchemaDock->resizeColumnToContents(3);
ui->dbTreeWidget->resizeColumnToContents(DbStructureModel::ColumnSQL);
ui->treeSchemaDock->resizeColumnToContents(DbStructureModel::ColumnSQL);
// Resize also the Name column in the Dock since it has usually
// short content and there is little space there.
ui->treeSchemaDock->resizeColumnToContents(DbStructureModel::ColumnName);
}
void MainWindow::clearTableBrowser()