mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
d8f756fe14
commit
10351b3495
2 changed files with 41 additions and 7 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue