1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 19:27:44 +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:
Timothy Flynn 2022-09-09 08:47:24 -04:00 committed by Linus Groh
parent 8190120f95
commit 31b2d93038
5 changed files with 33 additions and 16 deletions

View file

@ -337,8 +337,7 @@ public:
Gfx::IntRect relative_non_grabbable_rect() const;
void set_accepts_emoji_input(bool b) { m_accepts_emoji_input = b; }
bool accepts_emoji_input() const { return m_accepts_emoji_input; }
Function<void(StringView)> on_emoji_input;
void set_accepts_command_palette(bool b) { m_accepts_command_palette = b; }
bool accepts_command_palette() const { return m_accepts_command_palette; }
@ -441,7 +440,6 @@ private:
bool m_auto_focusable { true };
bool m_enabled { true };
bool m_updates_enabled { true };
bool m_accepts_emoji_input { false };
bool m_accepts_command_palette { true };
bool m_default_font { true };