Mac: more generous margins for table columns

Fixes #974
Fixes #873

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2016-12-31 21:17:20 -08:00 committed by Miika Turkia
parent e89c205990
commit f9d9e0324d

View file

@ -135,8 +135,13 @@ void TableView::edit(const QModelIndex &index)
int TableView::defaultColumnWidth(int col)
{
int width;
QString text = ui.tableView->model()->headerData(col, Qt::Horizontal).toString();
return text.isEmpty() ? metrics.rm_col_width : defaultModelFontMetrics().width(text) + 4; // add small margin
width = text.isEmpty() ? metrics.rm_col_width : defaultModelFontMetrics().width(text) + 4; // add small margin
#if defined(Q_OS_MAC)
width += 10; // Mac needs more margin
#endif
return width;
}
QTableView *TableView::view()