mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 16:37:35 +00:00
LibGUI+LibVT: Notify widgets of emoji selection with a callback
Currently, LibGUI modifies the Ctrl+Alt+Space key event to instead represent the emoji that was selected through EmojiInputDialog. This is limited to a single code point. For multiple code point emoji support, individual widgets now set a hook to be notified of the emoji selection with a UTF-8 encoded string. This replaces the previous set_accepts_emoji_input() method.
This commit is contained in:
parent
8190120f95
commit
31b2d93038
5 changed files with 33 additions and 16 deletions
|
@ -84,8 +84,12 @@ TerminalWidget::TerminalWidget(int ptm_fd, bool automatic_size_policy)
|
|||
|
||||
set_override_cursor(Gfx::StandardCursor::IBeam);
|
||||
set_focus_policy(GUI::FocusPolicy::StrongFocus);
|
||||
set_accepts_emoji_input(true);
|
||||
set_pty_master_fd(ptm_fd);
|
||||
|
||||
on_emoji_input = [this](auto emoji) {
|
||||
inject_string(emoji);
|
||||
};
|
||||
|
||||
m_cursor_blink_timer = add<Core::Timer>();
|
||||
m_visual_beep_timer = add<Core::Timer>();
|
||||
m_auto_scroll_timer = add<Core::Timer>();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue