summaryrefslogtreecommitdiffstats
path: root/desktop-widgets
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2016-12-31 21:17:20 -0800
committerGravatar Miika Turkia <miika.turkia@gmail.com>2017-01-01 14:23:49 +0200
commitf9d9e0324de67906d0868218d36bc478cfc97be1 (patch)
tree5778bd8d1aa169747695847f0941aff2b5fadfc7 /desktop-widgets
parente89c205990d3f34901a978f82628a691fd137a0d (diff)
downloadsubsurface-f9d9e0324de67906d0868218d36bc478cfc97be1.tar.gz
Mac: more generous margins for table columns
Fixes #974 Fixes #873 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'desktop-widgets')
-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()