If master (89a1f7a250ef70ff2d65701564f1e24bb9280d90) is compiled without QR support, the "Request payment to..." dialog looks ugly:

With this PR:



Other minor changes:
- "URI" abbreviation is not translated now
- wallet name is shown if available
If master (89a1f7a250ef70ff2d65701564f1e24bb9280d90) is compiled without QR support, the "Request payment to..." dialog looks ugly:

With this PR:



Other minor changes:
49 | @@ -50,7 +50,7 @@ 50 | <property name="minimumSize"> 51 | <size> 52 | <width>0</width> 53 | - <height>50</height> 54 | + <height>176</height>
We should really try to avoid relying on hardcoded heights. The necessary heght varies based on things such as font size, DPI, styling.
Indeed. Can we make the whole dialog floating (dynamic height)?
We should really try to avoid relying on hardcoded heights. The necessary heght varies based on things such as font size, DPI, styling
Right, but #17597 (comment)
Wasn't there some other way to pack the window?
We should really try to avoid relying on hardcoded heights.
We use hardcoded sizes as defaults/minimums/maximums for all windows now.
The necessary heght varies based on things such as font size, DPI, styling.
Currently, we rely on window resizing.
This PR changes default/minimum heights and the dialog always could be resized automagically, if QR image is supplied, or manually.
The problem is that these values can be tweaked until eternity, no two people with different OS / configuration are going to arrive at exactly the same value.
Haven't tested it yet but I think just a this->adjustSize() would do the job better
Haven't tested it yet but I think just a
this->adjustSize()would do the job better
IMO, QWidget::adjustSize() should not be used to fix a broken layout.
It first was introduced in our repo in #16971, but I agree with @promag's #16971 (comment) and @Sjors's #16971 (comment).
@laanwj @jonasschnelli @emilengler Thank you for your reviews.
Wasn't there some other way to pack the window?
Yes, alternative QGridLayout layout is used in the latest push.
We should really try to avoid relying on hardcoded heights. The necessary heght varies based on things such as font size, DPI, styling.
All number in forms/receiverequestdialog.ui are just Qt Designer artefacts.
<!--e57a25ab6845829454e8d69fc972939a-->
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
<!--174a7506f384e20aa4161008e828411d-->
No conflicts as of last run.
It seems Travis is happy now.
@practicalswift w.r.t. #17658 (comment) would mind reviewing this PR?
I would keep the buttons at the bottom of the dialog, consistent with other dialogs. It doesn't look very nice on macOS, especially with long translations:
<img width="703" alt="Schermafbeelding 2019-12-10 om 13 39 16" src="https://user-images.githubusercontent.com/10217/70530511-5cb7b400-1b53-11ea-8f51-3d671b555917.png">
Otherwise code in 23138de looks good and it behaves. I also tried --without-qrencode
Much better. ACK cc88011
220 | + <set>Qt::TextSelectableByMouse</set> 221 | + </property> 222 | </widget> 223 | </item> 224 | - <item> 225 | - <widget class="QTextEdit" name="outUri">
The QTextEdit widget made it more obvious to users they could select...
Since QTextEdit inherits QAbstractScrollArea with very loose size policy, it is the point of this PR to get rid of it.
... then Concept NACK I guess
Without QTextEdit, you won't be able to select and copy everything together.
Without QTextEdit, you won't be able to select and copy everything together.
Maybe a new button "Copy ALL" could help? Also all info, except a wallet name, is encoded in the URI.
Sounds like a hack
There's a copy-URI button which copies the URI. You can tripple click on the URI itself to select it.
The QTextEdit used to cover all fields. Tripple click in that edit field wouldn't select the URI, but everything, which doesn't seem useful.
268 | + </property> 269 | + <property name="wordWrap"> 270 | <bool>true</bool> 271 | </property> 272 | <property name="textInteractionFlags"> 273 | - <set>Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
Selection by keyboard can be nice...
279 | @@ -115,7 +280,7 @@ 280 | <item> 281 | <widget class="QDialogButtonBox" name="buttonBox"> 282 | <property name="standardButtons"> 283 | - <set>QDialogButtonBox::Close</set>
Close seems more correct.
From QDialogButtonBox docs:
AcceptRole.RejectRole.It seems the AcceptRole is more appropriate for interaction with this dialog.
Also see @promag's comment.
83 | - html += "<b>"+tr("Label")+"</b>: " + GUIUtil::HtmlEscape(info.label) + "<br>"; 84 | - if(!info.message.isEmpty()) 85 | - html += "<b>"+tr("Message")+"</b>: " + GUIUtil::HtmlEscape(info.message) + "<br>"; 86 | - if(model->isMultiwallet()) { 87 | - html += "<b>"+tr("Wallet")+"</b>: " + GUIUtil::HtmlEscape(model->getWalletName()) + "<br>"; 88 | + ui->uri_content->setText("<a href=\"" + uri + "\">" + GUIUtil::HtmlEscape(uri) + "</a>");
In a label, this becomes clickable.
I'm not sure why we linkify it (so it looks like a link?), but previously it wasn't a clickable link
I'm not sure why we linkify it (so it looks like a link?)...
It seems so.
... but previously it wasn't a clickable link
Agree, this change should be reverted.
Agree, this change should be reverted.
Done in the latest push.
69 | + <weight>75</weight> 70 | + <bold>true</bold> 71 | + </font> 72 | + </property> 73 | + <property name="text"> 74 | + <string notr="true">URI:</string>
This SHOULD be translated...
"URI" is a ubiquitous international abbreviation which does not require any translation, IMO. Refs:
src/qt/locale/*.tsWhat about languages which don't use Latin characters?
eg https://ur.wikipedia.org/wiki/%DB%8C%D9%88_%D8%A2%D8%B1_%D8%A2%D8%A6%DB%8C
What about languages which don't use Latin characters?
qt/locale/bitcoin_ur.ts does not translate "URI".
My native language does not use Latin characters, and "URI", "HTTP" etc are in use.
Probably best to let translators decide that. I doubt 99.9% of native English speakers even know what URI means.
Can you split the bugfix (height) from the controversial/problematic changes?
re-ACK b8e90f3bb36706fb08aadcc2731ee9596c3d7aed; only changes in the interface file, which I don't have strong feelings about.
It works, but the following also works
--- a/src/qt/forms/receiverequestdialog.ui
+++ b/src/qt/forms/receiverequestdialog.ui
@@ -6,8 +6,6 @@
<rect>
<x>0</x>
<y>0</y>
- <width>487</width>
- <height>597</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
diff --git a/src/qt/receiverequestdialog.cpp b/src/qt/receiverequestdialog.cpp
index b4fae7d78d..cfe0bc7d52 100644
--- a/src/qt/receiverequestdialog.cpp
+++ b/src/qt/receiverequestdialog.cpp
@@ -85,6 +85,7 @@ void ReceiveRequestDialog::update()
if (ui->lblQRCode->setQR(uri, info.address)) {
ui->btnSaveAs->setEnabled(true);
}
+ this->adjustSize();
}
void ReceiveRequestDialog::on_btnCopyURI_clicked()
which would make @luke-jr happy.
I think this is fine because the text area is scrollable - I mean that it's not really the same issue as the intro dialog.
Please don't close, I don't think this is controversial - I prefer structured GUI instead of a big text area.
I was just replying in regards to #17597 (review). However I wonder if there's really the need to copy the whole text - if so I think a "copy details" button works just fine.
Only thing I can point out is if read only line edits are preferable because it's obvious the text can be copied.
QFontMetrics should make it practical to set a minimum width for the textedit widget?
QLineEditcannot wrap lines, by design.
QLineEdit, QTextEdit.. I mean one that has it's clear the user can select/tab focus and copy. But feel free to ignore the suggestion.
This commit does not change behavior.
Rebased b8e90f3bb36706fb08aadcc2731ee9596c3d7aed -> 73529f0859c060087dd41e9e176fd4198d0f385f (pr17597.06 -> pr17597.07) due to the conflict with #15768.
Tested ACK 73529f0859c060087dd41e9e176fd4198d0f385f
master: <img width="599" alt="Bildschirmfoto 2020-05-29 um 09 53 21" src="https://user-images.githubusercontent.com/178464/83236148-582f9800-a193-11ea-912a-39e285dbaf70.png">
With this PR: <img width="627" alt="Bildschirmfoto 2020-05-29 um 09 57 03" src="https://user-images.githubusercontent.com/178464/83236169-5fef3c80-a193-11ea-82a5-73d043473d3f.png">
Disabled QRCode support: <img width="530" alt="Bildschirmfoto 2020-05-29 um 10 00 27" src="https://user-images.githubusercontent.com/178464/83236175-62ea2d00-a193-11ea-93de-4a7e88eaeb8e.png">