Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GUI] coin-control: remove column checkbox extra white space in tree-mode #2070

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/qt/coincontroldialog.cpp
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
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