mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-09 01:29:17 +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
Notes:
sideshowbarker
2024-07-17 11:39:26 +09:00
Author: https://github.com/faxe1008
Commit: 1074c399f3
Pull-request: https://github.com/SerenityOS/serenity/pull/13709
Reviewed-by: https://github.com/linusg ✅
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