mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
Mac: more generous margins for table columns
Fixes #974 Fixes #873 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
e89c205990
commit
f9d9e0324d
1 changed files with 6 additions and 1 deletions
|
@ -135,8 +135,13 @@ void TableView::edit(const QModelIndex &index)
|
||||||
|
|
||||||
int TableView::defaultColumnWidth(int col)
|
int TableView::defaultColumnWidth(int col)
|
||||||
{
|
{
|
||||||
|
int width;
|
||||||
QString text = ui.tableView->model()->headerData(col, Qt::Horizontal).toString();
|
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()
|
QTableView *TableView::view()
|
||||||
|
|
Loading…
Reference in a new issue