mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-26 01:20:25 +00:00
LibGUI: Allow only one CommandPalette at once to be opened
Previously it was possible to open CommandPalette for a CommandPalette :^)
This commit is contained in:
parent
daec521010
commit
399d1ff961
Notes:
sideshowbarker
2024-07-17 19:53:26 +09:00
Author: https://github.com/sppmacd Commit: https://github.com/SerenityOS/serenity/commit/399d1ff9618 Pull-request: https://github.com/SerenityOS/serenity/pull/12219 Reviewed-by: https://github.com/Rummskartoffel Reviewed-by: https://github.com/awesomekling
2 changed files with 3 additions and 1 deletions
|
@ -196,8 +196,9 @@ void WindowServerConnection::key_down(i32 window_id, u32 code_point, u32 key, u3
|
|||
}
|
||||
|
||||
// FIXME: This shortcut should be configurable.
|
||||
if (modifiers == (Mod_Ctrl | Mod_Shift) && key == Key_A) {
|
||||
if (!m_in_command_palette && modifiers == (Mod_Ctrl | Mod_Shift) && key == Key_A) {
|
||||
auto command_palette = CommandPalette::construct(*window);
|
||||
TemporaryChange change { m_in_command_palette, true };
|
||||
if (command_palette->exec() != GUI::Dialog::ExecOK)
|
||||
return;
|
||||
auto* action = command_palette->selected_action();
|
||||
|
|
|
@ -58,6 +58,7 @@ private:
|
|||
virtual void track_mouse_move(Gfx::IntPoint const&) override;
|
||||
virtual void ping() override;
|
||||
|
||||
bool m_in_command_palette { false };
|
||||
bool m_display_link_notification_pending { false };
|
||||
i32 m_client_id;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue