1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 04:47:34 +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:
faxe1008 2022-04-16 21:31:12 +02:00 committed by Linus Groh
parent fd3b96bb2f
commit 1074c399f3

View file

@ -217,6 +217,11 @@ CommandPalette::CommandPalette(GUI::Window& parent_window, ScreenPosition screen
};
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)