Transplant (some) recent changes

master
Ansariel 2023-09-22 11:16:07 +02:00
parent 5e82c81322
commit 19c64ebfda
6 changed files with 16 additions and 12 deletions

View File

@ -975,7 +975,7 @@ BOOL FSFloaterIM::postBuild()
mEmojiPickerToggleBtn->setLabel(LLUIString(LLWString(1, 128512)));
mEmojiPickerToggleBtn->setClickedCallback([this](LLUICtrl*, const LLSD&) { onEmojiPickerToggleBtnClicked(this); });
mRecentEmojisUpdatedCallbackConnection = LLFloaterEmojiPicker::setRecentEmojisUpdatedCallback([this](const std::list<llwchar>& recent_emojis_list) { onEmojiRecentPanelOpening(); });
mRecentEmojisUpdatedCallbackConnection = LLFloaterEmojiPicker::setRecentEmojisUpdatedCallback([this](const std::list<llwchar>& recent_emojis_list) { initEmojiRecentPanel(false); });
getChild<LLButton>("send_chat")->setCommitCallback(boost::bind(&FSFloaterIM::sendMsgFromInputEditor, this, CHAT_TYPE_NORMAL));
getChild<LLButton>("chat_search_btn")->setCommitCallback(boost::bind(&FSFloaterIM::onChatSearchButtonClicked, this));
@ -2476,13 +2476,13 @@ void FSFloaterIM::onEmojiRecentPanelToggleBtnClicked(FSFloaterIM* self)
BOOL show = !self->mEmojiRecentPanel->getVisible();
if (show)
{
self->onEmojiRecentPanelOpening();
self->initEmojiRecentPanel(true);
}
self->mEmojiRecentPanel->setVisible(show);
self->mEmojiRecentPanelToggleBtn->setImageOverlay(show ? "Arrow_Up" : "Arrow_Down");
}
void FSFloaterIM::onEmojiRecentPanelOpening()
void FSFloaterIM::initEmojiRecentPanel(bool moveFocus)
{
std::list<llwchar>& recentlyUsed = LLFloaterEmojiPicker::getRecentlyUsed();
if (recentlyUsed.empty())
@ -2500,7 +2500,10 @@ void FSFloaterIM::onEmojiRecentPanelOpening()
mEmojiRecentIconsCtrl->setEmojis(emojis);
mEmojiRecentEmptyText->setVisible(false);
mEmojiRecentIconsCtrl->setVisible(true);
mEmojiRecentIconsCtrl->setFocus(true);
if (moveFocus)
{
mEmojiRecentIconsCtrl->setFocus(true);
}
}
}

View File

@ -242,7 +242,7 @@ private:
bool onChatOptionsEnableContextMenuItem(const LLSD& userdata);
static void onEmojiRecentPanelToggleBtnClicked(FSFloaterIM* self);
void onEmojiRecentPanelOpening();
void initEmojiRecentPanel(bool moveFocus);
void onRecentEmojiPicked(const LLSD& value);
void onEmojiPicked(llwchar emoji);
void onEmojiPickerClosed();

View File

@ -164,7 +164,7 @@ BOOL FSFloaterNearbyChat::postBuild()
mEmojiPickerToggleBtn->setLabel(LLUIString(LLWString(1, 128512)));
mEmojiPickerToggleBtn->setClickedCallback([this](LLUICtrl*, const LLSD&) { onEmojiPickerToggleBtnClicked(this); });
mRecentEmojisUpdatedCallbackConnection = LLFloaterEmojiPicker::setRecentEmojisUpdatedCallback([this](const std::list<llwchar>& recent_emojis_list) { onEmojiRecentPanelOpening(); });
mRecentEmojisUpdatedCallbackConnection = LLFloaterEmojiPicker::setRecentEmojisUpdatedCallback([this](const std::list<llwchar>& recent_emojis_list) { initEmojiRecentPanel(false); });
getChild<LLButton>("chat_history_btn")->setCommitCallback(boost::bind(&FSFloaterNearbyChat::onHistoryButtonClicked, this));
getChild<LLButton>("chat_search_btn")->setCommitCallback(boost::bind(&FSFloaterNearbyChat::onSearchButtonClicked, this));
@ -974,13 +974,13 @@ void FSFloaterNearbyChat::onEmojiRecentPanelToggleBtnClicked(FSFloaterNearbyChat
BOOL show = !self->mEmojiRecentPanel->getVisible();
if (show)
{
self->onEmojiRecentPanelOpening();
self->initEmojiRecentPanel(true);
}
self->mEmojiRecentPanel->setVisible(show);
self->mEmojiRecentPanelToggleBtn->setImageOverlay(show ? "Arrow_Up" : "Arrow_Down");
}
void FSFloaterNearbyChat::onEmojiRecentPanelOpening()
void FSFloaterNearbyChat::initEmojiRecentPanel(bool moveFocus)
{
std::list<llwchar>& recentlyUsed = LLFloaterEmojiPicker::getRecentlyUsed();
if (recentlyUsed.empty())
@ -998,7 +998,10 @@ void FSFloaterNearbyChat::onEmojiRecentPanelOpening()
mEmojiRecentIconsCtrl->setEmojis(emojis);
mEmojiRecentEmptyText->setVisible(false);
mEmojiRecentIconsCtrl->setVisible(true);
mEmojiRecentIconsCtrl->setFocus(true);
if (moveFocus)
{
mEmojiRecentIconsCtrl->setFocus(true);
}
}
}

View File

@ -124,7 +124,7 @@ private:
bool onChatOptionsEnableContextMenuItem(const LLSD& userdata);
static void onEmojiRecentPanelToggleBtnClicked(FSFloaterNearbyChat* self);
void onEmojiRecentPanelOpening();
void initEmojiRecentPanel(bool moveFocus);
void onRecentEmojiPicked(const LLSD& value);
void onEmojiPicked(llwchar emoji);
void onEmojiPickerClosed();

View File

@ -727,7 +727,6 @@
name="emoji_recent_icons_ctrl"
follows="top|left|right"
layout="topleft"
noscroll="true"
max_emoji="20"
top="0"
left="5"

View File

@ -418,7 +418,6 @@
name="emoji_recent_icons_ctrl"
follows="top|left|right"
layout="topleft"
noscroll="true"
max_emoji="20"
top="0"
left="5"