summaryrefslogtreecommitdiff
path: root/indra/newview/llfloaterimsessiontab.cpp
diff options
context:
space:
mode:
authorAlexander Gavriliuk <alexandrgproductengine@lindenlab.com>2023-09-22 01:19:42 +0200
committerGuru <alexandrgproductengine@lindenlab.com>2023-09-22 01:29:32 +0200
commitc40f63911c1fad5ea5a18894f530892ddb87c8ea (patch)
tree092952ce3ac9019a0671babd4c122c64377450e0 /indra/newview/llfloaterimsessiontab.cpp
parent9de22c0eb325e1bf1fd17020a9c6d61e5a162b3a (diff)
SL-20294 The row of recent emojis displays the recently sent emoji only after clicking the collapsing smiley button
Diffstat (limited to 'indra/newview/llfloaterimsessiontab.cpp')
-rw-r--r--indra/newview/llfloaterimsessiontab.cpp82
1 files changed, 50 insertions, 32 deletions
diff --git a/indra/newview/llfloaterimsessiontab.cpp b/indra/newview/llfloaterimsessiontab.cpp
index d46780fa81..7a0de78ac5 100644
--- a/indra/newview/llfloaterimsessiontab.cpp
+++ b/indra/newview/llfloaterimsessiontab.cpp
@@ -456,7 +456,7 @@ void LLFloaterIMSessionTab::onEmojiRecentPanelToggleBtnClicked(LLFloaterIMSessio
BOOL show = !self->mEmojiRecentPanel->getVisible();
if (show)
{
- self->onEmojiRecentPanelOpening();
+ self->initEmojiRecentPanel(true);
}
self->mEmojiRecentPanel->setVisible(show);
}
@@ -482,27 +482,33 @@ void LLFloaterIMSessionTab::onEmojiPickerToggleBtnClicked(LLFloaterIMSessionTab*
}
}
-void LLFloaterIMSessionTab::onEmojiRecentPanelOpening()
-{
- std::list<llwchar>& recentlyUsed = LLFloaterEmojiPicker::getRecentlyUsed();
- if (recentlyUsed.empty())
- {
- mEmojiRecentEmptyText->setVisible(true);
- mEmojiRecentIconsCtrl->setVisible(false);
- mEmojiPickerToggleBtn->setFocus(true);
- }
- else
- {
- LLWString emojis;
- for (llwchar emoji : recentlyUsed)
- {
- emojis += emoji;
- }
- mEmojiRecentIconsCtrl->setEmojis(emojis);
- mEmojiRecentEmptyText->setVisible(false);
- mEmojiRecentIconsCtrl->setVisible(true);
- mEmojiRecentIconsCtrl->setFocus(true);
- }
+void LLFloaterIMSessionTab::initEmojiRecentPanel(bool moveFocus)
+{
+ std::list<llwchar>& recentlyUsed = LLFloaterEmojiPicker::getRecentlyUsed();
+ if (recentlyUsed.empty())
+ {
+ mEmojiRecentEmptyText->setVisible(true);
+ mEmojiRecentIconsCtrl->setVisible(false);
+ if (moveFocus)
+ {
+ mEmojiPickerToggleBtn->setFocus(true);
+ }
+ }
+ else
+ {
+ LLWString emojis;
+ for (llwchar emoji : recentlyUsed)
+ {
+ emojis += emoji;
+ }
+ mEmojiRecentIconsCtrl->setEmojis(emojis);
+ mEmojiRecentEmptyText->setVisible(false);
+ mEmojiRecentIconsCtrl->setVisible(true);
+ if (moveFocus)
+ {
+ mEmojiRecentIconsCtrl->setFocus(true);
+ }
+ }
}
void LLFloaterIMSessionTab::onRecentEmojiPicked(const LLSD& value)
@@ -514,7 +520,7 @@ void LLFloaterIMSessionTab::onRecentEmojiPicked(const LLSD& value)
if (wstr.size())
{
llwchar emoji = wstr[0];
- onEmojiPicked(emoji);
+ mInputEditor->insertEmoji(emoji);
}
}
}
@@ -579,16 +585,28 @@ void LLFloaterIMSessionTab::appendMessage(const LLChat& chat, const LLSD& args)
void LLFloaterIMSessionTab::updateUsedEmojis(LLWString text)
{
- LLEmojiDictionary* dictionary = LLEmojiDictionary::getInstance();
- llassert_always(dictionary);
+ LLEmojiDictionary* dictionary = LLEmojiDictionary::getInstance();
+ llassert_always(dictionary);
- for (llwchar& c : text)
- {
- if (dictionary->isEmoji(c))
- {
- LLFloaterEmojiPicker::onEmojiUsed(c);
- }
- }
+ bool emojiSent = false;
+ for (llwchar& c : text)
+ {
+ if (dictionary->isEmoji(c))
+ {
+ LLFloaterEmojiPicker::onEmojiUsed(c);
+ emojiSent = true;
+ }
+ }
+
+ if (!emojiSent)
+ return;
+
+ LLFloaterEmojiPicker::onRecentlyUsedChanged();
+
+ if (mEmojiRecentPanel->getVisible())
+ {
+ initEmojiRecentPanel(false);
+ }
}
static LLTrace::BlockTimerStatHandle FTM_BUILD_CONVERSATION_VIEW_PARTICIPANT("Build Conversation View");