Skip to content

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

Closed
@dweymouth

Description

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions