AvaloniaUI / AvaloniaEdit

Avalonia-based text editor (port of AvalonEdit)
MIT License
702 stars 138 forks source link

[WIP] Fix Completion Tooltip Placement #386

Closed HendrikMennen closed 7 months ago

HendrikMennen commented 7 months ago

EDIT

I noticed in some cases with long completionlists this does not work well, I will try to find another way.

When scrolling down the tooltip position cannot always be taken from the container, because the container is not always generated at this point. I fixed this by simply placing the tooltip to the bottom whenever this happens.

Current Behaviour:

image

Expected:

image

HendrikMennen commented 7 months ago

Feels like it new or old code shouldn't be necessary, if we set tooltip on the specific ListBoxItem with right placement mode. But either way, a new code looks like a reasonable workaround.

I already tried setting the tooltip to the ListBoxItem directly, and used it this way for some time in my own fork, but this caused another issue: When the ListBoxItem is very long, that it enables horizontal scrolling, the tooltip will float far offscreen. image The only way I know to fix this would be with calculating an offset, any different idea?