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
Right, but #17597 (comment)
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.
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.
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
No conflicts as of last run.
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:
Otherwise code in 23138de looks good and it behaves. I also tried --without-qrencode
220+ <set>Qt::TextSelectableByMouse</set>
221+ </property>
222 </widget>
223 </item>
224- <item>
225- <widget class="QTextEdit" name="outUri">
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.
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>
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>
“URI” is a ubiquitous international abbreviation which does not require any translation, IMO. Refs:
src/qt/locale/*.ts
What 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.
It works, but the following also works
0--- a/src/qt/forms/receiverequestdialog.ui
1+++ b/src/qt/forms/receiverequestdialog.ui
2@@ -6,8 +6,6 @@
3 <rect>
4 <x>0</x>
5 <y>0</y>
6- <width>487</width>
7- <height>597</height>
8 </rect>
9 </property>
10 <layout class="QVBoxLayout" name="verticalLayout_3">
11diff --git a/src/qt/receiverequestdialog.cpp b/src/qt/receiverequestdialog.cpp
12index b4fae7d78d..cfe0bc7d52 100644
13--- a/src/qt/receiverequestdialog.cpp
14+++ b/src/qt/receiverequestdialog.cpp
15@@ -85,6 +85,7 @@ void ReceiveRequestDialog::update()
16 if (ui->lblQRCode->setQR(uri, info.address)) {
17 ui->btnSaveAs->setEnabled(true);
18 }
19+ this->adjustSize();
20 }
21
22 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.
QLineEdit
cannot 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.
Tested ACK 73529f0859c060087dd41e9e176fd4198d0f385f
master:
With this PR:
Disabled QRCode support: