mirror of
https://github.com/RGBCube/serenity
synced 2025-05-15 04:04:59 +00:00
FontEditor: Add text box for editing the font name.
This commit is contained in:
parent
5877feab1b
commit
663aad4036
5 changed files with 21 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue