Skip to content

[Bugfix] Solve raw hex display of OP_RETURN for non-latin alphabets #762

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

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

alvroble
Copy link
Contributor

@alvroble alvroble commented May 28, 2025

Description

This PR solves the wrong display of the raw hex OP_RETURN for non-latin alphabets.

Before:

PSBTOpReturnView_raw_hex_data

After:

Two options here:

Commit cfb5a5c: (this one may be just right if the TextArea is scrollable)
PSBTOpReturnView_raw_hex_data_1

Commit 2f1094e:
This one makes the screen to use always the default font size for the hex content.
PSBTOpReturnView_raw_hex_data

Include screenshots of any new or modified screens (or at least explain why they were omitted)

This pull request is categorized as a:

  • New feature
  • Bug fix
  • Code refactor
  • Documentation
  • Other

Checklist

  • I’ve run pytest and made sure all unit tests pass before sumbitting the PR

If you modified or added functionality/workflow, did you add new unit tests?

  • No, I’m a fool
  • Yes
  • N/A

I have tested this PR on the following platforms/os:

Note: Keep your changes limited in scope; if you uncover other issues or improvements along the way, ideally submit those as a separate PR. The more complicated the PR the harder to review, test, and merge.

@alvroble alvroble changed the title [Bugfix] Solve raw hex display of OP_RETURN for non-latin languages [Bugfix] Solve raw hex display of OP_RETURN for non-latin alphabets May 28, 2025
@@ -753,7 +763,7 @@ def __post_init__(self):
self.components.append(TextArea(
text=text,
font_name=GUIConstants.FIXED_WIDTH_FONT_NAME,
font_size=GUIConstants.get_body_font_size(),
font_size=GUIConstants.BODY_FONT_SIZE["default"],
Copy link
Contributor

Choose a reason for hiding this comment

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

I would add a comment here to explain why we want to force the default size here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Something like Use default font size for hex text readability?

@kdmukai
Copy link
Contributor

kdmukai commented Jun 10, 2025

I have not carefully reviewed all the changes, but my guess is that 2f1094e on its own is sufficient. Can you confirm?

@alvroble
Copy link
Contributor Author

For some reason, it isn't:
PSBTOpReturnView_raw_hex_data

That's why I refactored the code in cfb5a5c to go char by char filling the lines.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants