Skip to content

widget: add Disableable support to Hyperlink - #6498

Open
AmeeteSh-A wants to merge 4 commits into
fyne-io:developfrom
AmeeteSh-A:feature-disable-hyperlink
Open

widget: add Disableable support to Hyperlink#6498
AmeeteSh-A wants to merge 4 commits into
fyne-io:developfrom
AmeeteSh-A:feature-disable-hyperlink

Conversation

@AmeeteSh-A

Copy link
Copy Markdown
Contributor

Description:

This PR adds Disableable support to widget.Hyperlink as discussed in the issue. It implements the standard fyne.Disableable interface (Disable(), Enable(), and Disabled()).

When disabled:

  • The hyperlink text and underline render in theme.DisabledColor() instead of the primary color.
  • The cursor remains the default pointer on hover.
  • Click and Spacebar events are ignored.

Fixes #6455

Checklist:

  • Tests included.
  • Lint and formatter run with no errors.
  • Tests all pass.

Where applicable:

  • Public APIs match existing style and have Since: line.

@dweymouth dweymouth left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I briefly looked into implementing this myself, but realized it would be complicated as the disable state needs to be propagated to the "sibling" hyperlinks (ie when a HyperlinkSegment wraps in RichText so it is rendered by multiple actual Hyperlinks that are linked together). This PR will have to address that as well to be mergeable.

@AmeeteSh-A

Copy link
Copy Markdown
Contributor Author

I briefly looked into implementing this myself, but realized it would be complicated as the disable state needs to be propagated to the "sibling" hyperlinks (ie when a HyperlinkSegment wraps in RichText so it is rendered by multiple actual Hyperlinks that are linked together). This PR will have to address that as well to be mergeable.

I've added a setDisabled helper that properly propagates the disabled state (and clears hover/focus) across all sibling hyperlinks when wrapped.

@AmeeteSh-A
AmeeteSh-A requested a review from dweymouth August 25, 2026 05:04
Comment thread widget/hyperlink.go
return hl.disabled
}

// setDisabled updates the disabled state without propagating back to siblings, avoiding recursion.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why does this comment mention siblings and recursion? A setter does not normally recurse or notify other areas, so why would that be expected in this setter?

@andydotxyz andydotxyz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Just adding a note here, it looks like AI comments talking about changes that are no longer relevant in the final PR

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.

Add Disableable support to widget.Hyperlink

3 participants