Skip to content

Commit

Permalink
GUI: ccontrol: remove column checkbox extra whitespace in tree mode
Browse files Browse the repository at this point in the history
Github-Pull: #2070
Rebased-From: fe4f556
  • Loading branch information
random-zebra authored and Fuzzbawls committed Dec 21, 2020
1 parent 1555406 commit 20bd97a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/qt/coincontroldialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ CoinControlDialog::CoinControlDialog(QWidget* parent, bool _forDelegation) : QDi
// Toggle lock state
connect(ui->pushButtonToggleLock, &QPushButton::clicked, this, &CoinControlDialog::buttonToggleLockClicked);

ui->treeWidget->setColumnWidth(COLUMN_CHECKBOX, 100);
ui->treeWidget->setColumnWidth(COLUMN_CHECKBOX, colCheckBoxWidth_treeMode);
ui->treeWidget->setColumnWidth(COLUMN_AMOUNT, 110);
ui->treeWidget->setColumnWidth(COLUMN_LABEL, 160);
ui->treeWidget->setColumnWidth(COLUMN_ADDRESS, 310);
Expand Down Expand Up @@ -795,6 +795,13 @@ void CoinControlDialog::updateView()
for (int i = 0; i < ui->treeWidget->topLevelItemCount(); i++)
if (ui->treeWidget->topLevelItem(i)->checkState(COLUMN_CHECKBOX) == Qt::PartiallyChecked)
ui->treeWidget->topLevelItem(i)->setExpanded(true);
// restore saved width for COLUMN_CHECKBOX
ui->treeWidget->setColumnWidth(COLUMN_CHECKBOX, colCheckBoxWidth_treeMode);
} else {
// save COLUMN_CHECKBOX width for tree-mode
colCheckBoxWidth_treeMode = std::max(110, ui->treeWidget->columnWidth(COLUMN_CHECKBOX));
// minimize COLUMN_CHECKBOX width in list-mode (need to display only the check box)
ui->treeWidget->resizeColumnToContents(COLUMN_CHECKBOX);
}

// sort view
Expand Down
1 change: 1 addition & 0 deletions src/qt/coincontroldialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ class CoinControlDialog : public QDialog
int sortColumn;
Qt::SortOrder sortOrder;
bool forDelegation;
int colCheckBoxWidth_treeMode{110};
// pair (recipient amount, ishielded recipient)
std::vector<std::pair<CAmount, bool>> payAmounts{};
unsigned int nSelectableInputs{0};
Expand Down

0 comments on commit 20bd97a

Please sign in to comment.