From 888967988439c2d7f115d8818e96aaa916283c9b Mon Sep 17 00:00:00 2001
From: Dirk Hohndel <dirk@hohndel.org>
Date: Sat, 31 Dec 2016 21:17:20 -0800
Subject: Mac: more generous margins for table columns

Fixes #974
Fixes #873

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
---
 desktop-widgets/tableview.cpp | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

(limited to 'desktop-widgets')

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()
-- 
cgit v1.2.3-70-g09d2