diff options
author | Andrey Lihatskiy <alihatskiy@productengine.com> | 2024-07-18 07:45:50 +0300 |
---|---|---|
committer | Andrey Lihatskiy <alihatskiy@productengine.com> | 2024-07-18 07:45:50 +0300 |
commit | adc058a6e06c8f532f4c0406c65694e87d86d707 (patch) | |
tree | 58ce8199ebe45200152a557e6801c61cbde34b92 /indra/newview/llfloateremojipicker.cpp | |
parent | 5482d6a92fcc2eb4f8506a521c2386849a2e9172 (diff) | |
parent | a65bc46b138b89200586b29fe729cbc7b0f0c8c4 (diff) |
Merge branch 'release/maint-b' into marchcat/b-develop
# Conflicts:
# autobuild.xml
# indra/cmake/JsonCpp.cmake
# indra/llimage/llimageworker.cpp
# indra/llmessage/CMakeLists.txt
# indra/llprimitive/llmodel.cpp
# indra/llprimitive/llmodelloader.cpp
# indra/llprimitive/llmodelloader.h
# indra/llwindow/llkeyboard.cpp
# indra/llwindow/llkeyboard.h
# indra/llwindow/llkeyboardheadless.cpp
# indra/llwindow/llkeyboardheadless.h
# indra/llwindow/llkeyboardsdl.cpp
# indra/llwindow/llkeyboardsdl.h
# indra/llwindow/llwindowsdl.cpp
# indra/llwindow/llwindowsdl.h
# indra/newview/app_settings/shaders/class1/deferred/screenSpaceReflUtil.glsl
# indra/newview/llappviewerlinux_api_dbus.cpp
# indra/newview/llconversationloglist.cpp
# indra/newview/lldirpicker.cpp
# indra/newview/llfilepicker.cpp
# indra/newview/llfloateremojipicker.cpp
# indra/newview/llfloaterpreferencesgraphicsadvanced.cpp
# indra/newview/llmodelpreview.cpp
# indra/newview/lloutfitslist.cpp
# indra/newview/llpanelface.cpp
# indra/newview/llviewerobject.h
# indra/newview/llxmlrpctransaction.cpp
# indra/newview/viewer_manifest.py
Diffstat (limited to 'indra/newview/llfloateremojipicker.cpp')
-rw-r--r-- | indra/newview/llfloateremojipicker.cpp | 60 |
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) { |