mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 04:09:13 +00:00
LibGUI: Add optional placeholder to TextEditor
This lets you show some disabled text when no text is entered, and the editor is not focused.
This commit is contained in:
parent
5b6ccbb918
commit
fa96e57c15
Notes:
sideshowbarker
2024-07-19 02:18:01 +09:00
Author: https://github.com/petelliott
Commit: fa96e57c15
Pull-request: https://github.com/SerenityOS/serenity/pull/3569
4 changed files with 19 additions and 1 deletions
|
@ -675,6 +675,11 @@ void TextDocument::remove(const TextRange& unnormalized_range)
|
|||
notify_did_change();
|
||||
}
|
||||
|
||||
bool TextDocument::is_empty() const
|
||||
{
|
||||
return line_count() == 1 && line(0).is_empty();
|
||||
}
|
||||
|
||||
TextRange TextDocument::range_for_entire_line(size_t line_index) const
|
||||
{
|
||||
if (line_index >= line_count())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue