mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 12:19:54 +00:00
LibGUI: Allow blocking CommandPalette/EmojiInput on a per Window basis
Instead of having to negate every focusable widget or textbox, let windows override all their widgets. These two Dialogs now block themselves and each other.
This commit is contained in:
parent
bfcb4d88cf
commit
f8e65d24cf
Notes:
sideshowbarker
2024-07-17 07:19:11 +09:00
Author: https://github.com/thankyouverycool
Commit: f8e65d24cf
Pull-request: https://github.com/SerenityOS/serenity/pull/15175
Reviewed-by: https://github.com/trflynn89 ✅
5 changed files with 20 additions and 3 deletions
|
@ -193,7 +193,7 @@ void ConnectionToWindowServer::key_down(i32 window_id, u32 code_point, u32 key,
|
|||
}
|
||||
|
||||
bool focused_widget_accepts_emoji_input = window->focused_widget() && window->focused_widget()->accepts_emoji_input();
|
||||
if (focused_widget_accepts_emoji_input && (modifiers == (Mod_Ctrl | Mod_Alt)) && key == Key_Space) {
|
||||
if (!window->blocks_emoji_input() && focused_widget_accepts_emoji_input && (modifiers == (Mod_Ctrl | Mod_Alt)) && key == Key_Space) {
|
||||
auto emoji_input_dialog = EmojiInputDialog::construct(window);
|
||||
emoji_input_dialog->set_window_mode(GUI::WindowMode::Passive);
|
||||
if (emoji_input_dialog->exec() != EmojiInputDialog::ExecResult::OK)
|
||||
|
@ -207,8 +207,8 @@ void ConnectionToWindowServer::key_down(i32 window_id, u32 code_point, u32 key,
|
|||
key_event->m_code_point = emoji_code_point;
|
||||
}
|
||||
|
||||
bool accepts_command_palette = true;
|
||||
if (window->focused_widget())
|
||||
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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue