diff options
author | gubatron <gubatron@gmail.com> | 2014-03-21 01:45:47 -0400 |
---|---|---|
committer | gubatron <gubatron@gmail.com> | 2014-03-21 01:45:47 -0400 |
commit | 8c29273ff058f90dfa16a30b3d8457b842c0954d (patch) | |
tree | d6e52183eb06a512319343373ddc4a11e56b350b /src/qt/receivecoinsdialog.h | |
parent | 6539cfc583c5963fbb3138b99c1a8677970e0305 (diff) |
[QT] Fixes feel when resizing the last column on tables (issue #2862)
Re-submitting this pull request with a single commit.
This patch introduces a GUIUtil class that is used when setting up the 2 tables we have so far on the Qt-GUI.
In the past you could only resize the last column, which has BTC amounts from the right border of the column header, something that was rather unnatural.
If a new table were ever to be added to the interface, fixing the last columns resizing behavior is rather simple. Just look at how we initialize here a TableViewLastColumnResizingFixer object when setting up the table header's behavior, and then how we override the resize event of the component (can be the table, or the dialog) and we invoke columnResizingFixer->stretchColumnWidth(columnIndex);
Diffstat (limited to 'src/qt/receivecoinsdialog.h')
-rw-r--r-- | src/qt/receivecoinsdialog.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/qt/receivecoinsdialog.h b/src/qt/receivecoinsdialog.h index bfe8b3401f..1d051d9324 100644 --- a/src/qt/receivecoinsdialog.h +++ b/src/qt/receivecoinsdialog.h @@ -10,7 +10,9 @@ #include <QMenu> #include <QPoint> #include <QVariant> +#include <QHeaderView> #include <QItemSelection> +#include "guiutil.h" namespace Ui { class ReceiveCoinsDialog; @@ -28,11 +30,18 @@ class ReceiveCoinsDialog : public QDialog Q_OBJECT public: + enum ColumnWidths { + DATE_COLUMN_WIDTH = 130, + LABEL_COLUMN_WIDTH = 120, + AMOUNT_MINIMUM_COLUMN_WIDTH = 160, + MINIMUM_COLUMN_WIDTH = 130 + }; + explicit ReceiveCoinsDialog(QWidget *parent = 0); ~ReceiveCoinsDialog(); - void setModel(WalletModel *model); + public slots: void clear(); void reject(); @@ -43,9 +52,11 @@ protected: private: Ui::ReceiveCoinsDialog *ui; + GUIUtil::TableViewLastColumnResizingFixer *columnResizingFixer; WalletModel *model; QMenu *contextMenu; void copyColumnToClipboard(int column); + virtual void resizeEvent(QResizeEvent* event); private slots: void on_receiveButton_clicked(); |