AvaloniaUI / AvaloniaEdit

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

Add watermark support #464

Closed danipen closed 1 week ago

danipen commented 1 week ago

Support watermark text when the text in the text area is empty:

https://github.com/user-attachments/assets/4b28fc6b-d577-40e0-9e84-4869c92b6d1a

danipen commented 1 week ago

@Gillibald I have a question about IME here.

In the Avalonia's TextBox implementation you’re checking the TextPresenter’s preedit text to determine if we should display the watermark. Should we do the same for AvaloniaEdit? I see that the InputMethodClient in the TextArea doesn’t support preedit, so probably is not needed …