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

QRImageWidget: Sizing and font fixups #506

Closed
wants to merge 3 commits into from

Conversation

luke-jr
Copy link
Member

@luke-jr luke-jr commented Dec 13, 2021

  • Margin of QRCode should be constant, not change based on complexity of QRCode
  • Text region should be sized based on height of actual text, not a constant guess
  • Width of image should not be adjusted based on vertical text size/margins
  • Adjusted constant QRCode and margin sizes to visually match what we had previously
  • If text won't fit, grow up to 25% wider, or split across multiple lines

(Note: Out of scope for this PR, after #497, I think we should allow customising the font used here and default to the embedded monospace for better privacy)

- Margin of QRCode should be constant, not change based on complexity of QRCode
- Text region should be sized based on height of actual text, not a constant guess
- Width of image should not be adjusted based on vertical text size/margins
- Adjusted constant QRCode and margin sizes to visually match what we had previously
…ines

This ensures even with a font we can't scale down enough, the text doesn't get cut off
…single-line text

Accomidates addresses that are just barely too long for the QRCode width
Copy link
Contributor

@promag promag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Concept ACK, however, I'll try a different approach for the multi-line case.

@promag
Copy link
Contributor

promag commented Dec 14, 2021

@luke-jr feel free to try the commit 0ac4f75 (branch) which avoids manual text wrap by using Qt::TextWrapAnywhere flag.

Another thing I noticed is that the default minimum font size in calculateIdealFontSize is too small.

@luke-jr
Copy link
Member Author

luke-jr commented Dec 14, 2021

        auto rect = fm.boundingRect(max_rect, Qt::AlignCenter, text);
        if (rect.width() > max_rect.width() * 5 / 4) {

Isn't this impossible? I find the unnecessary QRect usage hard to follow.

Another thing I noticed is that the default minimum font size in calculateIdealFontSize is too small.

IMO out of scope for this PR

@jarolrod jarolrod added the UI All about "look and feel" label Dec 14, 2021
@promag
Copy link
Contributor

promag commented Dec 14, 2021

Isn't this impossible?

No because it doesn't wrap.

I find the unnecessary QRect usage hard to follow.

And I think it's unnecessary to calculate lines and manually wrap the text. What is hard to follow?

@hebasto
Copy link
Member

hebasto commented Jun 1, 2022

@luke-jr Screenshots "before" and "after" in the PR description could be useful for further discussion.

@DrahtBot
Copy link
Contributor

DrahtBot commented Jun 12, 2022

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Reviews

See the guideline for information on the review process.

Type Reviewers
ACK pablomartin4btc
Concept ACK promag, jarolrod

If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

Conflicts

No conflicts as of last run.

Copy link
Member

@jarolrod jarolrod left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Concept ACK, stylistic changes look fine to me.

master PR (rebased)
Screen Shot 2022-06-28 at 2 11 01 AM Screen Shot 2022-06-28 at 2 12 19 AM

Copy link
Member

@hebasto hebasto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested 4c5143d.

This PR effectively renders font size smaller that makes it harder to read.

  • master branch:
    image

  • this PR:
    Screenshot from 2022-07-19 15-20-36

@DrahtBot
Copy link
Contributor

DrahtBot commented May 6, 2023

There hasn't been much activity lately. What is the status here?

Finding reviewers may take time. However, if the patch is no longer relevant, please close this pull request. If the author lost interest or time to work on this, please close it and mark it 'Up for grabs' with the label, so that it can be picked up in the future.

@hebasto
Copy link
Member

hebasto commented May 16, 2023

This #506 (review):

This PR effectively renders font size smaller that makes it harder to read.

remains unaddressed.

Copy link
Contributor

@pablomartin4btc pablomartin4btc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Concept ACK, I agree with the improvements on achieving a more consistent adjustment of the QR code image size. However, it appears that there is still an issue with the font size, which makes the address in the picture difficult to read. Is there a way to improve the legibility of the address text?

Copy link
Contributor

@pablomartin4btc pablomartin4btc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tested ACK 4c5143d

  • master:

Screenshot from 2023-09-17 18-52-45

  • this PR (rebased):

Screenshot from 2023-09-18 16-41-03

@DrahtBot
Copy link
Contributor

DrahtBot commented Feb 5, 2024

🤔 There hasn't been much activity lately and the CI seems to be failing.

If no one reviewed the current pull request by commit hash, a rebase can be considered. While the CI failure may be a false positive, the CI hasn't been running for some time, so there may be a real issue hiding as well. A rebase triggers the latest CI and makes sure that no silent merge conflicts have snuck in.

@hebasto
Copy link
Member

hebasto commented Feb 12, 2024

Closing due to lack of support from the PR author (#506 (comment), #506 (review)).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI failed UI All about "look and feel"
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants