Fix #4148: Inline text-view controls show the arrow cursor, not the I-beam - #4170
Open
christophwille wants to merge 1 commit into
Open
christophwille wants to merge 1 commit into
christophwille wants to merge 1 commit into
Conversation
…-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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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'sCursorproperty is inherited. Every control embedded throughISmartTextOutput.AddUIElementis a visual child of the text view, so it inherited the I-beam unless it set its own cursor. OnlySmartTextOutputExtensions.AddButtonhad 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.ConstructElementnow defaults a freshly realised inline control to the existingDecompilerTextView.ArrowCursorwhen 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 inAddButtonis removed.Test:
InlineUIElementCursorTestsboots 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 reportedIbeam), green after. FullILSpy.Testssuite passes (1302 passed, 4 skipped).Assisted-by: Claude:claude-fable-5-1:Claude Code
🤖 Generated with Claude Code