diff options
author | Alexander Gavriliuk <alexandrgproductengine@lindenlab.com> | 2023-07-06 23:48:06 +0200 |
---|---|---|
committer | Guru <alexandrgproductengine@lindenlab.com> | 2023-07-07 00:22:34 +0200 |
commit | 9793308a600c1e1ce35ec727ed6341e7668848ea (patch) | |
tree | 17d47429881ed210f341695fb83475a488782170 /indra/newview/llfloateremojipicker.h | |
parent | 4abecaa04bd003136ed027e3892a2ca13d895936 (diff) |
SL-19951 Organize emoji categories in groups
Diffstat (limited to 'indra/newview/llfloateremojipicker.h')
-rw-r--r-- | indra/newview/llfloateremojipicker.h | 102 |
1 files changed, 55 insertions, 47 deletions
diff --git a/indra/newview/llfloateremojipicker.h b/indra/newview/llfloateremojipicker.h index 300d9a4d4a..7fa6ea46b0 100644 --- a/indra/newview/llfloateremojipicker.h +++ b/indra/newview/llfloateremojipicker.h @@ -33,62 +33,70 @@ struct LLEmojiDescriptor; class LLFloaterEmojiPicker : public LLFloater { - using super = LLFloater; + using super = LLFloater; public: - // The callback function will be called with an emoji char. - typedef boost::function<void (llwchar)> pick_callback_t; - typedef boost::function<void ()> close_callback_t; + // The callback function will be called with an emoji char. + typedef boost::function<void (llwchar)> pick_callback_t; + typedef boost::function<void ()> close_callback_t; - // Call this to select an emoji. - static LLFloaterEmojiPicker* getInstance(); - static LLFloaterEmojiPicker* showInstance(pick_callback_t pick_callback = nullptr, close_callback_t close_callback = nullptr); + // Call this to select an emoji. + static LLFloaterEmojiPicker* getInstance(); + static LLFloaterEmojiPicker* showInstance(pick_callback_t pick_callback = nullptr, close_callback_t close_callback = nullptr); - LLFloaterEmojiPicker(const LLSD& key); - virtual ~LLFloaterEmojiPicker(); + LLFloaterEmojiPicker(const LLSD& key); + virtual ~LLFloaterEmojiPicker(); - virtual BOOL postBuild() override; - virtual void dirtyRect() override; + virtual BOOL postBuild() override; + virtual void dirtyRect() override; - void show(pick_callback_t pick_callback = nullptr, close_callback_t close_callback = nullptr); + void show(pick_callback_t pick_callback = nullptr, close_callback_t close_callback = nullptr); - virtual void closeFloater(bool app_quitting = false) override; + virtual void closeFloater(bool app_quitting = false) override; private: - void fillEmojiGrid(); - - bool matchesPattern(const LLEmojiDescriptor* descr); - - void onCategoryCommit(); - void onSearchKeystroke(); - void onPreviewEmojiClick(); - void onGridMouseEnter(); - void onGridMouseLeave(); - void onEmojiMouseEnter(LLUICtrl* ctrl); - void onEmojiMouseLeave(LLUICtrl* ctrl); - void onEmojiMouseClick(LLUICtrl* ctrl, MASK mask); - - void selectGridIcon(LLUICtrl* ctrl); - void unselectGridIcon(LLUICtrl* ctrl); - - virtual BOOL handleKeyHere(KEY key, MASK mask) override; - - class LLComboBox* mCategory { nullptr }; - class LLLineEditor* mSearch { nullptr }; - class LLScrollContainer* mEmojiScroll { nullptr }; - class LLScrollingPanelList* mEmojiGrid { nullptr }; - class LLButton* mPreviewEmoji { nullptr }; - class LLTextBox* mDescription { nullptr }; - - pick_callback_t mEmojiPickCallback; - close_callback_t mFloaterCloseCallback; - - S32 mRecentGridWidth { 0 }; - S32 mRecentMaxIcons { 0 }; - LLUICtrl* mHoveredIcon { nullptr }; - - static std::string mSelectedCategory; - static std::string mSearchPattern; + void fillGroups(); + void moveGroups(); + void fillEmojis(bool fromResize = false); + + bool matchesPattern(const LLEmojiDescriptor* descr); + + void onGroupButtonClick(LLUICtrl* ctrl); + void onSearchKeystroke(); + void onPreviewEmojiClick(); + void onGridMouseEnter(); + void onGridMouseLeave(); + void onGroupButtonMouseEnter(LLUICtrl* ctrl); + void onGroupButtonMouseLeave(LLUICtrl* ctrl); + void onEmojiMouseEnter(LLUICtrl* ctrl); + void onEmojiMouseLeave(LLUICtrl* ctrl); + void onEmojiMouseClick(LLUICtrl* ctrl, MASK mask); + + void selectGridIcon(LLUICtrl* ctrl); + void unselectGridIcon(LLUICtrl* ctrl); + + virtual BOOL handleKeyHere(KEY key, MASK mask) override; + + class LLPanel* mGroups { nullptr }; + class LLPanel* mBadge { nullptr }; + class LLLineEditor* mSearch { nullptr }; + class LLScrollContainer* mEmojiScroll { nullptr }; + class LLScrollingPanelList* mEmojiGrid { nullptr }; + class LLButton* mPreviewEmoji { nullptr }; + class LLTextBox* mDescription { nullptr }; + + pick_callback_t mEmojiPickCallback; + close_callback_t mFloaterCloseCallback; + + std::vector<class LLButton*> mGroupButtons; + + S32 mRecentBadgeWidth { 0 }; + S32 mRecentGridWidth { 0 }; + S32 mRecentMaxIcons { 0 }; + LLUICtrl* mHoveredIcon { nullptr }; + + static size_t sSelectedGroupIndex; + static std::string sSearchPattern; }; #endif |