mirror of
https://github.com/RGBCube/serenity
synced 2025-05-16 10:44:57 +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:
parent
c43f0f012d
commit
12dfeb9845
2 changed files with 13 additions and 0 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue