1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 16:07:47 +00:00

LibGUI: Add a simple emoji input dialog activated by Ctrl+Alt+Space :^)

Widgets can now opt in to emoji input via set_accepts_emoji_input().
If the focused widget accepts emoji input, we'll pop up a simple dialog
with all the available emojis as clickable buttons.

You can press escape if you change your mind and don't want an emoji.

This UI layout definitely will not scale as we add more emojis, but it
works for the moment, and we can adapt it as we go. Pretty cool! :^)
This commit is contained in:
Andreas Kling 2020-05-17 21:49:54 +02:00
parent 1b78d9fa1f
commit 4173905198
5 changed files with 173 additions and 0 deletions

View file

@ -272,6 +272,9 @@ public:
Gfx::Rect content_rect() const;
void set_accepts_emoji_input(bool b) { m_accepts_emoji_input = b; }
bool accepts_emoji_input() const { return m_accepts_emoji_input; }
protected:
Widget();
@ -337,6 +340,7 @@ private:
bool m_greedy_for_hits { false };
bool m_enabled { true };
bool m_updates_enabled { true };
bool m_accepts_emoji_input { false };
NonnullRefPtr<Gfx::PaletteImpl> m_palette;
};