mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +00:00
LibGUI: Stop editing in views when the view is hidden
This fixes an issue in FileManager where an editor opened in the table view mode would remain open after switching to the icon mode.
This commit is contained in:
parent
53f3313cee
commit
d8553a6406
Notes:
sideshowbarker
2024-07-19 02:15:14 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/d8553a64064
2 changed files with 7 additions and 0 deletions
|
@ -445,6 +445,12 @@ void AbstractView::set_edit_triggers(unsigned triggers)
|
|||
m_edit_triggers = triggers;
|
||||
}
|
||||
|
||||
void AbstractView::hide_event(HideEvent& event)
|
||||
{
|
||||
stop_editing();
|
||||
ScrollableWidget::hide_event(event);
|
||||
}
|
||||
|
||||
void AbstractView::keydown_event(KeyEvent& event)
|
||||
{
|
||||
if (event.key() == KeyCode::Key_F2) {
|
||||
|
|
|
@ -129,6 +129,7 @@ protected:
|
|||
virtual void context_menu_event(ContextMenuEvent&) override;
|
||||
virtual void drop_event(DropEvent&) override;
|
||||
virtual void leave_event(Core::Event&) override;
|
||||
virtual void hide_event(HideEvent&) override;
|
||||
|
||||
virtual void clear_selection();
|
||||
virtual void set_selection(const ModelIndex&);
|
||||
|
|
Loading…
Reference in a new issue