mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-25 10:48:41 +00:00
LibGUI: Allow rollback of model editing delegate input
In the StringModelEditingDelegate convenience class, we simply hook up the escape key to editor rollback. This means you can cancel an ongoing cell edit by pressing escape. :^)
This commit is contained in:
@@ -147,6 +147,10 @@ void AbstractView::begin_editing(const ModelIndex& index)
|
||||
model()->set_data(m_edit_index, m_editing_delegate->value());
|
||||
stop_editing();
|
||||
};
|
||||
m_editing_delegate->on_rollback = [this] {
|
||||
ASSERT(model());
|
||||
stop_editing();
|
||||
};
|
||||
}
|
||||
|
||||
void AbstractView::stop_editing()
|
||||
|
||||
Reference in New Issue
Block a user