Skip to content

Fix #4148: Inline text-view controls show the arrow cursor, not the I-beam - #4170

Open
christophwille wants to merge 1 commit into
masterfrom
fix/4148-inline-control-cursor
Open

christophwille wants to merge 1 commit into
masterfrom
fix/4148-inline-control-cursor

Conversation

@christophwille

Copy link
Copy Markdown
Member

Fixes #4148.

Hovering the "Check Again" button and the auto-update checkbox on the About page showed the text I-beam instead of the arrow.

Root cause: AvaloniaEdit sets the I-beam on the whole TextArea, and Avalonia's Cursor property is inherited. Every control embedded through ISmartTextOutput.AddUIElement is a visual child of the text view, so it inherited the I-beam unless it set its own cursor. Only SmartTextOutputExtensions.AddButton had worked around this, for its single button; the About page's update section, the resource previews and the C# warning panel were all affected.

Fix: UIElementGenerator.ConstructElement now defaults a freshly realised inline control to the existing DecompilerTextView.ArrowCursor when the factory did not set one. Children inherit it, so this covers every inline element in one place. A factory that sets its own cursor (e.g. a hand on a link) keeps it. The per-button workaround in AddButton is removed.

Test: InlineUIElementCursorTests boots to the startup About page, finds the realised checkbox and update button under the text view and asserts both carry the arrow while the text area keeps its I-beam. Red before the fix (checkbox reported Ibeam), green after. Full ILSpy.Tests suite passes (1302 passed, 4 skipped).

Assisted-by: Claude:claude-fable-5-1:Claude Code

🤖 Generated with Claude Code

…-beam

AvaloniaEdit sets the I-beam on the whole text area and Avalonia's Cursor
property is inherited, so every control embedded through AddUIElement (the
About page's update button and checkbox, resource previews, the warning panel)
showed the text cursor unless it set its own. AddButton had patched this for
its single button only. Defaulting the cursor once, where UIElementGenerator
realises the control, covers every inline element while still letting a
factory that sets its own cursor keep it.

Assisted-by: Claude:claude-fable-5-1:Claude Code

This branch has not been deployed

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Incorrect cursor when hovering over button and check box on 'About' tab

1 participant