mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 00:47:45 +00:00
LibGUI: Close CommandPalette on active window change
This patch makes CommandPalette be closed whenever the focus shifts from the dialog. It is closer to other non-serenity implementations of the CommandPalette and other modal dialogs in the system.
This commit is contained in:
parent
fd3b96bb2f
commit
1074c399f3
1 changed files with 5 additions and 0 deletions
|
@ -217,6 +217,11 @@ CommandPalette::CommandPalette(GUI::Window& parent_window, ScreenPosition screen
|
||||||
};
|
};
|
||||||
|
|
||||||
m_text_box->set_focus(true);
|
m_text_box->set_focus(true);
|
||||||
|
|
||||||
|
on_active_window_change = [this](bool is_active_window) {
|
||||||
|
if (!is_active_window)
|
||||||
|
close();
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
void CommandPalette::collect_actions(GUI::Window& parent_window)
|
void CommandPalette::collect_actions(GUI::Window& parent_window)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue