diff options
author | Alexander Gavriliuk <alexandrgproductengine@lindenlab.com> | 2023-04-25 00:44:25 +0200 |
---|---|---|
committer | Guru <alexandrgproductengine@lindenlab.com> | 2023-04-25 13:14:48 +0200 |
commit | fbf5b199f3bd9775bc992609baf6c093177a70d8 (patch) | |
tree | 82c635aeeb26e173e9816105d12f262041ee0f52 /indra/newview | |
parent | 8fcf691623c21dedd0e478fb8d013a28a2959811 (diff) |
SL-19575 LLFloaterEmojiPicker - code cleanup and layout fixup
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llfloateremojipicker.cpp | 27 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/floater_emoji_picker.xml | 50 |
2 files changed, 37 insertions, 40 deletions
diff --git a/indra/newview/llfloateremojipicker.cpp b/indra/newview/llfloateremojipicker.cpp index ab81b2936f..9d28f7d4dc 100644 --- a/indra/newview/llfloateremojipicker.cpp +++ b/indra/newview/llfloateremojipicker.cpp @@ -73,15 +73,14 @@ LLFloaterEmojiPicker* LLFloaterEmojiPicker::getInstance() { LLFloaterEmojiPicker* floater = LLFloaterReg::getTypedInstance<LLFloaterEmojiPicker>("emoji_picker"); if (!floater) - LL_WARNS() << "Cannot instantiate emoji picker" << LL_ENDL; + LL_ERRS() << "Cannot instantiate emoji picker" << LL_ENDL; return floater; } LLFloaterEmojiPicker* LLFloaterEmojiPicker::showInstance(pick_callback_t pick_callback, close_callback_t close_callback) { LLFloaterEmojiPicker* floater = getInstance(); - if (floater) - floater->show(pick_callback, close_callback); + floater->show(pick_callback, close_callback); return floater; } @@ -106,9 +105,9 @@ BOOL LLFloaterEmojiPicker::postBuild() mCategory = getChild<LLComboBox>("Category"); mCategory->setCommitCallback(boost::bind(&LLFloaterEmojiPicker::onCategoryCommit, this)); - const auto& cat2Descrs = LLEmojiDictionary::instance().getCategory2Descrs(); + const LLEmojiDictionary::cat2descrs_map_t& cat2Descrs = LLEmojiDictionary::instance().getCategory2Descrs(); mCategory->clearRows(); - for (const auto& item : cat2Descrs) + for (const LLEmojiDictionary::cat2descrs_item_t& item : cat2Descrs) { std::string value = item.first; std::string name = value; @@ -139,8 +138,8 @@ void LLFloaterEmojiPicker::fillEmojis() { mEmojis->clearRows(); - const auto& emoji2Descr = LLEmojiDictionary::instance().getEmoji2Descr(); - for (const std::pair<const llwchar, const LLEmojiDescriptor*>& it : emoji2Descr) + const LLEmojiDictionary::emoji2descr_map_t& emoji2Descr = LLEmojiDictionary::instance().getEmoji2Descr(); + for (const LLEmojiDictionary::emoji2descr_item_t& it : emoji2Descr) { const LLEmojiDescriptor* descr = it.second; @@ -179,10 +178,10 @@ bool LLFloaterEmojiPicker::matchesPattern(const LLEmojiDescriptor* descr) { if (descr->Name.find(mSearchPattern) != std::string::npos) return true; - for (auto shortCode : descr->ShortCodes) + for (const std::string& shortCode : descr->ShortCodes) if (shortCode.find(mSearchPattern) != std::string::npos) return true; - for (auto category : descr->Categories) + for (const std::string& category : descr->Categories) if (category.find(mSearchPattern) != std::string::npos) return true; return false; @@ -204,7 +203,7 @@ void LLFloaterEmojiPicker::onSearchKeystroke(LLLineEditor* caller, void* user_da void LLFloaterEmojiPicker::onPreviewEmojiClick() { - if (mEmojis && mEmojiPickCallback) + if (mEmojiPickCallback) { if (LLEmojiScrollListItem* item = dynamic_cast<LLEmojiScrollListItem*>(mEmojis->getFirstSelected())) { @@ -221,8 +220,7 @@ void LLFloaterEmojiPicker::onEmojiSelect() mSelectedEmojiIndex = mEmojis->getFirstSelectedIndex(); LLUIString text; text.insert(0, LLWString(1, item->getEmoji())); - if (mPreviewEmoji) - mPreviewEmoji->setLabel(text); + mPreviewEmoji->setLabel(text); return; } @@ -232,13 +230,12 @@ void LLFloaterEmojiPicker::onEmojiSelect() void LLFloaterEmojiPicker::onEmojiEmpty() { mSelectedEmojiIndex = 0; - if (mPreviewEmoji) - mPreviewEmoji->setLabel(LLUIString()); + mPreviewEmoji->setLabel(LLUIString()); } void LLFloaterEmojiPicker::onEmojiPick() { - if (mEmojis && mEmojiPickCallback) + if (mEmojiPickCallback) { if (LLEmojiScrollListItem* item = dynamic_cast<LLEmojiScrollListItem*>(mEmojis->getFirstSelected())) { diff --git a/indra/newview/skins/default/xui/en/floater_emoji_picker.xml b/indra/newview/skins/default/xui/en/floater_emoji_picker.xml index f339c7428f..000d779759 100644 --- a/indra/newview/skins/default/xui/en/floater_emoji_picker.xml +++ b/indra/newview/skins/default/xui/en/floater_emoji_picker.xml @@ -11,44 +11,44 @@ width="200"> <line_editor name="Search" - label="Type to search an emoji" + label="Type to search" layout="bottomleft" follows="bottom|left|right" text_tentative_color="TextFgTentativeColor" max_length_bytes="63" - bottom="5" - left="39" + bottom="14" + left="34" height="29" - width="158" /> + width="162" /> <button - name="PreviewEmoji" + name="PreviewEmoji" layout="bottomleft" follows="bottom|left" - font="EmojiHuge" - use_font_color="true" - bottom="5" - left="5" - height="29" - width="29" /> + font="EmojiHuge" + use_font_color="true" + bottom="14" + left="2" + height="29" + width="29" /> <scroll_list name="Emojis" layout="topleft" follows="all" sort_column="0" - max_chars="63" - commit_on_selection_change="true" + max_chars="63" + commit_on_selection_change="true" draw_heading="true" heading_height="25" - left="5" - row_padding="0" - top="25" - height="338" - width="192"> + row_padding="0" + top="25" + left="0" + height="330" + width="200"> <columns - label="Look" + label="@" name="look" - width="50" /> - <columns + width="16" /> + <columns label="Name" name="name" /> </scroll_list> @@ -57,9 +57,9 @@ label="Choose a category" layout="topleft" follows="top|left|right" - allow_text_entry="true" - top="0" - left="5" + allow_text_entry="true" + top="0" + left="2" height="25" - width="192" /> + width="196" /> </floater> |