diff options
author | Timothy Flynn <trflynn89@pm.me> | 2022-09-09 08:47:24 -0400 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2022-09-11 20:33:57 +0100 |
commit | 31b2d930386f26a7c772e91e8a75f3f31758cadf (patch) | |
tree | cdfffa61ae4c6d7eb62defa8255477fb9285525c /Userland/Libraries/LibGUI/Widget.h | |
parent | 8190120f9531693176ca499c12e32f00ac1d76f2 (diff) | |
download | serenity-31b2d930386f26a7c772e91e8a75f3f31758cadf.zip |
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.
Diffstat (limited to 'Userland/Libraries/LibGUI/Widget.h')
-rw-r--r-- | Userland/Libraries/LibGUI/Widget.h | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/Userland/Libraries/LibGUI/Widget.h b/Userland/Libraries/LibGUI/Widget.h index ee868b7d54..c90672ebd4 100644 --- a/Userland/Libraries/LibGUI/Widget.h +++ b/Userland/Libraries/LibGUI/Widget.h @@ -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 }; |