mirror of
https://github.com/RGBCube/serenity
synced 2025-05-20 11:45:06 +00:00
LibGUI: Make Del/Backspace clear cell w/ "any key pressed" edit trigger
This doesn't feel 100% right but it's better than inserting some goofy whitespace when pressing these keys.
This commit is contained in:
parent
87f36b0852
commit
b084411258
1 changed files with 6 additions and 2 deletions
|
@ -186,8 +186,12 @@ void TableView::keydown_event(KeyEvent& event)
|
|||
|
||||
if (is_editable() && edit_triggers() & EditTrigger::AnyKeyPressed && !event.text().is_empty()) {
|
||||
begin_editing(cursor_index());
|
||||
if (m_editing_delegate)
|
||||
m_editing_delegate->set_value(event.text());
|
||||
if (m_editing_delegate) {
|
||||
if (event.key() == KeyCode::Key_Delete || event.key() == KeyCode::Key_Backspace)
|
||||
m_editing_delegate->set_value(String::empty());
|
||||
else
|
||||
m_editing_delegate->set_value(event.text());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue