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/llfloaterimsessiontab.cpp | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) (limited to 'indra/newview/llfloaterimsessiontab.cpp') diff --git a/indra/newview/llfloaterimsessiontab.cpp b/indra/newview/llfloaterimsessiontab.cpp index 78271369d2..3d9751dd35 100644 --- a/indra/newview/llfloaterimsessiontab.cpp +++ b/indra/newview/llfloaterimsessiontab.cpp @@ -40,6 +40,7 @@ #include "llchicletbar.h" #include "lldraghandle.h" #include "llfloaterreg.h" +#include "llfloateremojipicker.h" #include "llfloaterimsession.h" #include "llfloaterimcontainer.h" // to replace separate IM Floaters with multifloater container #include "lllayoutstack.h" @@ -250,10 +251,13 @@ BOOL LLFloaterIMSessionTab::postBuild() mTearOffBtn = getChild("tear_off_btn"); mTearOffBtn->setCommitCallback(boost::bind(&LLFloaterIMSessionTab::onTearOffClicked, this)); + mEmojiBtn = getChild("emoji_panel_btn"); + mEmojiBtn->setClickedCallback(boost::bind(&LLFloaterIMSessionTab::onEmojiPanelBtnClicked, this)); + mGearBtn = getChild("gear_btn"); mAddBtn = getChild("add_btn"); mVoiceButton = getChild("voice_call_btn"); - + mParticipantListPanel = getChild("speakers_list_panel"); mRightPartPanel = getChild("right_part_holder"); @@ -424,6 +428,30 @@ void LLFloaterIMSessionTab::onInputEditorClicked() gToolBarView->flashCommand(LLCommandId("chat"), false); } +void LLFloaterIMSessionTab::onEmojiPanelBtnClicked(LLFloaterIMSessionTab* self) +{ + if (LLFloaterEmojiPicker* picker = LLFloaterEmojiPicker::getInstance()) + { + if (!picker->isShown()) + { + picker->show(boost::bind(&LLFloaterIMSessionTab::onEmojiSelected, self, _1)); + if (LLFloater* root_floater = gFloaterView->getParentFloater(self)) + { + root_floater->addDependentFloater(picker); + } + } + else + { + picker->closeFloater(); + } + } +} + +void LLFloaterIMSessionTab::onEmojiSelected(llwchar emoji) +{ + mInputEditor->insertEmoji(emoji); +} + std::string LLFloaterIMSessionTab::appendTime() { time_t utc_time; -- 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/llfloaterimsessiontab.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'indra/newview/llfloaterimsessiontab.cpp') diff --git a/indra/newview/llfloaterimsessiontab.cpp b/indra/newview/llfloaterimsessiontab.cpp index 3d9751dd35..0571a0d855 100644 --- a/indra/newview/llfloaterimsessiontab.cpp +++ b/indra/newview/llfloaterimsessiontab.cpp @@ -434,10 +434,12 @@ void LLFloaterIMSessionTab::onEmojiPanelBtnClicked(LLFloaterIMSessionTab* self) { if (!picker->isShown()) { - picker->show(boost::bind(&LLFloaterIMSessionTab::onEmojiSelected, self, _1)); + picker->show( + boost::bind(&LLFloaterIMSessionTab::onEmojiPicked, self, _1), + boost::bind(&LLFloaterIMSessionTab::onEmojiPickerClosed, self)); if (LLFloater* root_floater = gFloaterView->getParentFloater(self)) { - root_floater->addDependentFloater(picker); + root_floater->addDependentFloater(picker, TRUE, TRUE); } } else @@ -447,11 +449,16 @@ void LLFloaterIMSessionTab::onEmojiPanelBtnClicked(LLFloaterIMSessionTab* self) } } -void LLFloaterIMSessionTab::onEmojiSelected(llwchar emoji) +void LLFloaterIMSessionTab::onEmojiPicked(llwchar emoji) { mInputEditor->insertEmoji(emoji); } +void LLFloaterIMSessionTab::onEmojiPickerClosed() +{ + mInputEditor->setFocus(TRUE); +} + std::string LLFloaterIMSessionTab::appendTime() { time_t utc_time; -- 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/llfloaterimsessiontab.cpp | 50 ++++++++++++++------------------- 1 file changed, 21 insertions(+), 29 deletions(-) (limited to 'indra/newview/llfloaterimsessiontab.cpp') diff --git a/indra/newview/llfloaterimsessiontab.cpp b/indra/newview/llfloaterimsessiontab.cpp index 0571a0d855..dbd2d71f94 100644 --- a/indra/newview/llfloaterimsessiontab.cpp +++ b/indra/newview/llfloaterimsessiontab.cpp @@ -435,8 +435,8 @@ void LLFloaterIMSessionTab::onEmojiPanelBtnClicked(LLFloaterIMSessionTab* self) if (!picker->isShown()) { picker->show( - boost::bind(&LLFloaterIMSessionTab::onEmojiPicked, self, _1), - boost::bind(&LLFloaterIMSessionTab::onEmojiPickerClosed, self)); + [self](llwchar emoji) { self->onEmojiPicked(emoji); }, + [self]() { self->onEmojiPickerClosed(); }); if (LLFloater* root_floater = gFloaterView->getParentFloater(self)) { root_floater->addDependentFloater(picker, TRUE, TRUE); @@ -461,51 +461,43 @@ void LLFloaterIMSessionTab::onEmojiPickerClosed() std::string LLFloaterIMSessionTab::appendTime() { - time_t utc_time; - utc_time = time_corrected(); - std::string timeStr ="["+ LLTrans::getString("TimeHour")+"]:[" - +LLTrans::getString("TimeMin")+"]"; + std::string timeStr = "[" + LLTrans::getString("TimeHour") + "]:" + "[" + LLTrans::getString("TimeMin") + "]"; LLSD substitution; - - substitution["datetime"] = (S32) utc_time; - LLStringUtil::format (timeStr, substitution); + substitution["datetime"] = (S32)time_corrected(); + LLStringUtil::format(timeStr, substitution); return timeStr; } -void LLFloaterIMSessionTab::appendMessage(const LLChat& chat, const LLSD &args) +void LLFloaterIMSessionTab::appendMessage(const LLChat& chat, const LLSD& args) { + if (chat.mMuted || !mChatHistory) + return; // Update the participant activity time LLFloaterIMContainer* im_box = LLFloaterIMContainer::findInstance(); if (im_box) { - im_box->setTimeNow(mSessionID,chat.mFromID); + im_box->setTimeNow(mSessionID, chat.mFromID); } - LLChat& tmp_chat = const_cast(chat); - if(tmp_chat.mTimeStr.empty()) + if (tmp_chat.mTimeStr.empty()) tmp_chat.mTimeStr = appendTime(); - if (!chat.mMuted) - { - tmp_chat.mFromName = chat.mFromName; - LLSD chat_args; - if (args) chat_args = args; - chat_args["use_plain_text_chat_history"] = - gSavedSettings.getBOOL("PlainTextChatHistory"); - chat_args["show_time"] = gSavedSettings.getBOOL("IMShowTime"); - chat_args["show_names_for_p2p_conv"] = - !mIsP2PChat || gSavedSettings.getBOOL("IMShowNamesForP2PConv"); - - if (mChatHistory) - { - mChatHistory->appendMessage(chat, chat_args); - } - } + tmp_chat.mFromName = chat.mFromName; + + LLSD chat_args = args; + chat_args["use_plain_text_chat_history"] = + gSavedSettings.getBOOL("PlainTextChatHistory"); + chat_args["show_time"] = gSavedSettings.getBOOL("IMShowTime"); + chat_args["show_names_for_p2p_conv"] = !mIsP2PChat || + gSavedSettings.getBOOL("IMShowNamesForP2PConv"); + + mChatHistory->appendMessage(chat, chat_args); } static LLTrace::BlockTimerStatHandle FTM_BUILD_CONVERSATION_VIEW_PARTICIPANT("Build Conversation View"); -- cgit v1.2.3 From 264d9c32d9e04df0ceeaf2a63f6872aad29dd46a Mon Sep 17 00:00:00 2001 From: Alexander Gavriliuk Date: Fri, 28 Jul 2023 18:42:57 +0200 Subject: SL-20088 EmojiPicker - replace the image on the activation button with an emoji --- indra/newview/llfloaterimsessiontab.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/llfloaterimsessiontab.cpp') diff --git a/indra/newview/llfloaterimsessiontab.cpp b/indra/newview/llfloaterimsessiontab.cpp index 8ab41b227b..bacfd8ca33 100644 --- a/indra/newview/llfloaterimsessiontab.cpp +++ b/indra/newview/llfloaterimsessiontab.cpp @@ -254,6 +254,7 @@ BOOL LLFloaterIMSessionTab::postBuild() mTearOffBtn->setCommitCallback(boost::bind(&LLFloaterIMSessionTab::onTearOffClicked, this)); mEmojiBtn = getChild("emoji_panel_btn"); + mEmojiBtn->setLabel(LLUIString(LLWString(1, 128512))); mEmojiBtn->setClickedCallback(boost::bind(&LLFloaterIMSessionTab::onEmojiPanelBtnClicked, this)); mGearBtn = getChild("gear_btn"); -- cgit v1.2.3 From f18746a1753fc8d5338fcaeb839540a071c68b13 Mon Sep 17 00:00:00 2001 From: Alexander Gavriliuk Date: Tue, 29 Aug 2023 15:31:03 +0200 Subject: SL-20209 EmojiPicker - Show 'Recent' panel instead of the floater on click the button --- indra/newview/llfloaterimsessiontab.cpp | 299 ++++++++++++++++++++------------ 1 file changed, 186 insertions(+), 113 deletions(-) (limited to 'indra/newview/llfloaterimsessiontab.cpp') diff --git a/indra/newview/llfloaterimsessiontab.cpp b/indra/newview/llfloaterimsessiontab.cpp index bacfd8ca33..61722a823f 100644 --- a/indra/newview/llfloaterimsessiontab.cpp +++ b/indra/newview/llfloaterimsessiontab.cpp @@ -33,7 +33,6 @@ #include "llagentcamera.h" #include "llavataractions.h" #include "llavatariconctrl.h" -#include "llgroupiconctrl.h" #include "llchatentry.h" #include "llchathistory.h" #include "llchiclet.h" @@ -43,9 +42,11 @@ #include "llfloateremojipicker.h" #include "llfloaterimsession.h" #include "llfloaterimcontainer.h" // to replace separate IM Floaters with multifloater container +#include "llfloaterimnearbychat.h" +#include "llgroupiconctrl.h" #include "lllayoutstack.h" +#include "llpanelemojicomplete.h" #include "lltoolbarview.h" -#include "llfloaterimnearbychat.h" const F32 REFRESH_INTERVAL = 1.0f; const std::string ICN_GROUP("group_chat_icon"); @@ -57,7 +58,7 @@ void cb_group_do_nothing() } LLFloaterIMSessionTab::LLFloaterIMSessionTab(const LLSD& session_id) -: LLTransientDockableFloater(NULL, false, session_id), +: super(NULL, false, session_id), mIsP2PChat(false), mExpandCollapseBtn(NULL), mTearOffBtn(NULL), @@ -76,7 +77,7 @@ LLFloaterIMSessionTab::LLFloaterIMSessionTab(const LLSD& session_id) mInputPanels(NULL), mChatLayoutPanelHeight(0) { - setAutoFocus(FALSE); + setAutoFocus(FALSE); mSession = LLIMModel::getInstance()->findIMSession(mSessionID); mCommitCallbackRegistrar.add("IMSession.Menu.Action", @@ -89,12 +90,12 @@ LLFloaterIMSessionTab::LLFloaterIMSessionTab(const LLSD& session_id) boost::bind(&LLFloaterIMSessionTab::onIMShowModesMenuItemEnable, this, _2)); // Right click menu handling - mEnableCallbackRegistrar.add("Avatar.CheckItem", boost::bind(&LLFloaterIMSessionTab::checkContextMenuItem, this, _2)); - mEnableCallbackRegistrar.add("Avatar.EnableItem", boost::bind(&LLFloaterIMSessionTab::enableContextMenuItem, this, _2)); - mCommitCallbackRegistrar.add("Avatar.DoToSelected", boost::bind(&LLFloaterIMSessionTab::doToSelected, this, _2)); - mCommitCallbackRegistrar.add("Group.DoToSelected", boost::bind(&cb_group_do_nothing)); + mEnableCallbackRegistrar.add("Avatar.CheckItem", boost::bind(&LLFloaterIMSessionTab::checkContextMenuItem, this, _2)); + mEnableCallbackRegistrar.add("Avatar.EnableItem", boost::bind(&LLFloaterIMSessionTab::enableContextMenuItem, this, _2)); + mCommitCallbackRegistrar.add("Avatar.DoToSelected", boost::bind(&LLFloaterIMSessionTab::doToSelected, this, _2)); + mCommitCallbackRegistrar.add("Group.DoToSelected", boost::bind(&cb_group_do_nothing)); - mMinFloaterHeight = getMinHeight(); + mMinFloaterHeight = getMinHeight(); } LLFloaterIMSessionTab::~LLFloaterIMSessionTab() @@ -102,7 +103,7 @@ LLFloaterIMSessionTab::~LLFloaterIMSessionTab() delete mRefreshTimer; } -//static +// static LLFloaterIMSessionTab* LLFloaterIMSessionTab::findConversation(const LLUUID& uuid) { LLFloaterIMSessionTab* conv; @@ -119,7 +120,7 @@ LLFloaterIMSessionTab* LLFloaterIMSessionTab::findConversation(const LLUUID& uui return conv; }; -//static +// static LLFloaterIMSessionTab* LLFloaterIMSessionTab::getConversation(const LLUUID& uuid) { LLFloaterIMSessionTab* conv; @@ -135,14 +136,16 @@ LLFloaterIMSessionTab* LLFloaterIMSessionTab::getConversation(const LLUUID& uuid } return conv; + }; +// virtual void LLFloaterIMSessionTab::setVisible(BOOL visible) { - if(visible && !mHasVisibleBeenInitialized) + if (visible && !mHasVisibleBeenInitialized) { mHasVisibleBeenInitialized = true; - if(!gAgentCamera.cameraMouselook()) + if (!gAgentCamera.cameraMouselook()) { LLFloaterReg::getTypedInstance("im_container")->setVisible(true); } @@ -156,27 +159,26 @@ void LLFloaterIMSessionTab::setVisible(BOOL visible) mInputButtonPanel->setVisible(isTornOff()); } - LLTransientDockableFloater::setVisible(visible); + super::setVisible(visible); } -/*virtual*/ +// virtual void LLFloaterIMSessionTab::setFocus(BOOL focus) { - LLTransientDockableFloater::setFocus(focus); + super::setFocus(focus); - //Redirect focus to input editor - if (focus) + // Redirect focus to input editor + if (focus) { - updateMessages(); + updateMessages(); - if (mInputEditor) - { - mInputEditor->setFocus(TRUE); - } + if (mInputEditor) + { + mInputEditor->setFocus(TRUE); + } } } - void LLFloaterIMSessionTab::addToHost(const LLUUID& session_id) { if ((session_id.notNull() && !gIMMgr->hasSession(session_id)) @@ -221,44 +223,58 @@ void LLFloaterIMSessionTab::assignResizeLimits() { bool is_participants_pane_collapsed = mParticipantListPanel->isCollapsed(); - // disable a layoutstack's functionality when participant list panel is collapsed + // disable a layoutstack's functionality when participant list panel is collapsed mRightPartPanel->setIgnoreReshape(is_participants_pane_collapsed); - S32 participants_pane_target_width = is_participants_pane_collapsed? - 0 : (mParticipantListPanel->getRect().getWidth() + mParticipantListAndHistoryStack->getPanelSpacing()); + S32 participants_pane_target_width = is_participants_pane_collapsed? + 0 : (mParticipantListPanel->getRect().getWidth() + mParticipantListAndHistoryStack->getPanelSpacing()); - S32 new_min_width = participants_pane_target_width + mRightPartPanel->getExpandedMinDim() + mFloaterExtraWidth; + S32 new_min_width = participants_pane_target_width + mRightPartPanel->getExpandedMinDim() + mFloaterExtraWidth; setResizeLimits(new_min_width, getMinHeight()); this->mParticipantListAndHistoryStack->updateLayout(); } +// virtual BOOL LLFloaterIMSessionTab::postBuild() { BOOL result; mBodyStack = getChild("main_stack"); - mParticipantListAndHistoryStack = getChild("im_panels"); + mParticipantListAndHistoryStack = getChild("im_panels"); mCloseBtn = getChild("close_btn"); - mCloseBtn->setCommitCallback(boost::bind(&LLFloater::onClickClose, this)); + mCloseBtn->setCommitCallback([this](LLUICtrl*, const LLSD&) { onClickClose(this); }); mExpandCollapseBtn = getChild("expand_collapse_btn"); - mExpandCollapseBtn->setClickedCallback(boost::bind(&LLFloaterIMSessionTab::onSlide, this)); + mExpandCollapseBtn->setClickedCallback([this](LLUICtrl*, const LLSD&) { onSlide(this); }); mExpandCollapseLineBtn = getChild("minz_btn"); - mExpandCollapseLineBtn->setClickedCallback(boost::bind(&LLFloaterIMSessionTab::onCollapseToLine, this)); + mExpandCollapseLineBtn->setClickedCallback([this](LLUICtrl*, const LLSD&) { onCollapseToLine(this); }); mTearOffBtn = getChild("tear_off_btn"); mTearOffBtn->setCommitCallback(boost::bind(&LLFloaterIMSessionTab::onTearOffClicked, this)); - mEmojiBtn = getChild("emoji_panel_btn"); - mEmojiBtn->setLabel(LLUIString(LLWString(1, 128512))); - mEmojiBtn->setClickedCallback(boost::bind(&LLFloaterIMSessionTab::onEmojiPanelBtnClicked, this)); + mEmojiRecentPanelToggleBtn = getChild("emoji_recent_panel_toggle_btn"); + mEmojiRecentPanelToggleBtn->setLabel(LLUIString(LLWString(1, 128512))); + mEmojiRecentPanelToggleBtn->setClickedCallback([this](LLUICtrl*, const LLSD&) { onEmojiRecentPanelToggleBtnClicked(this); }); + + mEmojiRecentPanel = getChild("emoji_recent_layout_panel"); + mEmojiRecentPanel->setVisible(false); + + mEmojiRecentEmptyText = getChildView("emoji_recent_empty_text"); + mEmojiRecentEmptyText->setVisible(false); + + mEmojiRecentIconsCtrl = getChild("emoji_recent_icons_ctrl"); + mEmojiRecentIconsCtrl->setCommitCallback([this](LLUICtrl*, const LLSD& value) { onRecentEmojiPicked(value); }); + mEmojiRecentIconsCtrl->setVisible(false); + + mEmojiPickerToggleBtn = getChild("emoji_picker_toggle_btn"); + mEmojiPickerToggleBtn->setClickedCallback([this](LLUICtrl*, const LLSD&) { onEmojiPickerToggleBtnClicked(this); }); mGearBtn = getChild("gear_btn"); - mAddBtn = getChild("add_btn"); + mAddBtn = getChild("add_btn"); mVoiceButton = getChild("voice_call_btn"); mParticipantListPanel = getChild("speakers_list_panel"); @@ -312,17 +328,17 @@ BOOL LLFloaterIMSessionTab::postBuild() // Create the root using an ad-hoc base item LLConversationItem* base_item = new LLConversationItem(mSessionID, mConversationViewModel); - LLFolderView::Params p(LLUICtrlFactory::getDefaultParams()); - p.rect = LLRect(0, 0, getRect().getWidth(), 0); - p.parent_panel = mParticipantListPanel; - p.listener = base_item; - p.view_model = &mConversationViewModel; - p.root = NULL; - p.use_ellipses = true; - p.options_menu = "menu_conversation.xml"; - p.name = "root"; + LLFolderView::Params p(LLUICtrlFactory::getDefaultParams()); + p.rect = LLRect(0, 0, getRect().getWidth(), 0); + p.parent_panel = mParticipantListPanel; + p.listener = base_item; + p.view_model = &mConversationViewModel; + p.root = NULL; + p.use_ellipses = true; + p.options_menu = "menu_conversation.xml"; + p.name = "root"; mConversationsRoot = LLUICtrlFactory::create(p); - mConversationsRoot->setCallbackRegistrar(&mCommitCallbackRegistrar); + mConversationsRoot->setCallbackRegistrar(&mCommitCallbackRegistrar); mConversationsRoot->setEnableRegistrar(&mEnableCallbackRegistrar); // Attach that root to the scroller mScroller->addChild(mConversationsRoot); @@ -362,6 +378,7 @@ LLParticipantList* LLFloaterIMSessionTab::getParticipantList() return dynamic_cast(LLFloaterIMContainer::getInstance()->getSessionModel(mSessionID)); } +// virtual void LLFloaterIMSessionTab::draw() { if (mRefreshTimer->hasExpired()) @@ -386,23 +403,24 @@ void LLFloaterIMSessionTab::draw() mRefreshTimer->setTimerExpirySec(REFRESH_INTERVAL); } - LLTransientDockableFloater::draw(); + super::draw(); } void LLFloaterIMSessionTab::enableDisableCallBtn() { - if (LLVoiceClient::instanceExists() && mVoiceButton) - { - mVoiceButton->setEnabled( - mSessionID.notNull() - && mSession - && mSession->mSessionInitialized - && LLVoiceClient::getInstance()->voiceEnabled() - && LLVoiceClient::getInstance()->isVoiceWorking() - && mSession->mCallBackEnabled); - } + if (LLVoiceClient::instanceExists() && mVoiceButton) + { + mVoiceButton->setEnabled( + mSessionID.notNull() + && mSession + && mSession->mSessionInitialized + && LLVoiceClient::getInstance()->voiceEnabled() + && LLVoiceClient::getInstance()->isVoiceWorking() + && mSession->mCallBackEnabled); + } } +// virtual void LLFloaterIMSessionTab::onFocusReceived() { setBackgroundOpaque(true); @@ -412,13 +430,14 @@ void LLFloaterIMSessionTab::onFocusReceived() LLIMModel::instance().sendNoUnreadMessages(mSessionID); } - LLTransientDockableFloater::onFocusReceived(); + super::onFocusReceived(); } +// virtual void LLFloaterIMSessionTab::onFocusLost() { setBackgroundOpaque(false); - LLTransientDockableFloater::onFocusLost(); + super::onFocusLost(); } void LLFloaterIMSessionTab::onInputEditorClicked() @@ -431,7 +450,17 @@ void LLFloaterIMSessionTab::onInputEditorClicked() gToolBarView->flashCommand(LLCommandId("chat"), false); } -void LLFloaterIMSessionTab::onEmojiPanelBtnClicked(LLFloaterIMSessionTab* self) +void LLFloaterIMSessionTab::onEmojiRecentPanelToggleBtnClicked(LLFloaterIMSessionTab* self) +{ + BOOL show = !self->mEmojiRecentPanel->getVisible(); + if (show) + { + self->onEmojiRecentPanelOpening(); + } + self->mEmojiRecentPanel->setVisible(show); +} + +void LLFloaterIMSessionTab::onEmojiPickerToggleBtnClicked(LLFloaterIMSessionTab* self) { if (LLFloaterEmojiPicker* picker = LLFloaterEmojiPicker::getInstance()) { @@ -452,6 +481,44 @@ void LLFloaterIMSessionTab::onEmojiPanelBtnClicked(LLFloaterIMSessionTab* self) } } +void LLFloaterIMSessionTab::onEmojiRecentPanelOpening() +{ + std::list& 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::onRecentEmojiPicked(const LLSD& value) +{ + LLSD::String str = value.asString(); + if (str.size()) + { + LLWString wstr = utf8string_to_wstring(str); + if (wstr.size()) + { + llwchar emoji = wstr[0]; + LLFloaterEmojiPicker::onEmojiUsed(emoji); + onEmojiPicked(emoji); + } + } +} + void LLFloaterIMSessionTab::onEmojiPicked(llwchar emoji) { mInputEditor->insertEmoji(emoji); @@ -462,6 +529,12 @@ void LLFloaterIMSessionTab::onEmojiPickerClosed() mInputEditor->setFocus(TRUE); } +void LLFloaterIMSessionTab::closeFloater(bool app_quitting) +{ + LLFloaterEmojiPicker::saveState(); + super::closeFloater(app_quitting); +} + std::string LLFloaterIMSessionTab::appendTime() { std::string timeStr = "[" + LLTrans::getString("TimeHour") + "]:" @@ -530,10 +603,10 @@ void LLFloaterIMSessionTab::buildConversationViewParticipant() while (current_participant_model != end_participant_model) { LLConversationItem* participant_model = dynamic_cast(*current_participant_model); - if (participant_model) - { - addConversationViewParticipant(participant_model); - } + if (participant_model) + { + addConversationViewParticipant(participant_model); + } current_participant_model++; } } @@ -553,10 +626,10 @@ void LLFloaterIMSessionTab::addConversationViewParticipant(LLConversationItem* p // If not already present, create the participant view and attach it to the root, otherwise, just refresh it if (widget) { - if (update_view) - { - updateConversationViewParticipant(uuid); // overkill? - } + if (update_view) + { + updateConversationViewParticipant(uuid); // overkill? + } } else { @@ -606,11 +679,11 @@ void LLFloaterIMSessionTab::refreshConversation() { participants_uuids.push_back(widget_it->first); } - if (widget_it->second->getViewModelItem()) - { - widget_it->second->refresh(); - widget_it->second->setVisible(TRUE); - } + if (widget_it->second->getViewModelItem()) + { + widget_it->second->refresh(); + widget_it->second->setVisible(TRUE); + } ++widget_it; } if (is_ad_hoc || mIsP2PChat) @@ -666,7 +739,7 @@ void LLFloaterIMSessionTab::refreshConversation() // Copied from LLFloaterIMContainer::createConversationViewParticipant(). Refactor opportunity! LLConversationViewParticipant* LLFloaterIMSessionTab::createConversationViewParticipant(LLConversationItem* item) { - LLRect panel_rect = mParticipantListPanel->getRect(); + LLRect panel_rect = mParticipantListPanel->getRect(); LLConversationViewParticipant::Params params; params.name = item->getDisplayName(); @@ -794,7 +867,7 @@ void LLFloaterIMSessionTab::hideAllStandardButtons() void LLFloaterIMSessionTab::updateHeaderAndToolbar() { // prevent start conversation before its container - LLFloaterIMContainer::getInstance(); + LLFloaterIMContainer::getInstance(); bool is_not_torn_off = !checkIfTornOff(); if (is_not_torn_off) @@ -811,12 +884,12 @@ void LLFloaterIMSessionTab::updateHeaderAndToolbar() && !mIsP2PChat; mParticipantListAndHistoryStack->collapsePanel(mParticipantListPanel, !is_participant_list_visible); - mParticipantListPanel->setVisible(is_participant_list_visible); + mParticipantListPanel->setVisible(is_participant_list_visible); // Display collapse image (<<) if the floater is hosted // or if it is torn off but has an open control panel. bool is_expanded = is_not_torn_off || is_participant_list_visible; - + mExpandCollapseBtn->setImageOverlay(getString(is_expanded ? "collapse_icon" : "expand_icon")); mExpandCollapseBtn->setToolTip( is_not_torn_off? @@ -845,10 +918,10 @@ void LLFloaterIMSessionTab::updateHeaderAndToolbar() void LLFloaterIMSessionTab::forceReshape() { - LLRect floater_rect = getRect(); - reshape(llmax(floater_rect.getWidth(), this->getMinWidth()), - llmax(floater_rect.getHeight(), this->getMinHeight()), - true); + LLRect floater_rect = getRect(); + reshape(llmax(floater_rect.getWidth(), this->getMinWidth()), + llmax(floater_rect.getHeight(), this->getMinHeight()), + true); } @@ -874,7 +947,7 @@ void LLFloaterIMSessionTab::processChatHistoryStyleUpdate(bool clean_messages/* LLFloaterIMNearbyChat* nearby_chat = LLFloaterReg::findTypedInstance("nearby_chat"); if (nearby_chat) { - nearby_chat->reloadMessages(clean_messages); + nearby_chat->reloadMessages(clean_messages); } } @@ -920,15 +993,15 @@ void LLFloaterIMSessionTab::onSlide(LLFloaterIMSessionTab* self) { if (!self->mIsP2PChat) { - // The state must toggle the collapsed state of the panel - should_be_expanded = self->mParticipantListPanel->isCollapsed(); + // The state must toggle the collapsed state of the panel + should_be_expanded = self->mParticipantListPanel->isCollapsed(); // Update the expand/collapse flag of the participant list panel and save it - gSavedSettings.setBOOL("IMShowControlPanel", should_be_expanded); - self->mIsParticipantListExpanded = should_be_expanded; - - // Refresh for immediate feedback - self->refreshConversation(); + gSavedSettings.setBOOL("IMShowControlPanel", should_be_expanded); + self->mIsParticipantListExpanded = should_be_expanded; + + // Refresh for immediate feedback + self->refreshConversation(); } } @@ -965,12 +1038,12 @@ void LLFloaterIMSessionTab::reshapeFloater(bool collapse) + mChatLayoutPanel->getRect().getHeight() - mChatLayoutPanelHeight + 2; floater_rect.mTop -= height; - setResizeLimits(getMinWidth(), floater_rect.getHeight()); + setResizeLimits(getMinWidth(), floater_rect.getHeight()); } else { floater_rect.mTop = floater_rect.mBottom + mFloaterHeight; - setResizeLimits(getMinWidth(), mMinFloaterHeight); + setResizeLimits(getMinWidth(), mMinFloaterHeight); } enableResizeCtrls(true, true, !collapse); @@ -995,7 +1068,7 @@ void LLFloaterIMSessionTab::restoreFloater() setShape(floater_rect, true); mBodyStack->updateLayout(); mExpandCollapseLineBtn->setImageOverlay(getString("expandline_icon")); - setResizeLimits(getMinWidth(), mMinFloaterHeight); + setResizeLimits(getMinWidth(), mMinFloaterHeight); setMessagePaneExpanded(true); saveCollapsedState(); mInputEditor->enableSingleLineMode(false); @@ -1021,8 +1094,8 @@ void LLFloaterIMSessionTab::onTearOffClicked() { restoreFloater(); setFollows(isTornOff()? FOLLOWS_ALL : FOLLOWS_NONE); - mSaveRect = isTornOff(); - initRectControl(); + mSaveRect = isTornOff(); + initRectControl(); LLFloater::onClickTearOff(this); LLFloaterIMContainer* container = LLFloaterReg::findTypedInstance("im_container"); @@ -1112,8 +1185,8 @@ bool LLFloaterIMSessionTab::checkIfTornOff() void LLFloaterIMSessionTab::doToSelected(const LLSD& userdata) { // Get the list of selected items in the tab - std::string command = userdata.asString(); - uuid_vec_t selected_uuids; + std::string command = userdata.asString(); + uuid_vec_t selected_uuids; getSelectedUUIDs(selected_uuids); // Perform the command (IM, profile, etc...) on the list using the general conversation container method @@ -1125,8 +1198,8 @@ void LLFloaterIMSessionTab::doToSelected(const LLSD& userdata) bool LLFloaterIMSessionTab::enableContextMenuItem(const LLSD& userdata) { // Get the list of selected items in the tab - std::string command = userdata.asString(); - uuid_vec_t selected_uuids; + std::string command = userdata.asString(); + uuid_vec_t selected_uuids; getSelectedUUIDs(selected_uuids); // Perform the item enable test on the list using the general conversation container method @@ -1137,8 +1210,8 @@ bool LLFloaterIMSessionTab::enableContextMenuItem(const LLSD& userdata) bool LLFloaterIMSessionTab::checkContextMenuItem(const LLSD& userdata) { // Get the list of selected items in the tab - std::string command = userdata.asString(); - uuid_vec_t selected_uuids; + std::string command = userdata.asString(); + uuid_vec_t selected_uuids; getSelectedUUIDs(selected_uuids); // Perform the item check on the list using the general conversation container method @@ -1148,19 +1221,19 @@ bool LLFloaterIMSessionTab::checkContextMenuItem(const LLSD& userdata) void LLFloaterIMSessionTab::getSelectedUUIDs(uuid_vec_t& selected_uuids) { - const std::set selected_items = mConversationsRoot->getSelectionList(); + const std::set selected_items = mConversationsRoot->getSelectionList(); - std::set::const_iterator it = selected_items.begin(); - const std::set::const_iterator it_end = selected_items.end(); + std::set::const_iterator it = selected_items.begin(); + const std::set::const_iterator it_end = selected_items.end(); - for (; it != it_end; ++it) - { - LLConversationItem* conversation_item = static_cast((*it)->getViewModelItem()); - if (conversation_item) - { - selected_uuids.push_back(conversation_item->getUUID()); - } - } + for (; it != it_end; ++it) + { + LLConversationItem* conversation_item = static_cast((*it)->getViewModelItem()); + if (conversation_item) + { + selected_uuids.push_back(conversation_item->getUUID()); + } + } } LLConversationItem* LLFloaterIMSessionTab::getCurSelectedViewModelItem() @@ -1168,8 +1241,8 @@ LLConversationItem* LLFloaterIMSessionTab::getCurSelectedViewModelItem() LLConversationItem *conversationItem = NULL; if(mConversationsRoot && - mConversationsRoot->getCurSelectedItem() && - mConversationsRoot->getCurSelectedItem()->getViewModelItem()) + mConversationsRoot->getCurSelectedItem() && + mConversationsRoot->getCurSelectedItem()->getViewModelItem()) { conversationItem = static_cast(mConversationsRoot->getCurSelectedItem()->getViewModelItem()) ; } -- cgit v1.2.3 From 44098db8b3fd96726fec7ec4b68b258a3408dff0 Mon Sep 17 00:00:00 2001 From: Alexander Gavriliuk Date: Wed, 30 Aug 2023 04:35:48 +0200 Subject: SL-20210 Recent Emojis - Remember emojis that were actually sent in the message --- indra/newview/llfloaterimsessiontab.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'indra/newview/llfloaterimsessiontab.cpp') diff --git a/indra/newview/llfloaterimsessiontab.cpp b/indra/newview/llfloaterimsessiontab.cpp index 61722a823f..f840dbd9c2 100644 --- a/indra/newview/llfloaterimsessiontab.cpp +++ b/indra/newview/llfloaterimsessiontab.cpp @@ -38,6 +38,7 @@ #include "llchiclet.h" #include "llchicletbar.h" #include "lldraghandle.h" +#include "llemojidictionary.h" #include "llfloaterreg.h" #include "llfloateremojipicker.h" #include "llfloaterimsession.h" @@ -513,7 +514,6 @@ void LLFloaterIMSessionTab::onRecentEmojiPicked(const LLSD& value) if (wstr.size()) { llwchar emoji = wstr[0]; - LLFloaterEmojiPicker::onEmojiUsed(emoji); onEmojiPicked(emoji); } } @@ -576,6 +576,20 @@ void LLFloaterIMSessionTab::appendMessage(const LLChat& chat, const LLSD& args) mChatHistory->appendMessage(chat, chat_args); } +void LLFloaterIMSessionTab::updateUsedEmojis(LLWString text) +{ + LLEmojiDictionary* dictionary = LLEmojiDictionary::getInstance(); + llassert_always(dictionary); + + for (llwchar& c : text) + { + if (dictionary->isEmoji(c)) + { + LLFloaterEmojiPicker::onEmojiUsed(c); + } + } +} + static LLTrace::BlockTimerStatHandle FTM_BUILD_CONVERSATION_VIEW_PARTICIPANT("Build Conversation View"); void LLFloaterIMSessionTab::buildConversationViewParticipant() { -- cgit v1.2.3 From 0e135d2a2c1119592a2b7ca70acd95711241de16 Mon Sep 17 00:00:00 2001 From: Alexander Gavriliuk Date: Wed, 13 Sep 2023 18:19:50 +0200 Subject: SL-20247 Keep the focus on the chat field as emojis in the offboard floater are clicked --- indra/newview/llfloaterimsessiontab.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/llfloaterimsessiontab.cpp') diff --git a/indra/newview/llfloaterimsessiontab.cpp b/indra/newview/llfloaterimsessiontab.cpp index f840dbd9c2..d46780fa81 100644 --- a/indra/newview/llfloaterimsessiontab.cpp +++ b/indra/newview/llfloaterimsessiontab.cpp @@ -522,6 +522,7 @@ void LLFloaterIMSessionTab::onRecentEmojiPicked(const LLSD& value) void LLFloaterIMSessionTab::onEmojiPicked(llwchar emoji) { mInputEditor->insertEmoji(emoji); + mInputEditor->setFocus(TRUE); } void LLFloaterIMSessionTab::onEmojiPickerClosed() -- 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/llfloaterimsessiontab.cpp | 82 ++++++++++++++++++++------------- 1 file changed, 50 insertions(+), 32 deletions(-) (limited to 'indra/newview/llfloaterimsessiontab.cpp') 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& 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& 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"); -- cgit v1.2.3 From 988278b8c380fc72df1001bb0e5bf38c0a1a655a Mon Sep 17 00:00:00 2001 From: Maxim Nikolenko Date: Mon, 2 Oct 2023 15:54:22 +0300 Subject: SL-20358 restore focus after opening recent emoji panel --- indra/newview/llfloaterimsessiontab.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'indra/newview/llfloaterimsessiontab.cpp') diff --git a/indra/newview/llfloaterimsessiontab.cpp b/indra/newview/llfloaterimsessiontab.cpp index 7a0de78ac5..a44303f72c 100644 --- a/indra/newview/llfloaterimsessiontab.cpp +++ b/indra/newview/llfloaterimsessiontab.cpp @@ -453,12 +453,19 @@ void LLFloaterIMSessionTab::onInputEditorClicked() void LLFloaterIMSessionTab::onEmojiRecentPanelToggleBtnClicked(LLFloaterIMSessionTab* self) { + bool restore_focus = (gFocusMgr.getLastKeyboardFocus() == self->mInputEditor); + BOOL show = !self->mEmojiRecentPanel->getVisible(); if (show) { - self->initEmojiRecentPanel(true); + self->initEmojiRecentPanel(!restore_focus); } self->mEmojiRecentPanel->setVisible(show); + + if (restore_focus) + { + self->mInputEditor->setFocus(true); + } } void LLFloaterIMSessionTab::onEmojiPickerToggleBtnClicked(LLFloaterIMSessionTab* self) -- cgit v1.2.3 From 66aee79e3e9ca9b45e7c61d843caadb8469580e5 Mon Sep 17 00:00:00 2001 From: Alexander Gavriliuk Date: Wed, 4 Oct 2023 02:29:17 +0200 Subject: SL-20348 Focus should be in the chat bar when the Conversations floater is opened --- indra/newview/llfloaterimsessiontab.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/newview/llfloaterimsessiontab.cpp') diff --git a/indra/newview/llfloaterimsessiontab.cpp b/indra/newview/llfloaterimsessiontab.cpp index a44303f72c..c188bbdce9 100644 --- a/indra/newview/llfloaterimsessiontab.cpp +++ b/indra/newview/llfloaterimsessiontab.cpp @@ -1127,6 +1127,8 @@ void LLFloaterIMSessionTab::onOpen(const LLSD& key) } mInputButtonPanel->setVisible(isTornOff()); + + setFocus(TRUE); } -- cgit v1.2.3 From 2e0892e53041f75fc991b77870a4f2f4672fefb1 Mon Sep 17 00:00:00 2001 From: Alexander Gavriliuk Date: Tue, 7 Nov 2023 08:55:15 +0100 Subject: SL-20356 Show tooltip for the empty-recent textbox --- indra/newview/llfloaterimsessiontab.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/newview/llfloaterimsessiontab.cpp') diff --git a/indra/newview/llfloaterimsessiontab.cpp b/indra/newview/llfloaterimsessiontab.cpp index c188bbdce9..04385409ca 100644 --- a/indra/newview/llfloaterimsessiontab.cpp +++ b/indra/newview/llfloaterimsessiontab.cpp @@ -264,7 +264,8 @@ BOOL LLFloaterIMSessionTab::postBuild() mEmojiRecentPanel = getChild("emoji_recent_layout_panel"); mEmojiRecentPanel->setVisible(false); - mEmojiRecentEmptyText = getChildView("emoji_recent_empty_text"); + mEmojiRecentEmptyText = getChild("emoji_recent_empty_text"); + mEmojiRecentEmptyText->setToolTip(mEmojiRecentEmptyText->getText()); mEmojiRecentEmptyText->setVisible(false); mEmojiRecentIconsCtrl = getChild("emoji_recent_icons_ctrl"); -- cgit v1.2.3 From 93e4d069d1a9d003664f23f842cf100f635607ed Mon Sep 17 00:00:00 2001 From: Alexander Gavriliuk Date: Wed, 8 Nov 2023 17:53:16 +0100 Subject: SL-20518 EmojiPicker - The 'More' button is overlapped the recently used emojis row after narrowing back the 'Conversations' floater --- indra/newview/llfloaterimsessiontab.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'indra/newview/llfloaterimsessiontab.cpp') diff --git a/indra/newview/llfloaterimsessiontab.cpp b/indra/newview/llfloaterimsessiontab.cpp index 04385409ca..5804d8701b 100644 --- a/indra/newview/llfloaterimsessiontab.cpp +++ b/indra/newview/llfloaterimsessiontab.cpp @@ -495,11 +495,11 @@ void LLFloaterIMSessionTab::initEmojiRecentPanel(bool moveFocus) std::list& recentlyUsed = LLFloaterEmojiPicker::getRecentlyUsed(); if (recentlyUsed.empty()) { - mEmojiRecentEmptyText->setVisible(true); - mEmojiRecentIconsCtrl->setVisible(false); + mEmojiRecentEmptyText->setVisible(TRUE); + mEmojiRecentIconsCtrl->setVisible(FALSE); if (moveFocus) { - mEmojiPickerToggleBtn->setFocus(true); + mEmojiPickerToggleBtn->setFocus(TRUE); } } else @@ -510,11 +510,11 @@ void LLFloaterIMSessionTab::initEmojiRecentPanel(bool moveFocus) emojis += emoji; } mEmojiRecentIconsCtrl->setEmojis(emojis); - mEmojiRecentEmptyText->setVisible(false); - mEmojiRecentIconsCtrl->setVisible(true); + mEmojiRecentEmptyText->setVisible(FALSE); + mEmojiRecentIconsCtrl->setVisible(TRUE); if (moveFocus) { - mEmojiRecentIconsCtrl->setFocus(true); + mEmojiRecentIconsCtrl->setFocus(TRUE); } } } -- cgit v1.2.3 From 88b15ff62c5225f48d60d5d49dafbd32417856c7 Mon Sep 17 00:00:00 2001 From: Alexander Gavriliuk Date: Fri, 10 Nov 2023 01:15:27 +0100 Subject: SL-20521 Focus does not move to the Nearby Chat field --- indra/newview/llfloaterimsessiontab.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'indra/newview/llfloaterimsessiontab.cpp') diff --git a/indra/newview/llfloaterimsessiontab.cpp b/indra/newview/llfloaterimsessiontab.cpp index 5804d8701b..fcfd47b365 100644 --- a/indra/newview/llfloaterimsessiontab.cpp +++ b/indra/newview/llfloaterimsessiontab.cpp @@ -454,14 +454,15 @@ void LLFloaterIMSessionTab::onInputEditorClicked() void LLFloaterIMSessionTab::onEmojiRecentPanelToggleBtnClicked(LLFloaterIMSessionTab* self) { - bool restore_focus = (gFocusMgr.getLastKeyboardFocus() == self->mInputEditor); + bool show = !self->mEmojiRecentPanel->getVisible(); + bool restore_focus = !show || (gFocusMgr.getLastKeyboardFocus() == self->mInputEditor); - BOOL show = !self->mEmojiRecentPanel->getVisible(); - if (show) - { + if (show) + { self->initEmojiRecentPanel(!restore_focus); - } - self->mEmojiRecentPanel->setVisible(show); + } + + self->mEmojiRecentPanel->setVisible(show ? TRUE : FALSE); if (restore_focus) { -- cgit v1.2.3 From 1ef524986f598038c5ebdd38ea17d2f5a56c0626 Mon Sep 17 00:00:00 2001 From: Alexander Gavriliuk Date: Fri, 10 Nov 2023 02:58:01 +0100 Subject: SL-20416 Choose emoji floater puts emoji in the chat window that opened it --- indra/newview/llfloaterimsessiontab.cpp | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) (limited to 'indra/newview/llfloaterimsessiontab.cpp') diff --git a/indra/newview/llfloaterimsessiontab.cpp b/indra/newview/llfloaterimsessiontab.cpp index fcfd47b365..0cb3d9ab47 100644 --- a/indra/newview/llfloaterimsessiontab.cpp +++ b/indra/newview/llfloaterimsessiontab.cpp @@ -273,7 +273,7 @@ BOOL LLFloaterIMSessionTab::postBuild() mEmojiRecentIconsCtrl->setVisible(false); mEmojiPickerToggleBtn = getChild("emoji_picker_toggle_btn"); - mEmojiPickerToggleBtn->setClickedCallback([this](LLUICtrl*, const LLSD&) { onEmojiPickerToggleBtnClicked(this); }); + mEmojiPickerToggleBtn->setClickedCallback([this](LLUICtrl*, const LLSD&) { onEmojiPickerToggleBtnClicked(); }); mGearBtn = getChild("gear_btn"); mAddBtn = getChild("add_btn"); @@ -470,18 +470,18 @@ void LLFloaterIMSessionTab::onEmojiRecentPanelToggleBtnClicked(LLFloaterIMSessio } } -void LLFloaterIMSessionTab::onEmojiPickerToggleBtnClicked(LLFloaterIMSessionTab* self) +void LLFloaterIMSessionTab::onEmojiPickerToggleBtnClicked() { if (LLFloaterEmojiPicker* picker = LLFloaterEmojiPicker::getInstance()) { if (!picker->isShown()) { picker->show( - [self](llwchar emoji) { self->onEmojiPicked(emoji); }, - [self]() { self->onEmojiPickerClosed(); }); - if (LLFloater* root_floater = gFloaterView->getParentFloater(self)) + [](llwchar emoji) { onEmojiPicked(emoji); }, + []() { onEmojiPickerClosed(); }); + if (LLFloaterIMContainer* im_box = LLFloaterIMContainer::findInstance()) { - root_floater->addDependentFloater(picker, TRUE, TRUE); + im_box->addDependentFloater(picker, TRUE, TRUE); } } else @@ -534,15 +534,29 @@ void LLFloaterIMSessionTab::onRecentEmojiPicked(const LLSD& value) } } +// static void LLFloaterIMSessionTab::onEmojiPicked(llwchar emoji) { - mInputEditor->insertEmoji(emoji); - mInputEditor->setFocus(TRUE); + if (LLFloaterIMContainer* im_box = LLFloaterIMContainer::findInstance()) + { + if (LLFloaterIMSessionTab* session_floater = LLFloaterIMSessionTab::findConversation(im_box->getSelectedSession())) + { + session_floater->mInputEditor->insertEmoji(emoji); + session_floater->mInputEditor->setFocus(TRUE); + } + } } +// static void LLFloaterIMSessionTab::onEmojiPickerClosed() { - mInputEditor->setFocus(TRUE); + if (LLFloaterIMContainer* im_box = LLFloaterIMContainer::findInstance()) + { + if (LLFloaterIMSessionTab* session_floater = LLFloaterIMSessionTab::findConversation(im_box->getSelectedSession())) + { + session_floater->mInputEditor->setFocus(TRUE); + } + } } void LLFloaterIMSessionTab::closeFloater(bool app_quitting) -- cgit v1.2.3 From 337b2fcc3605ef00d0338b1588c2ec86c265fd68 Mon Sep 17 00:00:00 2001 From: Alexander Gavriliuk Date: Mon, 27 Nov 2023 23:55:36 +0100 Subject: Mac build fix --- indra/newview/llfloaterimsessiontab.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llfloaterimsessiontab.cpp') diff --git a/indra/newview/llfloaterimsessiontab.cpp b/indra/newview/llfloaterimsessiontab.cpp index 0cb3d9ab47..35b2af7b84 100644 --- a/indra/newview/llfloaterimsessiontab.cpp +++ b/indra/newview/llfloaterimsessiontab.cpp @@ -273,7 +273,7 @@ BOOL LLFloaterIMSessionTab::postBuild() mEmojiRecentIconsCtrl->setVisible(false); mEmojiPickerToggleBtn = getChild("emoji_picker_toggle_btn"); - mEmojiPickerToggleBtn->setClickedCallback([this](LLUICtrl*, const LLSD&) { onEmojiPickerToggleBtnClicked(); }); + mEmojiPickerToggleBtn->setClickedCallback([](LLUICtrl*, const LLSD&) { onEmojiPickerToggleBtnClicked(); }); mGearBtn = getChild("gear_btn"); mAddBtn = getChild("add_btn"); -- 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/llfloaterimsessiontab.cpp | 81 ++++++--------------------------- 1 file changed, 13 insertions(+), 68 deletions(-) (limited to 'indra/newview/llfloaterimsessiontab.cpp') diff --git a/indra/newview/llfloaterimsessiontab.cpp b/indra/newview/llfloaterimsessiontab.cpp index 35b2af7b84..1e0540c88a 100644 --- a/indra/newview/llfloaterimsessiontab.cpp +++ b/indra/newview/llfloaterimsessiontab.cpp @@ -259,7 +259,7 @@ BOOL LLFloaterIMSessionTab::postBuild() mEmojiRecentPanelToggleBtn = getChild("emoji_recent_panel_toggle_btn"); mEmojiRecentPanelToggleBtn->setLabel(LLUIString(LLWString(1, 128512))); - mEmojiRecentPanelToggleBtn->setClickedCallback([this](LLUICtrl*, const LLSD&) { onEmojiRecentPanelToggleBtnClicked(this); }); + mEmojiRecentPanelToggleBtn->setClickedCallback([this](LLUICtrl*, const LLSD&) { onEmojiRecentPanelToggleBtnClicked(); }); mEmojiRecentPanel = getChild("emoji_recent_layout_panel"); mEmojiRecentPanel->setVisible(false); @@ -272,8 +272,8 @@ BOOL LLFloaterIMSessionTab::postBuild() mEmojiRecentIconsCtrl->setCommitCallback([this](LLUICtrl*, const LLSD& value) { onRecentEmojiPicked(value); }); mEmojiRecentIconsCtrl->setVisible(false); - mEmojiPickerToggleBtn = getChild("emoji_picker_toggle_btn"); - mEmojiPickerToggleBtn->setClickedCallback([](LLUICtrl*, const LLSD&) { onEmojiPickerToggleBtnClicked(); }); + mEmojiPickerShowBtn = getChild("emoji_picker_show_btn"); + mEmojiPickerShowBtn->setClickedCallback([this](LLUICtrl*, const LLSD&) { onEmojiPickerShowBtnClicked(); }); mGearBtn = getChild("gear_btn"); mAddBtn = getChild("add_btn"); @@ -452,56 +452,30 @@ void LLFloaterIMSessionTab::onInputEditorClicked() gToolBarView->flashCommand(LLCommandId("chat"), false); } -void LLFloaterIMSessionTab::onEmojiRecentPanelToggleBtnClicked(LLFloaterIMSessionTab* self) +void LLFloaterIMSessionTab::onEmojiRecentPanelToggleBtnClicked() { - bool show = !self->mEmojiRecentPanel->getVisible(); - bool restore_focus = !show || (gFocusMgr.getLastKeyboardFocus() == self->mInputEditor); - + BOOL show = mEmojiRecentPanel->getVisible() ? FALSE : TRUE; if (show) { - self->initEmojiRecentPanel(!restore_focus); + initEmojiRecentPanel(); } - self->mEmojiRecentPanel->setVisible(show ? TRUE : FALSE); - - if (restore_focus) - { - self->mInputEditor->setFocus(true); - } + mEmojiRecentPanel->setVisible(show); + mInputEditor->setFocus(TRUE); } -void LLFloaterIMSessionTab::onEmojiPickerToggleBtnClicked() +void LLFloaterIMSessionTab::onEmojiPickerShowBtnClicked() { - if (LLFloaterEmojiPicker* picker = LLFloaterEmojiPicker::getInstance()) - { - if (!picker->isShown()) - { - picker->show( - [](llwchar emoji) { onEmojiPicked(emoji); }, - []() { onEmojiPickerClosed(); }); - if (LLFloaterIMContainer* im_box = LLFloaterIMContainer::findInstance()) - { - im_box->addDependentFloater(picker, TRUE, TRUE); - } - } - else - { - picker->closeFloater(); - } - } + mInputEditor->showEmojiHelper(); } -void LLFloaterIMSessionTab::initEmojiRecentPanel(bool moveFocus) +void LLFloaterIMSessionTab::initEmojiRecentPanel() { std::list& recentlyUsed = LLFloaterEmojiPicker::getRecentlyUsed(); if (recentlyUsed.empty()) { mEmojiRecentEmptyText->setVisible(TRUE); mEmojiRecentIconsCtrl->setVisible(FALSE); - if (moveFocus) - { - mEmojiPickerToggleBtn->setFocus(TRUE); - } } else { @@ -513,10 +487,6 @@ void LLFloaterIMSessionTab::initEmojiRecentPanel(bool moveFocus) mEmojiRecentIconsCtrl->setEmojis(emojis); mEmojiRecentEmptyText->setVisible(FALSE); mEmojiRecentIconsCtrl->setVisible(TRUE); - if (moveFocus) - { - mEmojiRecentIconsCtrl->setFocus(TRUE); - } } } @@ -534,31 +504,6 @@ void LLFloaterIMSessionTab::onRecentEmojiPicked(const LLSD& value) } } -// static -void LLFloaterIMSessionTab::onEmojiPicked(llwchar emoji) -{ - if (LLFloaterIMContainer* im_box = LLFloaterIMContainer::findInstance()) - { - if (LLFloaterIMSessionTab* session_floater = LLFloaterIMSessionTab::findConversation(im_box->getSelectedSession())) - { - session_floater->mInputEditor->insertEmoji(emoji); - session_floater->mInputEditor->setFocus(TRUE); - } - } -} - -// static -void LLFloaterIMSessionTab::onEmojiPickerClosed() -{ - if (LLFloaterIMContainer* im_box = LLFloaterIMContainer::findInstance()) - { - if (LLFloaterIMSessionTab* session_floater = LLFloaterIMSessionTab::findConversation(im_box->getSelectedSession())) - { - session_floater->mInputEditor->setFocus(TRUE); - } - } -} - void LLFloaterIMSessionTab::closeFloater(bool app_quitting) { LLFloaterEmojiPicker::saveState(); @@ -624,11 +569,11 @@ void LLFloaterIMSessionTab::updateUsedEmojis(LLWString text) if (!emojiSent) return; - LLFloaterEmojiPicker::onRecentlyUsedChanged(); + LLFloaterEmojiPicker::saveState(); if (mEmojiRecentPanel->getVisible()) { - initEmojiRecentPanel(false); + initEmojiRecentPanel(); } } -- cgit v1.2.3 From c5f4eb32a97457e77cd178fc7769b1eb951e0ff3 Mon Sep 17 00:00:00 2001 From: Alexander Gavriliuk Date: Wed, 24 Jan 2024 17:50:19 +0100 Subject: SL-20416 Use image from file for emoji_recent_panel_toggle_btn --- indra/newview/llfloaterimsessiontab.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/newview/llfloaterimsessiontab.cpp') diff --git a/indra/newview/llfloaterimsessiontab.cpp b/indra/newview/llfloaterimsessiontab.cpp index 1e0540c88a..2cb2ea0553 100644 --- a/indra/newview/llfloaterimsessiontab.cpp +++ b/indra/newview/llfloaterimsessiontab.cpp @@ -258,7 +258,6 @@ BOOL LLFloaterIMSessionTab::postBuild() mTearOffBtn->setCommitCallback(boost::bind(&LLFloaterIMSessionTab::onTearOffClicked, this)); mEmojiRecentPanelToggleBtn = getChild("emoji_recent_panel_toggle_btn"); - mEmojiRecentPanelToggleBtn->setLabel(LLUIString(LLWString(1, 128512))); mEmojiRecentPanelToggleBtn->setClickedCallback([this](LLUICtrl*, const LLSD&) { onEmojiRecentPanelToggleBtnClicked(); }); mEmojiRecentPanel = getChild("emoji_recent_layout_panel"); -- cgit v1.2.3 From b4e29ec0e922368f23fc735fd4719f205cc760eb Mon Sep 17 00:00:00 2001 From: Alexander Gavriliuk Date: Fri, 9 Feb 2024 12:54:09 +0100 Subject: #68 The 'Recently used emoji' can not be selected by the 'Tab' key --- indra/newview/llfloaterimsessiontab.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/llfloaterimsessiontab.cpp') diff --git a/indra/newview/llfloaterimsessiontab.cpp b/indra/newview/llfloaterimsessiontab.cpp index 2cb2ea0553..24cc398f3b 100644 --- a/indra/newview/llfloaterimsessiontab.cpp +++ b/indra/newview/llfloaterimsessiontab.cpp @@ -465,6 +465,7 @@ void LLFloaterIMSessionTab::onEmojiRecentPanelToggleBtnClicked() void LLFloaterIMSessionTab::onEmojiPickerShowBtnClicked() { + mInputEditor->setFocus(TRUE); mInputEditor->showEmojiHelper(); } -- cgit v1.2.3