summaryrefslogtreecommitdiffstats
path: root/qt-ui/tableview.h
diff options
context:
space:
mode:
authorGravatar Giuseppe Bilotta <giuseppe.bilotta@gmail.com>2014-10-15 15:30:48 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-10-18 15:15:58 -0700
commit10351b34955a2a008269e489acde9bc084e3aa43 (patch)
tree68a0d581af98524bd8a2bbabed492725b48e2749 /qt-ui/tableview.h
parentd8f756fe1471b5f1ac7be16d922b87256c0cded6 (diff)
downloadsubsurface-10351b34955a2a008269e489acde9bc084e3aa43.tar.gz
Make TableView resolution independent
Don't hard-code column widths or icon sizes/positions. Instead, compute them from the fonts used. Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/tableview.h')
-rw-r--r--qt-ui/tableview.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/qt-ui/tableview.h b/qt-ui/tableview.h
index d2289b2d9..00d770842 100644
--- a/qt-ui/tableview.h
+++ b/qt-ui/tableview.h
@@ -16,6 +16,15 @@ class QTableView;
class TableView : public QWidget {
Q_OBJECT
+
+ struct TableMetrics {
+ int icon_size; // icon size
+ int btn_size; // button size
+ int btn_gap; // button gap
+ int col_width; // generic column width
+ int rm_col_width; // column width of REMOVE column
+ int header_ht; // height of the header
+ };
public:
TableView(QWidget *parent = 0);
virtual ~TableView();
@@ -28,6 +37,7 @@ public:
void setBtnToolTip(const QString &tooltip);
void fixPlusPosition();
void edit(const QModelIndex &index);
+ int defaultColumnWidth(int col); // default column width for column col
QTableView *view();
protected:
@@ -40,6 +50,7 @@ signals:
private:
Ui::TableView ui;
QPushButton *plusBtn;
+ TableMetrics metrics;
};
#endif // TABLEVIEW_H