mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-11 01:06:01 +03:00
LibGUI: Return focus to view when stopping editing
If the editing widget (as provided by the editing delegate) was focused when editing stops, have the view take back focus.
This commit is contained in:
parent
032f567422
commit
0f0b37d137
Notes:
sideshowbarker
2024-07-19 03:12:08 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/0f0b37d1372
@ -151,11 +151,15 @@ void AbstractView::begin_editing(const ModelIndex& index)
|
||||
|
||||
void AbstractView::stop_editing()
|
||||
{
|
||||
bool take_back_focus = false;
|
||||
m_edit_index = {};
|
||||
if (m_edit_widget) {
|
||||
take_back_focus = m_edit_widget->is_focused();
|
||||
remove_child(*m_edit_widget);
|
||||
m_edit_widget = nullptr;
|
||||
}
|
||||
if (take_back_focus)
|
||||
set_focus(true);
|
||||
}
|
||||
|
||||
void AbstractView::activate(const ModelIndex& index)
|
||||
|
Loading…
Reference in New Issue
Block a user