summaryrefslogtreecommitdiff
path: root/indra/newview/llfloateremojipicker.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llfloateremojipicker.cpp')
-rw-r--r--indra/newview/llfloateremojipicker.cpp60
1 files changed, 5 insertions, 55 deletions
diff --git a/indra/newview/llfloateremojipicker.cpp b/indra/newview/llfloateremojipicker.cpp
index 30f58aaeec..9e69e3d6f9 100644
--- a/indra/newview/llfloateremojipicker.cpp
+++ b/indra/newview/llfloateremojipicker.cpp
@@ -57,8 +57,7 @@ static const S32 USED_EMOJIS_IMAGE_INDEX = 0x23F2;
// https://www.compart.com/en/unicode/U+1F6D1
static const S32 EMPTY_LIST_IMAGE_INDEX = 0x1F6D1;
// The following categories should follow the required alphabetic order
-static const std::string RECENTLY_USED_CATEGORY = "1 recently used";
-static const std::string FREQUENTLY_USED_CATEGORY = "2 frequently used";
+static const std::string FREQUENTLY_USED_CATEGORY = "frequently used";
// Floater state related variables
static std::list<llwchar> sRecentlyUsed;
@@ -436,6 +435,7 @@ void LLFloaterEmojiPicker::fillGroups()
LLButton::Params params;
params.font = LLFontGL::getFontEmojiLarge();
+ params.name = "all_categories";
LLRect rect;
rect.mTop = mGroups->getRect().getHeight();
@@ -444,11 +444,10 @@ void LLFloaterEmojiPicker::fillGroups()
// Create button for "All categories"
createGroupButton(params, rect, ALL_EMOJIS_IMAGE_INDEX);
- // Create group and button for "Recently used" and/or "Frequently used"
- if (!sRecentlyUsed.empty() || !sFrequentlyUsed.empty())
+ // Create group and button for "Frequently used"
+ if (!sFrequentlyUsed.empty())
{
std::map<std::string, std::vector<LLEmojiSearchResult>> cats;
- fillCategoryRecentlyUsed(cats);
fillCategoryFrequentlyUsed(cats);
if (!cats.empty())
@@ -479,40 +478,6 @@ void LLFloaterEmojiPicker::fillGroups()
resizeGroupButtons();
}
-void LLFloaterEmojiPicker::fillCategoryRecentlyUsed(std::map<std::string, std::vector<LLEmojiSearchResult>>& cats)
-{
- if (sRecentlyUsed.empty())
- return;
-
- std::vector<LLEmojiSearchResult> emojis;
-
- // In case of empty mFilterPattern we'd use sRecentlyUsed directly
- if (!mFilterPattern.empty())
- {
- // List all emojis in "Recently used"
- const LLEmojiDictionary::emoji2descr_map_t& emoji2descr = LLEmojiDictionary::instance().getEmoji2Descr();
- std::size_t begin, end;
- for (llwchar emoji : sRecentlyUsed)
- {
- auto e2d = emoji2descr.find(emoji);
- if (e2d != emoji2descr.end() && !e2d->second->ShortCodes.empty())
- {
- for (const std::string& shortcode : e2d->second->ShortCodes)
- {
- if (LLEmojiDictionary::searchInShortCode(begin, end, shortcode, mFilterPattern))
- {
- emojis.emplace_back(emoji, shortcode, begin, end);
- }
- }
- }
- }
- if (emojis.empty())
- return;
- }
-
- cats.emplace(std::make_pair(RECENTLY_USED_CATEGORY, emojis));
-}
-
void LLFloaterEmojiPicker::fillCategoryFrequentlyUsed(std::map<std::string, std::vector<LLEmojiSearchResult>>& cats)
{
if (sFrequentlyUsed.empty())
@@ -754,7 +719,6 @@ void LLFloaterEmojiPicker::fillEmojisCategory(const std::vector<LLEmojiSearchRes
{
// Place the category title
std::string title =
- category == RECENTLY_USED_CATEGORY ? getString("title_for_recently_used") :
category == FREQUENTLY_USED_CATEGORY ? getString("title_for_frequently_used") :
isupper(category.front()) ? category : LLStringUtil::capitalize(category);
LLEmojiGridDivider* div = new LLEmojiGridDivider(row_panel_params, title);
@@ -767,21 +731,7 @@ void LLFloaterEmojiPicker::fillEmojisCategory(const std::vector<LLEmojiSearchRes
{
const LLEmojiDictionary::emoji2descr_map_t& emoji2descr = LLEmojiDictionary::instance().getEmoji2Descr();
LLEmojiSearchResult emoji { 0, "", 0, 0 };
- if (category == RECENTLY_USED_CATEGORY)
- {
- for (llwchar code : sRecentlyUsed)
- {
- const LLEmojiDictionary::emoji2descr_map_t::const_iterator& e2d = emoji2descr.find(code);
- if (e2d != emoji2descr.end() && !e2d->second->ShortCodes.empty())
- {
- emoji.Character = code;
- emoji.String = e2d->second->ShortCodes.front();
- createEmojiIcon(emoji, category, row_panel_params, row_list_params, icon_params,
- icon_rect, max_icons, bg, row, icon_index);
- }
- }
- }
- else if (category == FREQUENTLY_USED_CATEGORY)
+ if (category == FREQUENTLY_USED_CATEGORY)
{
for (const auto& code : sFrequentlyUsed)
{