summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibGUI
diff options
context:
space:
mode:
authorfaxe1008 <fabianblatz@gmail.com>2022-04-16 21:31:12 +0200
committerLinus Groh <mail@linusgroh.de>2022-04-20 18:34:09 +0200
commit1074c399f37be9c2e56215f7defaa1aa2eed125b (patch)
tree7e1f1bf7c1819505d336be1a5607241378f77e5b /Userland/Libraries/LibGUI
parentfd3b96bb2f02baac4603cbc3a68babd7c3cf9a28 (diff)
downloadserenity-1074c399f37be9c2e56215f7defaa1aa2eed125b.zip
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.
Diffstat (limited to 'Userland/Libraries/LibGUI')
-rw-r--r--Userland/Libraries/LibGUI/CommandPalette.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/Userland/Libraries/LibGUI/CommandPalette.cpp b/Userland/Libraries/LibGUI/CommandPalette.cpp
index 81b502e400..41e6e6908e 100644
--- a/Userland/Libraries/LibGUI/CommandPalette.cpp
+++ b/Userland/Libraries/LibGUI/CommandPalette.cpp
@@ -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)