summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2016-12-31 21:17:20 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2016-12-31 21:17:20 -0800
commit888967988439c2d7f115d8818e96aaa916283c9b (patch)
tree17d717f5c3617dbe98b9dc7d2c00d2026666f554
parent76dfcdc14c0e3abf540d556ea1cf3b19add66a5f (diff)
downloadsubsurface-888967988439c2d7f115d8818e96aaa916283c9b.tar.gz
Mac: more generous margins for table columns
Fixes #974 Fixes #873 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--desktop-widgets/tableview.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/desktop-widgets/tableview.cpp b/desktop-widgets/tableview.cpp
index 20b62ac3c..3e9bb129e 100644
--- a/desktop-widgets/tableview.cpp
+++ b/desktop-widgets/tableview.cpp
@@ -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()