Skip to content

Commit 81c533c

Browse files
author
MarcoFalke
committed
Merge #13158: [Qt]: Improve sendcoinsdialog readability
f08a385 [qt]: changes sendcoinsdialog's box layout for improved readability. (marcoagner) Pull request description: I'm addressing two (probably duplicate) issues: bitcoin/bitcoin#11606 and bitcoin/bitcoin#10613. Some points worth noting: - I've tried to balance the proposed changes on both issues without going too far and remaining a bit conservative. It will be easier to improve based on suggestions where necessary. - I preferred to maintain a layout that doesn't ask for an address truncation because, in my view, this wallet should be conservative on this. - I didn't follow the idea of aligning the amounts to the right for finding it more natural (and minimalist) to read the information without having to map alignments. Additionally, that approach seems to need more `<hr />`'s (or similar) in order to help the user to map information, which ended up cluttering the box too much (specially with multiple recipients). Thus, I preferred to just give some more space between recipients. Let me know if there are better ideas on this. Visually, I went from this (current): ![screenshot from 2018-05-03 15-11-30](https://user-images.githubusercontent.com/5016303/39581859-16abec82-4edc-11e8-86d3-eb722f8a7ed6.png) To this: ![screenshot from 2018-05-03 15-15-41](https://user-images.githubusercontent.com/5016303/39582066-96856adc-4edc-11e8-804c-468aec44cc8d.png) As a side note, while doing this, I thought about a better way to show fees and found there's already a PR on this (bitcoin/bitcoin#12189) and thought it is Tree-SHA512: e94b740fab6c1babd853a97be65c3b6f86ec174c975a926fde66b147f7a47e0cf0fa10f7255ba92aaba68c76a80dde8c688008179a34705a9799bf24d3c5cd46
2 parents c5870ab + f08a385 commit 81c533c

File tree

1 file changed

+29
-22
lines changed

1 file changed

+29
-22
lines changed

src/qt/sendcoinsdialog.cpp

Lines changed: 29 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -288,44 +288,60 @@ void SendCoinsDialog::on_sendButton_clicked()
288288
address.append("</span>");
289289

290290
QString recipientElement;
291+
recipientElement = "<br />";
291292

292293
if (!rcp.paymentRequest.IsInitialized()) // normal payment
293294
{
294295
if(rcp.label.length() > 0) // label with address
295296
{
296-
recipientElement = tr("%1 to %2").arg(amount, GUIUtil::HtmlEscape(rcp.label));
297+
recipientElement.append(tr("%1 to %2").arg(amount, GUIUtil::HtmlEscape(rcp.label)));
297298
recipientElement.append(QString(" (%1)").arg(address));
298299
}
299300
else // just address
300301
{
301-
recipientElement = tr("%1 to %2").arg(amount, address);
302+
recipientElement.append(tr("%1 to %2").arg(amount, address));
302303
}
303304
}
304305
else if(!rcp.authenticatedMerchant.isEmpty()) // authenticated payment request
305306
{
306-
recipientElement = tr("%1 to %2").arg(amount, GUIUtil::HtmlEscape(rcp.authenticatedMerchant));
307+
recipientElement.append(tr("%1 to %2").arg(amount, GUIUtil::HtmlEscape(rcp.authenticatedMerchant)));
307308
}
308309
else // unauthenticated payment request
309310
{
310-
recipientElement = tr("%1 to %2").arg(amount, address);
311+
recipientElement.append(tr("%1 to %2").arg(amount, address));
311312
}
312313

313314
formatted.append(recipientElement);
314315
}
315316

316317
QString questionString = tr("Are you sure you want to send?");
317-
questionString.append("<br /><br />%1");
318+
questionString.append("<br /><span style='font-size:10pt;'>");
319+
questionString.append(tr("Please, review your transaction."));
320+
questionString.append("</span><br />%1");
318321

319322
if(txFee > 0)
320323
{
321324
// append fee string if a fee is required
322-
questionString.append("<hr /><span style='color:#aa0000;'>");
323-
questionString.append(BitcoinUnits::formatHtmlWithUnit(model->getOptionsModel()->getDisplayUnit(), txFee));
324-
questionString.append("</span> ");
325-
questionString.append(tr("added as transaction fee"));
325+
questionString.append("<hr /><b>");
326+
questionString.append(tr("Transaction fee"));
327+
questionString.append("</b>");
326328

327329
// append transaction size
328-
questionString.append(" (" + QString::number((double)currentTransaction.getTransactionSize() / 1000) + " kB)");
330+
questionString.append(" (" + QString::number((double)currentTransaction.getTransactionSize() / 1000) + " kB): ");
331+
332+
// append transaction fee value
333+
questionString.append("<span style='color:#aa0000; font-weight:bold;'>");
334+
questionString.append(BitcoinUnits::formatHtmlWithUnit(model->getOptionsModel()->getDisplayUnit(), txFee));
335+
questionString.append("</span><br />");
336+
337+
// append RBF message according to transaction's signalling
338+
questionString.append("<span style='font-size:10pt; font-weight:normal;'>");
339+
if (ui->optInRBF->isChecked()) {
340+
questionString.append(tr("You can increase the fee later (signals Replace-By-Fee, BIP-125)."));
341+
} else {
342+
questionString.append(tr("Not signalling Replace-By-Fee, BIP-125."));
343+
}
344+
questionString.append("</span>");
329345
}
330346

331347
// add total amount in all subdivision units
@@ -337,19 +353,10 @@ void SendCoinsDialog::on_sendButton_clicked()
337353
if(u != model->getOptionsModel()->getDisplayUnit())
338354
alternativeUnits.append(BitcoinUnits::formatHtmlWithUnit(u, totalAmount));
339355
}
340-
questionString.append(tr("Total Amount %1")
356+
questionString.append(QString("<b>%1</b>: <b>%2</b>").arg(tr("Total Amount"))
341357
.arg(BitcoinUnits::formatHtmlWithUnit(model->getOptionsModel()->getDisplayUnit(), totalAmount)));
342-
questionString.append(QString("<span style='font-size:10pt;font-weight:normal;'><br />(=%1)</span>")
343-
.arg(alternativeUnits.join(" " + tr("or") + "<br />")));
344-
345-
questionString.append("<hr /><span>");
346-
if (ui->optInRBF->isChecked()) {
347-
questionString.append(tr("You can increase the fee later (signals Replace-By-Fee, BIP-125)."));
348-
} else {
349-
questionString.append(tr("Not signalling Replace-By-Fee, BIP-125."));
350-
}
351-
questionString.append("</span>");
352-
358+
questionString.append(QString("<br /><span style='font-size:10pt; font-weight:normal;'>(=%1)</span>")
359+
.arg(alternativeUnits.join(" " + tr("or") + " ")));
353360

354361
SendConfirmationDialog confirmationDialog(tr("Confirm send coins"),
355362
questionString.arg(formatted.join("<br />")), SEND_CONFIRM_DELAY, this);

0 commit comments

Comments
 (0)