mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-13 10:26:37 +02:00
FontEditor: Add text box for editing the font name.
This commit is contained in:
Notes:
sideshowbarker
2024-07-19 15:53:26 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/663aad40365
@@ -68,6 +68,8 @@ void GTextBox::handle_backspace()
|
||||
if (m_text.length() == 1) {
|
||||
m_text = String::empty();
|
||||
m_cursor_position = 0;
|
||||
if (on_change)
|
||||
on_change(*this);
|
||||
update();
|
||||
return;
|
||||
}
|
||||
@@ -80,6 +82,8 @@ void GTextBox::handle_backspace()
|
||||
|
||||
m_text = move(new_text);
|
||||
--m_cursor_position;
|
||||
if (on_change)
|
||||
on_change(*this);
|
||||
update();
|
||||
}
|
||||
|
||||
@@ -118,6 +122,8 @@ void GTextBox::keydown_event(GKeyEvent& event)
|
||||
|
||||
m_text = move(new_text);
|
||||
++m_cursor_position;
|
||||
if (on_change)
|
||||
on_change(*this);
|
||||
update();
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user