summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibGUI/EmojiInputDialog.h
diff options
context:
space:
mode:
authorTimothy Flynn <trflynn89@pm.me>2022-09-06 10:30:37 -0400
committerLinus Groh <mail@linusgroh.de>2022-09-07 14:34:02 +0100
commit1c32823dd84135ac581745b904a339da6d15317c (patch)
tree4c026525a591f4fc31edf070d26637955990d0ff /Userland/Libraries/LibGUI/EmojiInputDialog.h
parenta511dec5ca1d54f46d7893670c8ae70467dd89a4 (diff)
downloadserenity-1c32823dd84135ac581745b904a339da6d15317c.zip
LibGUI: Create the emoji buttons only once for EmojiInputDialog
To prevent lag when the displayed code points are redrawn in support of a search box, only create the GUI::Button objects for the emoji a single time. Re-use those buttons when adding them to the dialog.
Diffstat (limited to 'Userland/Libraries/LibGUI/EmojiInputDialog.h')
-rw-r--r--Userland/Libraries/LibGUI/EmojiInputDialog.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/Userland/Libraries/LibGUI/EmojiInputDialog.h b/Userland/Libraries/LibGUI/EmojiInputDialog.h
index 214d774db8..acf8981270 100644
--- a/Userland/Libraries/LibGUI/EmojiInputDialog.h
+++ b/Userland/Libraries/LibGUI/EmojiInputDialog.h
@@ -13,6 +13,11 @@ namespace GUI {
class EmojiInputDialog final : public Dialog {
C_OBJECT(EmojiInputDialog);
+ struct Emoji {
+ u32 code_point { 0 };
+ RefPtr<Button> button;
+ };
+
public:
String const& selected_emoji_text() const { return m_selected_emoji_text; }
@@ -20,10 +25,11 @@ private:
virtual void event(Core::Event&) override;
explicit EmojiInputDialog(Window* parent_window);
+ Vector<Emoji> supported_emoji();
void update_displayed_emoji();
RefPtr<Widget> m_emojis_widget;
- Vector<u32> m_code_points;
+ Vector<Emoji> m_emojis;
String m_selected_emoji_text;
};