widget: add Disableable support to Hyperlink - #6498
Conversation
dweymouth
left a comment
There was a problem hiding this comment.
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. |
| return hl.disabled | ||
| } | ||
|
|
||
| // setDisabled updates the disabled state without propagating back to siblings, avoiding recursion. |
There was a problem hiding this comment.
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
left a comment
There was a problem hiding this comment.
Just adding a note here, it looks like AI comments talking about changes that are no longer relevant in the final PR
Description:
This PR adds
Disableablesupport towidget.Hyperlinkas discussed in the issue. It implements the standardfyne.Disableableinterface (Disable(),Enable(), andDisabled()).When disabled:
theme.DisabledColor()instead of the primary color.Fixes #6455
Checklist:
Where applicable: