mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 05:17:35 +00:00
LibGUI: Remove Window::set_blocks_command_palette()
Since the logic to open the command palette is now in the form of an action, its keybinding is only bound when the window active. Thus, when a combo box or the emoji input dialog is active, the window isn't, and the command palette doesn't show up, without requiring special checks.
This commit is contained in:
parent
6bb512d0b2
commit
28c1d7011f
5 changed files with 0 additions and 25 deletions
|
@ -202,24 +202,6 @@ void ConnectionToWindowServer::key_down(i32 window_id, u32 code_point, u32 key,
|
|||
return;
|
||||
}
|
||||
|
||||
bool accepts_command_palette = !window->blocks_command_palette();
|
||||
if (accepts_command_palette && window->focused_widget())
|
||||
accepts_command_palette = window->focused_widget()->accepts_command_palette();
|
||||
|
||||
// FIXME: This shortcut should be configurable.
|
||||
if (accepts_command_palette && !m_in_command_palette && modifiers == (Mod_Ctrl | Mod_Shift) && key == Key_A) {
|
||||
auto command_palette = CommandPalette::construct(*window);
|
||||
command_palette->set_window_mode(GUI::WindowMode::CaptureInput);
|
||||
TemporaryChange change { m_in_command_palette, true };
|
||||
if (command_palette->exec() != GUI::Dialog::ExecResult::OK)
|
||||
return;
|
||||
auto* action = command_palette->selected_action();
|
||||
VERIFY(action);
|
||||
action->flash_menubar_menu(*window);
|
||||
action->activate();
|
||||
return;
|
||||
}
|
||||
|
||||
Core::EventLoop::current().post_event(*window, move(key_event));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue