From ff7ebf08922293c1623b7bdb8c9923c14fc9db48 Mon Sep 17 00:00:00 2001 From: Alexander Gavriliuk Date: Fri, 14 Apr 2023 07:44:56 +0200 Subject: SL-19575 Create emoji gallery access icon --- indra/newview/llfloateremojipicker.h | 59 ++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 indra/newview/llfloateremojipicker.h (limited to 'indra/newview/llfloateremojipicker.h') diff --git a/indra/newview/llfloateremojipicker.h b/indra/newview/llfloateremojipicker.h new file mode 100644 index 0000000000..9b442064d0 --- /dev/null +++ b/indra/newview/llfloateremojipicker.h @@ -0,0 +1,59 @@ +/** + * @file llfloateremojipicker.h + * @brief Header file for llfloateremojipicker + * + * $LicenseInfo:firstyear=2003&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LLFLOATEREMOJIPICKER_H +#define LLFLOATEREMOJIPICKER_H + +#include "llfloater.h" + +class LLFloaterEmojiPicker : public LLFloater +{ +public: + // The callback function will be called with an emoji char. + typedef boost::function select_callback_t; + + // Call this to select an emoji. + static LLFloaterEmojiPicker* getInstance(); + static LLFloaterEmojiPicker* showInstance(select_callback_t callback); + + LLFloaterEmojiPicker(const LLSD& key); + virtual ~LLFloaterEmojiPicker(); + + virtual BOOL postBuild(); + + void show(select_callback_t callback); + +private: + void onSelect(); + + virtual BOOL handleKeyHere(KEY key, MASK mask); + + class LLScrollListCtrl* mEmojis; + select_callback_t mSelectCallback; + std::string mEmojiName; +}; + +#endif -- cgit v1.2.3 From 97b0ba2a6d2596da867043077e32065653d44f6e Mon Sep 17 00:00:00 2001 From: Alexander Gavriliuk Date: Wed, 19 Apr 2023 01:39:42 +0200 Subject: SL-19575 LLFloaterEmojiPicker - Add filter by category --- indra/newview/llfloateremojipicker.h | 36 +++++++++++++++++++++++++++++------- 1 file changed, 29 insertions(+), 7 deletions(-) (limited to 'indra/newview/llfloateremojipicker.h') diff --git a/indra/newview/llfloateremojipicker.h b/indra/newview/llfloateremojipicker.h index 9b442064d0..01335bbb5b 100644 --- a/indra/newview/llfloateremojipicker.h +++ b/indra/newview/llfloateremojipicker.h @@ -29,31 +29,53 @@ #include "llfloater.h" +struct LLEmojiDescriptor; + class LLFloaterEmojiPicker : public LLFloater { public: // The callback function will be called with an emoji char. - typedef boost::function select_callback_t; + typedef boost::function pick_callback_t; + typedef boost::function close_callback_t; // Call this to select an emoji. static LLFloaterEmojiPicker* getInstance(); - static LLFloaterEmojiPicker* showInstance(select_callback_t callback); + static LLFloaterEmojiPicker* showInstance(pick_callback_t pick_callback = nullptr, close_callback_t close_callback = nullptr); LLFloaterEmojiPicker(const LLSD& key); virtual ~LLFloaterEmojiPicker(); virtual BOOL postBuild(); - void show(select_callback_t callback); + void show(pick_callback_t pick_callback = nullptr, close_callback_t close_callback = nullptr); + + virtual void closeFloater(bool app_quitting = false); private: - void onSelect(); + void fillEmojis(); + bool matchesCategory(const LLEmojiDescriptor* descr); + bool matchesPattern(const LLEmojiDescriptor* descr); + + void onCategoryCommit(); + void onSearchKeystroke(class LLLineEditor* caller, void* user_data); + void onPreviewEmojiClick(); + void onEmojiSelect(); + void onEmojiEmpty(); + void onEmojiPick(); virtual BOOL handleKeyHere(KEY key, MASK mask); - class LLScrollListCtrl* mEmojis; - select_callback_t mSelectCallback; - std::string mEmojiName; + class LLComboBox* mCategory { nullptr }; + class LLLineEditor* mSearch { nullptr }; + class LLScrollListCtrl* mEmojis { nullptr }; + class LLButton* mPreviewEmoji { nullptr }; + + pick_callback_t mEmojiPickCallback; + close_callback_t mFloaterCloseCallback; + + static std::string mSelectedCategory; + static std::string mSearchPattern; + static int mSelectedEmojiIndex; }; #endif -- cgit v1.2.3 From 671978e3927bc3ba9fc34008bbb7efd6f07b6c81 Mon Sep 17 00:00:00 2001 From: Alexander Gavriliuk Date: Wed, 17 May 2023 14:28:36 +0200 Subject: SL-19575 Create emoji gallery (fix bug with drawing emojis in chat history) --- indra/newview/llfloateremojipicker.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llfloateremojipicker.h') diff --git a/indra/newview/llfloateremojipicker.h b/indra/newview/llfloateremojipicker.h index 01335bbb5b..7327fb945e 100644 --- a/indra/newview/llfloateremojipicker.h +++ b/indra/newview/llfloateremojipicker.h @@ -57,7 +57,7 @@ private: bool matchesPattern(const LLEmojiDescriptor* descr); void onCategoryCommit(); - void onSearchKeystroke(class LLLineEditor* caller, void* user_data); + void onSearchKeystroke(); void onPreviewEmojiClick(); void onEmojiSelect(); void onEmojiEmpty(); -- cgit v1.2.3 From 8bbbce015b6dae1bdafe0bba329463322642ca85 Mon Sep 17 00:00:00 2001 From: Alexander Gavriliuk Date: Tue, 4 Jul 2023 07:38:05 +0200 Subject: SL-19575 Rework emoji picker layout similar to Slack --- indra/newview/llfloateremojipicker.h | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) (limited to 'indra/newview/llfloateremojipicker.h') diff --git a/indra/newview/llfloateremojipicker.h b/indra/newview/llfloateremojipicker.h index 7327fb945e..ba71f04830 100644 --- a/indra/newview/llfloateremojipicker.h +++ b/indra/newview/llfloateremojipicker.h @@ -33,6 +33,8 @@ struct LLEmojiDescriptor; class LLFloaterEmojiPicker : public LLFloater { + using super = LLFloater; + public: // The callback function will be called with an emoji char. typedef boost::function pick_callback_t; @@ -45,7 +47,8 @@ public: LLFloaterEmojiPicker(const LLSD& key); virtual ~LLFloaterEmojiPicker(); - virtual BOOL postBuild(); + virtual BOOL postBuild() override; + virtual void dirtyRect() override; void show(pick_callback_t pick_callback = nullptr, close_callback_t close_callback = nullptr); @@ -53,29 +56,47 @@ public: private: void fillEmojis(); + void fillEmojiList(); + void fillEmojiGrid(); + bool matchesCategory(const LLEmojiDescriptor* descr); 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 onEmojiSelect(); void onEmojiEmpty(); void onEmojiPick(); - virtual BOOL handleKeyHere(KEY key, 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 LLScrollListCtrl* mEmojis { nullptr }; + class LLScrollListCtrl* mEmojiList { 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 }; + LLUICtrl* mHoveredIcon { nullptr }; + static std::string mSelectedCategory; static std::string mSearchPattern; static int mSelectedEmojiIndex; + static bool mUseGrid; }; #endif -- cgit v1.2.3 From 0414fada8163409adf95f9d7c75a7db5f0952103 Mon Sep 17 00:00:00 2001 From: Alexander Gavriliuk Date: Wed, 5 Jul 2023 12:46:42 +0200 Subject: macos build fix --- indra/newview/llfloateremojipicker.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llfloateremojipicker.h') diff --git a/indra/newview/llfloateremojipicker.h b/indra/newview/llfloateremojipicker.h index ba71f04830..68c694d89a 100644 --- a/indra/newview/llfloateremojipicker.h +++ b/indra/newview/llfloateremojipicker.h @@ -52,7 +52,7 @@ public: void show(pick_callback_t pick_callback = nullptr, close_callback_t close_callback = nullptr); - virtual void closeFloater(bool app_quitting = false); + virtual void closeFloater(bool app_quitting = false) override; private: void fillEmojis(); -- cgit v1.2.3 From deb394e2075e031bfe1472fdc3bc638360683c85 Mon Sep 17 00:00:00 2001 From: Alexander Gavriliuk Date: Thu, 6 Jul 2023 09:33:22 +0200 Subject: SL-19951 Delete unused UI elements (old design) --- indra/newview/llfloateremojipicker.h | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'indra/newview/llfloateremojipicker.h') diff --git a/indra/newview/llfloateremojipicker.h b/indra/newview/llfloateremojipicker.h index 68c694d89a..b36e09fd5b 100644 --- a/indra/newview/llfloateremojipicker.h +++ b/indra/newview/llfloateremojipicker.h @@ -55,8 +55,6 @@ public: virtual void closeFloater(bool app_quitting = false) override; private: - void fillEmojis(); - void fillEmojiList(); void fillEmojiGrid(); bool matchesCategory(const LLEmojiDescriptor* descr); @@ -70,9 +68,6 @@ private: void onEmojiMouseEnter(LLUICtrl* ctrl); void onEmojiMouseLeave(LLUICtrl* ctrl); void onEmojiMouseClick(LLUICtrl* ctrl, MASK mask); - void onEmojiSelect(); - void onEmojiEmpty(); - void onEmojiPick(); void selectGridIcon(LLUICtrl* ctrl); void unselectGridIcon(LLUICtrl* ctrl); @@ -81,7 +76,6 @@ private: class LLComboBox* mCategory { nullptr }; class LLLineEditor* mSearch { nullptr }; - class LLScrollListCtrl* mEmojiList { nullptr }; class LLScrollContainer* mEmojiScroll { nullptr }; class LLScrollingPanelList* mEmojiGrid { nullptr }; class LLButton* mPreviewEmoji { nullptr }; @@ -91,12 +85,11 @@ private: close_callback_t mFloaterCloseCallback; S32 mRecentGridWidth { 0 }; + S32 mRecentMaxIcons { 0 }; LLUICtrl* mHoveredIcon { nullptr }; static std::string mSelectedCategory; static std::string mSearchPattern; - static int mSelectedEmojiIndex; - static bool mUseGrid; }; #endif -- cgit v1.2.3 From 4abecaa04bd003136ed027e3892a2ca13d895936 Mon Sep 17 00:00:00 2001 From: Alexander Gavriliuk Date: Thu, 6 Jul 2023 11:17:20 +0200 Subject: SL-19951 Delete unused code --- indra/newview/llfloateremojipicker.h | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/newview/llfloateremojipicker.h') diff --git a/indra/newview/llfloateremojipicker.h b/indra/newview/llfloateremojipicker.h index b36e09fd5b..300d9a4d4a 100644 --- a/indra/newview/llfloateremojipicker.h +++ b/indra/newview/llfloateremojipicker.h @@ -57,7 +57,6 @@ public: private: void fillEmojiGrid(); - bool matchesCategory(const LLEmojiDescriptor* descr); bool matchesPattern(const LLEmojiDescriptor* descr); void onCategoryCommit(); -- cgit v1.2.3 From 9793308a600c1e1ce35ec727ed6341e7668848ea Mon Sep 17 00:00:00 2001 From: Alexander Gavriliuk Date: Thu, 6 Jul 2023 23:48:06 +0200 Subject: SL-19951 Organize emoji categories in groups --- indra/newview/llfloateremojipicker.h | 102 +++++++++++++++++++---------------- 1 file changed, 55 insertions(+), 47 deletions(-) (limited to 'indra/newview/llfloateremojipicker.h') 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 pick_callback_t; - typedef boost::function close_callback_t; + // The callback function will be called with an emoji char. + typedef boost::function pick_callback_t; + typedef boost::function 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 mGroupButtons; + + S32 mRecentBadgeWidth { 0 }; + S32 mRecentGridWidth { 0 }; + S32 mRecentMaxIcons { 0 }; + LLUICtrl* mHoveredIcon { nullptr }; + + static size_t sSelectedGroupIndex; + static std::string sSearchPattern; }; #endif -- cgit v1.2.3 From 16f0329d184f62437c296483143aef72f1aaa284 Mon Sep 17 00:00:00 2001 From: Alexander Gavriliuk Date: Fri, 7 Jul 2023 23:35:01 +0200 Subject: SL-19951 Collect used icons in a special group 'Recently used' --- indra/newview/llfloateremojipicker.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'indra/newview/llfloateremojipicker.h') diff --git a/indra/newview/llfloateremojipicker.h b/indra/newview/llfloateremojipicker.h index 7fa6ea46b0..d00391c61f 100644 --- a/indra/newview/llfloateremojipicker.h +++ b/indra/newview/llfloateremojipicker.h @@ -77,6 +77,10 @@ private: virtual BOOL handleKeyHere(KEY key, MASK mask) override; + void onEmojiUsed(llwchar emoji); + void loadState(); + void saveState(); + class LLPanel* mGroups { nullptr }; class LLPanel* mBadge { nullptr }; class LLLineEditor* mSearch { nullptr }; @@ -94,9 +98,6 @@ private: S32 mRecentGridWidth { 0 }; S32 mRecentMaxIcons { 0 }; LLUICtrl* mHoveredIcon { nullptr }; - - static size_t sSelectedGroupIndex; - static std::string sSearchPattern; }; #endif -- cgit v1.2.3 From 1fe007abef6eeceefb0dc720b4a5ecb4505ede88 Mon Sep 17 00:00:00 2001 From: Alexander Gavriliuk Date: Thu, 13 Jul 2023 21:18:22 +0200 Subject: SL-20001 EmojiPicker - make the preview to be a panel instead of a button --- indra/newview/llfloateremojipicker.h | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'indra/newview/llfloateremojipicker.h') diff --git a/indra/newview/llfloateremojipicker.h b/indra/newview/llfloateremojipicker.h index d00391c61f..e4b1216ce6 100644 --- a/indra/newview/llfloateremojipicker.h +++ b/indra/newview/llfloateremojipicker.h @@ -59,18 +59,16 @@ private: 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 onEmojiMouseDown(LLUICtrl* ctrl); + void onEmojiMouseUp(LLUICtrl* ctrl); void selectGridIcon(LLUICtrl* ctrl); void unselectGridIcon(LLUICtrl* ctrl); @@ -83,11 +81,10 @@ private: class LLPanel* mGroups { nullptr }; class LLPanel* mBadge { nullptr }; - class LLLineEditor* mSearch { nullptr }; + class LLLineEditor* mFilter { nullptr }; class LLScrollContainer* mEmojiScroll { nullptr }; class LLScrollingPanelList* mEmojiGrid { nullptr }; - class LLButton* mPreviewEmoji { nullptr }; - class LLTextBox* mDescription { nullptr }; + class LLEmojiPreviewPanel* mPreview { nullptr }; pick_callback_t mEmojiPickCallback; close_callback_t mFloaterCloseCallback; -- cgit v1.2.3 From 031032fb892560a0f5fa1a996aea77f593f54704 Mon Sep 17 00:00:00 2001 From: Alexander Gavriliuk Date: Tue, 29 Aug 2023 13:12:09 +0200 Subject: SL-20211 EmojiPicker - The search field should be the same as other floaters --- indra/newview/llfloateremojipicker.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llfloateremojipicker.h') diff --git a/indra/newview/llfloateremojipicker.h b/indra/newview/llfloateremojipicker.h index e4b1216ce6..3cae818e15 100644 --- a/indra/newview/llfloateremojipicker.h +++ b/indra/newview/llfloateremojipicker.h @@ -60,7 +60,7 @@ private: void fillEmojis(bool fromResize = false); void onGroupButtonClick(LLUICtrl* ctrl); - void onSearchKeystroke(); + void onFilterChanged(); void onGridMouseEnter(); void onGridMouseLeave(); void onGroupButtonMouseEnter(LLUICtrl* ctrl); @@ -81,7 +81,7 @@ private: class LLPanel* mGroups { nullptr }; class LLPanel* mBadge { nullptr }; - class LLLineEditor* mFilter { nullptr }; + class LLFilterEditor* mFilter { nullptr }; class LLScrollContainer* mEmojiScroll { nullptr }; class LLScrollingPanelList* mEmojiGrid { nullptr }; class LLEmojiPreviewPanel* mPreview { nullptr }; -- cgit v1.2.3 From 1e5ac99fd840b7d85d06fd08b27f2c2cb6201b9c Mon Sep 17 00:00:00 2001 From: Alexander Gavriliuk Date: Tue, 29 Aug 2023 14:23:48 +0200 Subject: SL-20209 Open read access to the recently used emojis --- indra/newview/llfloateremojipicker.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'indra/newview/llfloateremojipicker.h') diff --git a/indra/newview/llfloateremojipicker.h b/indra/newview/llfloateremojipicker.h index 3cae818e15..decee41721 100644 --- a/indra/newview/llfloateremojipicker.h +++ b/indra/newview/llfloateremojipicker.h @@ -54,6 +54,11 @@ public: virtual void closeFloater(bool app_quitting = false) override; + static std::list& getRecentlyUsed(); + static void onEmojiUsed(llwchar emoji); + static void loadState(); + static void saveState(); + private: void fillGroups(); void moveGroups(); @@ -75,10 +80,6 @@ private: virtual BOOL handleKeyHere(KEY key, MASK mask) override; - void onEmojiUsed(llwchar emoji); - void loadState(); - void saveState(); - class LLPanel* mGroups { nullptr }; class LLPanel* mBadge { nullptr }; class LLFilterEditor* mFilter { nullptr }; -- cgit v1.2.3 From 771d409b08eb6073f87aee25a95c242d8178d705 Mon Sep 17 00:00:00 2001 From: Alexander Gavriliuk Date: Sat, 16 Sep 2023 16:09:25 +0200 Subject: SL-20211 EmojiPicker - Move the filter field to the top of the floater --- indra/newview/llfloateremojipicker.h | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/llfloateremojipicker.h') diff --git a/indra/newview/llfloateremojipicker.h b/indra/newview/llfloateremojipicker.h index decee41721..cfb3da3acc 100644 --- a/indra/newview/llfloateremojipicker.h +++ b/indra/newview/llfloateremojipicker.h @@ -86,6 +86,7 @@ private: class LLScrollContainer* mEmojiScroll { nullptr }; class LLScrollingPanelList* mEmojiGrid { nullptr }; class LLEmojiPreviewPanel* mPreview { nullptr }; + class LLTextBox* mDummy { nullptr }; pick_callback_t mEmojiPickCallback; close_callback_t mFloaterCloseCallback; -- cgit v1.2.3 From c40f63911c1fad5ea5a18894f530892ddb87c8ea Mon Sep 17 00:00:00 2001 From: Alexander Gavriliuk Date: Fri, 22 Sep 2023 01:19:42 +0200 Subject: SL-20294 The row of recent emojis displays the recently sent emoji only after clicking the collapsing smiley button --- indra/newview/llfloateremojipicker.h | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/llfloateremojipicker.h') diff --git a/indra/newview/llfloateremojipicker.h b/indra/newview/llfloateremojipicker.h index cfb3da3acc..b8e3190bf3 100644 --- a/indra/newview/llfloateremojipicker.h +++ b/indra/newview/llfloateremojipicker.h @@ -56,6 +56,7 @@ public: static std::list& getRecentlyUsed(); static void onEmojiUsed(llwchar emoji); + static void onRecentlyUsedChanged(); static void loadState(); static void saveState(); -- cgit v1.2.3 From 716b9af35d0dbc3ba8048a1bcca2c8c8f703bed0 Mon Sep 17 00:00:00 2001 From: Alexander Gavriliuk Date: Tue, 7 Nov 2023 23:13:00 +0100 Subject: SL-20356 EmojiPicker - Implement arrow keys navigation --- indra/newview/llfloateremojipicker.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'indra/newview/llfloateremojipicker.h') diff --git a/indra/newview/llfloateremojipicker.h b/indra/newview/llfloateremojipicker.h index b8e3190bf3..48f66d7950 100644 --- a/indra/newview/llfloateremojipicker.h +++ b/indra/newview/llfloateremojipicker.h @@ -63,6 +63,7 @@ public: private: void fillGroups(); void moveGroups(); + void showPreview(bool show); void fillEmojis(bool fromResize = false); void onGroupButtonClick(LLUICtrl* ctrl); @@ -76,9 +77,18 @@ private: void onEmojiMouseDown(LLUICtrl* ctrl); void onEmojiMouseUp(LLUICtrl* ctrl); + bool enterArrowMode(); + void exitArrowMode(); + void selectFocusedIcon(); + bool moveFocusedIconUp(); + bool moveFocusedIconDown(); + bool moveFocusedIconLeft(); + bool moveFocusedIconRight(); + void selectGridIcon(LLUICtrl* ctrl); void unselectGridIcon(LLUICtrl* ctrl); + virtual BOOL handleKey(KEY key, MASK mask, BOOL called_from_parent) override; virtual BOOL handleKeyHere(KEY key, MASK mask) override; class LLPanel* mGroups { nullptr }; @@ -97,6 +107,9 @@ private: S32 mRecentBadgeWidth { 0 }; S32 mRecentGridWidth { 0 }; S32 mRecentMaxIcons { 0 }; + S32 mFocusedIconRow { 0 }; + S32 mFocusedIconCol { 0 }; + LLUICtrl* mFocusedIcon { nullptr }; LLUICtrl* mHoveredIcon { nullptr }; }; -- cgit v1.2.3 From f6ceafee5bb26cf86d64959cabf68deefaf791a8 Mon Sep 17 00:00:00 2001 From: Alexander Gavriliuk Date: Mon, 22 Jan 2024 06:40:41 +0100 Subject: SL-20416 Avoid of taking focus by EmojiPicker --- indra/newview/llfloateremojipicker.h | 66 +++++++++++++++++++----------------- 1 file changed, 35 insertions(+), 31 deletions(-) (limited to 'indra/newview/llfloateremojipicker.h') diff --git a/indra/newview/llfloateremojipicker.h b/indra/newview/llfloateremojipicker.h index 48f66d7950..f169d67a4e 100644 --- a/indra/newview/llfloateremojipicker.h +++ b/indra/newview/llfloateremojipicker.h @@ -29,7 +29,10 @@ #include "llfloater.h" +class LLEmojiGridRow; +class LLEmojiGridIcon; struct LLEmojiDescriptor; +struct LLEmojiSearchResult; class LLFloaterEmojiPicker : public LLFloater { @@ -40,36 +43,40 @@ public: typedef boost::function pick_callback_t; typedef boost::function 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); - LLFloaterEmojiPicker(const LLSD& key); - virtual ~LLFloaterEmojiPicker(); virtual BOOL postBuild() override; virtual void dirtyRect() override; + virtual void goneFromFront() override; - void show(pick_callback_t pick_callback = nullptr, close_callback_t close_callback = nullptr); - - virtual void closeFloater(bool app_quitting = false) override; + void hideFloater() const; static std::list& getRecentlyUsed(); static void onEmojiUsed(llwchar emoji); - static void onRecentlyUsedChanged(); + static void loadState(); static void saveState(); private: + void initialize(); void fillGroups(); - void moveGroups(); - void showPreview(bool show); + void fillCategoryRecentlyUsed(std::map>& cats); + void fillCategoryFrequentlyUsed(std::map>& cats); + void fillGroupEmojis(std::map>& cats, U32 index); + void createGroupButton(LLButton::Params& params, const LLRect& rect, llwchar emoji); + void resizeGroupButtons(); + void selectEmojiGroup(U32 index); void fillEmojis(bool fromResize = false); + void fillEmojisCategory(const std::vector& emojis, + const std::string& category, const LLPanel::Params& row_panel_params, const LLUICtrl::Params& row_list_params, + const LLPanel::Params& icon_params, const LLRect& icon_rect, S32 max_icons, const LLColor4& bg); + void createEmojiIcon(const LLEmojiSearchResult& emoji, + const std::string& category, const LLPanel::Params& row_panel_params, const LLUICtrl::Params& row_list_params, + const LLPanel::Params& icon_params, const LLRect& icon_rect, S32 max_icons, const LLColor4& bg, + LLEmojiGridRow*& row, int& icon_index); + void showPreview(bool show); void onGroupButtonClick(LLUICtrl* ctrl); - void onFilterChanged(); - void onGridMouseEnter(); - void onGridMouseLeave(); void onGroupButtonMouseEnter(LLUICtrl* ctrl); void onGroupButtonMouseLeave(LLUICtrl* ctrl); void onEmojiMouseEnter(LLUICtrl* ctrl); @@ -77,40 +84,37 @@ private: void onEmojiMouseDown(LLUICtrl* ctrl); void onEmojiMouseUp(LLUICtrl* ctrl); - bool enterArrowMode(); - void exitArrowMode(); void selectFocusedIcon(); - bool moveFocusedIconUp(); - bool moveFocusedIconDown(); - bool moveFocusedIconLeft(); - bool moveFocusedIconRight(); + bool moveFocusedIconPrev(); + bool moveFocusedIconNext(); - void selectGridIcon(LLUICtrl* ctrl); - void unselectGridIcon(LLUICtrl* ctrl); + void selectGridIcon(LLEmojiGridIcon* icon); + void unselectGridIcon(LLEmojiGridIcon* icon); + void onOpen(const LLSD& key) override; virtual BOOL handleKey(KEY key, MASK mask, BOOL called_from_parent) override; - virtual BOOL handleKeyHere(KEY key, MASK mask) override; class LLPanel* mGroups { nullptr }; class LLPanel* mBadge { nullptr }; - class LLFilterEditor* mFilter { nullptr }; class LLScrollContainer* mEmojiScroll { nullptr }; class LLScrollingPanelList* mEmojiGrid { nullptr }; class LLEmojiPreviewPanel* mPreview { nullptr }; class LLTextBox* mDummy { nullptr }; - pick_callback_t mEmojiPickCallback; - close_callback_t mFloaterCloseCallback; - + std::vector mFilteredEmojiGroups; + std::vector>> mFilteredEmojis; std::vector mGroupButtons; - S32 mRecentBadgeWidth { 0 }; - S32 mRecentGridWidth { 0 }; + std::string mHint; + std::string mFilterPattern; + U32 mSelectedGroupIndex { 0 }; S32 mRecentMaxIcons { 0 }; S32 mFocusedIconRow { 0 }; S32 mFocusedIconCol { 0 }; - LLUICtrl* mFocusedIcon { nullptr }; - LLUICtrl* mHoveredIcon { nullptr }; + LLEmojiGridIcon* mFocusedIcon { nullptr }; + LLEmojiGridIcon* mHoveredIcon { nullptr }; + + U64 mRecentReturnPressedMs { 0 }; }; #endif -- cgit v1.2.3 From 1820095dd4a64c142e14869c76ae09e1e0ca6a12 Mon Sep 17 00:00:00 2001 From: Alexander Gavriliuk Date: Mon, 12 Feb 2024 19:01:00 +0100 Subject: #779 Emoji picker is an unintuitive UX disaster --- indra/newview/llfloateremojipicker.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/newview/llfloateremojipicker.h') diff --git a/indra/newview/llfloateremojipicker.h b/indra/newview/llfloateremojipicker.h index f169d67a4e..5d0402ca83 100644 --- a/indra/newview/llfloateremojipicker.h +++ b/indra/newview/llfloateremojipicker.h @@ -85,6 +85,8 @@ private: void onEmojiMouseUp(LLUICtrl* ctrl); void selectFocusedIcon(); + bool moveFocusedIconUp(); + bool moveFocusedIconDown(); bool moveFocusedIconPrev(); bool moveFocusedIconNext(); -- cgit v1.2.3