diff options
author | Ansariel <ansariel.hiller@phoenixviewer.com> | 2023-04-22 18:38:46 +0200 |
---|---|---|
committer | Guru <alexandrgproductengine@lindenlab.com> | 2023-04-24 22:58:54 +0200 |
commit | c2eec5b100a7064f3c737db46f893864a8b29c3a (patch) | |
tree | c5817724ff824efb0e01a31814de3d22bd82b8c5 /indra/newview/llfloateremojipicker.cpp | |
parent | e246e811faad2a307c1cabe228af14c033fde25a (diff) |
Don't hardcode UI text plus layout fixes and removing some needless checks
Diffstat (limited to 'indra/newview/llfloateremojipicker.cpp')
-rw-r--r-- | indra/newview/llfloateremojipicker.cpp | 54 |
1 files changed, 22 insertions, 32 deletions
diff --git a/indra/newview/llfloateremojipicker.cpp b/indra/newview/llfloateremojipicker.cpp index 5efd2a24c0..ab81b2936f 100644 --- a/indra/newview/llfloateremojipicker.cpp +++ b/indra/newview/llfloateremojipicker.cpp @@ -80,7 +80,7 @@ LLFloaterEmojiPicker* LLFloaterEmojiPicker::getInstance() LLFloaterEmojiPicker* LLFloaterEmojiPicker::showInstance(pick_callback_t pick_callback, close_callback_t close_callback) { LLFloaterEmojiPicker* floater = getInstance(); - if (LLFloaterEmojiPicker* floater = getInstance()) + if (floater) floater->show(pick_callback, close_callback); return floater; } @@ -101,41 +101,31 @@ LLFloaterEmojiPicker::LLFloaterEmojiPicker(const LLSD& key) BOOL LLFloaterEmojiPicker::postBuild() { // Should be initialized first - if ((mPreviewEmoji = getChild<LLButton>("PreviewEmoji"))) + mPreviewEmoji = getChild<LLButton>("PreviewEmoji"); + mPreviewEmoji->setClickedCallback(boost::bind(&LLFloaterEmojiPicker::onPreviewEmojiClick, this)); + + mCategory = getChild<LLComboBox>("Category"); + mCategory->setCommitCallback(boost::bind(&LLFloaterEmojiPicker::onCategoryCommit, this)); + const auto& cat2Descrs = LLEmojiDictionary::instance().getCategory2Descrs(); + mCategory->clearRows(); + for (const auto& item : cat2Descrs) { - mPreviewEmoji->setClickedCallback(boost::bind(&LLFloaterEmojiPicker::onPreviewEmojiClick, this)); + std::string value = item.first; + std::string name = value; + LLStringUtil::capitalize(name); + mCategory->add(name, value); } + mCategory->setSelectedByValue(mSelectedCategory, true); - if ((mCategory = getChild<LLComboBox>("Category"))) - { - mCategory->setCommitCallback(boost::bind(&LLFloaterEmojiPicker::onCategoryCommit, this)); - mCategory->setLabel(LLStringExplicit("Choose a category")); - const auto& cat2Descrs = LLEmojiDictionary::instance().getCategory2Descrs(); - mCategory->clearRows(); - for (const auto& item : cat2Descrs) - { - std::string value = item.first; - std::string name = value; - LLStringUtil::capitalize(name); - mCategory->add(name, value); - } - mCategory->setSelectedByValue(mSelectedCategory, true); - } - - if ((mSearch = getChild<LLLineEditor>("Search"))) - { - mSearch->setKeystrokeCallback(boost::bind(&LLFloaterEmojiPicker::onSearchKeystroke, this, _1, _2), NULL); - mSearch->setLabel(LLStringExplicit("Type to search an emoji")); - mSearch->setFont(LLViewerChat::getChatFont()); - mSearch->setText(mSearchPattern); - } + mSearch = getChild<LLLineEditor>("Search"); + mSearch->setKeystrokeCallback(boost::bind(&LLFloaterEmojiPicker::onSearchKeystroke, this, _1, _2), NULL); + mSearch->setFont(LLViewerChat::getChatFont()); + mSearch->setText(mSearchPattern); - if ((mEmojis = getChild<LLScrollListCtrl>("Emojis"))) - { - mEmojis->setCommitCallback(boost::bind(&LLFloaterEmojiPicker::onEmojiSelect, this)); - mEmojis->setDoubleClickCallback(boost::bind(&LLFloaterEmojiPicker::onEmojiPick, this)); - fillEmojis(); - } + mEmojis = getChild<LLScrollListCtrl>("Emojis"); + mEmojis->setCommitCallback(boost::bind(&LLFloaterEmojiPicker::onEmojiSelect, this)); + mEmojis->setDoubleClickCallback(boost::bind(&LLFloaterEmojiPicker::onEmojiPick, this)); + fillEmojis(); return TRUE; } |