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

Hyperlink enhancement: underline and tappable area shouldn't be wider than the text label #3528

Closed
2 tasks done
dweymouth opened this issue Dec 31, 2022 · 1 comment
Closed
2 tasks done
Assignees
Labels
enhancement New feature or request

Comments

@dweymouth
Copy link
Contributor

dweymouth commented Dec 31, 2022

Checklist

  • I have searched the issue tracker for open issues that relate to the same feature, before opening a new one.
  • This issue only relates to a single feature. I will open new issues for any other features.

Is your feature request related to a problem?

If a hyperlink widget is placed in a layout that makes it wider than needed to fully display the text label, the full area of the hyperlink widget is tappable and the underline extends past the end of the text, the full width of the widget.

Is it possible to construct a solution with the existing API?

Yes, but it's really hacky:

  • If you want to support textwrap truncate, create a custom widget that extends (or wraps) a widget.Hyperlink and overrides minSize to return something sensible to keep it from shrinking to zero
  • place the widget.Hyperlink or your custom hyperlink wrapper above in a HBox container with a spacer, and use this container where you'd use widget.Hyperlink otherwise. The layout will shrink the hyperlink to only show the text and take up the rest of the space to the right with the spacer

Describe the solution you'd like to see.

Ideally, the desktop pointer should only change when hovering over the text label, tapping/clicking the widget outside the width of the text label should do nothing, and the visual underline should never extend past the width of the text.

@dweymouth
Copy link
Contributor Author

Fixed on develop for v2.4.4

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

No branches or pull requests

2 participants