From 32f3107a2038a20e056a87ab6bb4f094f12e2ddf Mon Sep 17 00:00:00 2001 From: Alexander Gavriliuk Date: Wed, 3 Jul 2024 14:58:07 +0200 Subject: #1917 The 'No emoji selected' message appears and overlaps emoji name --- indra/newview/llfloateremojipicker.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'indra/newview/llfloateremojipicker.cpp') diff --git a/indra/newview/llfloateremojipicker.cpp b/indra/newview/llfloateremojipicker.cpp index d38f53eed6..0370182b01 100644 --- a/indra/newview/llfloateremojipicker.cpp +++ b/indra/newview/llfloateremojipicker.cpp @@ -849,8 +849,7 @@ void LLFloaterEmojiPicker::createEmojiIcon(const LLEmojiSearchResult& emoji, void LLFloaterEmojiPicker::showPreview(bool show) { - //mPreview->setIcon(nullptr); - mDummy->setVisible(show); + mDummy->setVisible(!show); mPreview->setVisible(show); } -- cgit v1.2.3 From 9fdca96f8bd2211a99fe88e57b70cbecefa20b6d Mon Sep 17 00:00:00 2001 From: Ansariel Date: Mon, 8 Jul 2024 20:27:14 +0200 Subject: Re-enable compiler warnings C4244 and C4396 except for lltracerecording.h and llunittype.h for now --- indra/newview/llfloateremojipicker.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'indra/newview/llfloateremojipicker.cpp') diff --git a/indra/newview/llfloateremojipicker.cpp b/indra/newview/llfloateremojipicker.cpp index 0370182b01..30f58aaeec 100644 --- a/indra/newview/llfloateremojipicker.cpp +++ b/indra/newview/llfloateremojipicker.cpp @@ -101,7 +101,7 @@ public: LLScrollingPanel::draw(); F32 x = 4; // padding-left - F32 y = getRect().getHeight() / 2; + F32 y = (F32)(getRect().getHeight() / 2); LLFontGL::getFontSansSerif()->render( mText, // wstr 0, // begin_offset @@ -137,8 +137,8 @@ public: { LLScrollingPanel::draw(); - F32 x = getRect().getWidth() / 2; - F32 y = getRect().getHeight() / 2; + F32 x = (F32)(getRect().getWidth() / 2); + F32 y = (F32)(getRect().getHeight() / 2); LLFontGL::getFontEmojiLarge()->render( mChar, // wstr 0, // begin_offset @@ -206,7 +206,7 @@ public: static LLColor4 defaultColor(0.75f, 0.75f, 0.75f, 1.0f); LLColor4 textColor = LLUIColorTable::instance().getColor("MenuItemEnabledColor", defaultColor); S32 max_pixels = clientWidth - iconWidth; - drawName(iconWidth, centerY, max_pixels, textColor); + drawName((F32)iconWidth, centerY, max_pixels, textColor); } protected: @@ -229,7 +229,7 @@ protected: void drawName(F32 x, F32 y, S32 max_pixels, LLColor4& color) { F32 x0 = x; - F32 x1 = max_pixels; + F32 x1 = (F32)max_pixels; LLFontGL* font = LLFontGL::getFontEmojiLarge(); if (mBegin) { @@ -245,7 +245,7 @@ protected: LLFontGL::NORMAL, // style LLFontGL::DROP_SHADOW_SOFT, // shadow static_cast(text.size()), // max_chars - x1); // max_pixels + (S32)x1); // max_pixels F32 dx = font->getWidthF32(text); x0 += dx; x1 -= dx; @@ -264,7 +264,7 @@ protected: LLFontGL::NORMAL, // style LLFontGL::DROP_SHADOW_SOFT, // shadow static_cast(text.size()), // max_chars - x1); // max_pixels + (S32)x1); // max_pixels F32 dx = font->getWidthF32(text); x0 += dx; x1 -= dx; @@ -283,7 +283,7 @@ protected: LLFontGL::NORMAL, // style LLFontGL::DROP_SHADOW_SOFT, // shadow static_cast(text.size()), // max_chars - x1); // max_pixels + (S32)x1); // max_pixels } } @@ -864,7 +864,7 @@ void LLFloaterEmojiPicker::onGroupButtonClick(LLUICtrl* ctrl) if (it == mGroupButtons.end()) return; - selectEmojiGroup(it - mGroupButtons.begin()); + selectEmojiGroup((U32)(it - mGroupButtons.begin())); } } -- cgit v1.2.3 From 0723308c9c041533953b45fe62686e9f483ce360 Mon Sep 17 00:00:00 2001 From: Rye Mutt Date: Wed, 31 Jul 2024 23:54:45 -0400 Subject: Fix emojipicker floater group buttons leaking and xui warning --- indra/newview/llfloateremojipicker.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'indra/newview/llfloateremojipicker.cpp') diff --git a/indra/newview/llfloateremojipicker.cpp b/indra/newview/llfloateremojipicker.cpp index 30f58aaeec..0830860633 100644 --- a/indra/newview/llfloateremojipicker.cpp +++ b/indra/newview/llfloateremojipicker.cpp @@ -429,6 +429,7 @@ void LLFloaterEmojiPicker::fillGroups() for (LLButton* button : mGroupButtons) { mGroups->removeChild(button); + button->die(); } mFilteredEmojiGroups.clear(); mFilteredEmojis.clear(); @@ -442,6 +443,7 @@ void LLFloaterEmojiPicker::fillGroups() rect.mBottom = mBadge->getRect().getHeight(); // Create button for "All categories" + params.name = "all_categories"; createGroupButton(params, rect, ALL_EMOJIS_IMAGE_INDEX); // Create group and button for "Recently used" and/or "Frequently used" @@ -455,6 +457,7 @@ void LLFloaterEmojiPicker::fillGroups() { mFilteredEmojiGroups.push_back(USED_EMOJIS_GROUP_INDEX); mFilteredEmojis.emplace_back(cats); + params.name = "used_categories"; createGroupButton(params, rect, USED_EMOJIS_IMAGE_INDEX); } } @@ -472,6 +475,7 @@ void LLFloaterEmojiPicker::fillGroups() { mFilteredEmojiGroups.push_back(i); mFilteredEmojis.emplace_back(cats); + params.name = "group_" + std::to_string(i); createGroupButton(params, rect, groups[i].Character); } } -- cgit v1.2.3 From 4217a778d68722735975f360c9be25655cf0e696 Mon Sep 17 00:00:00 2001 From: Rye Mutt Date: Thu, 1 Aug 2024 00:38:58 -0400 Subject: Fix excessive wstring conversions during emojipicker draw --- indra/newview/llfloateremojipicker.cpp | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'indra/newview/llfloateremojipicker.cpp') diff --git a/indra/newview/llfloateremojipicker.cpp b/indra/newview/llfloateremojipicker.cpp index 0830860633..50f71c9c0b 100644 --- a/indra/newview/llfloateremojipicker.cpp +++ b/indra/newview/llfloateremojipicker.cpp @@ -186,7 +186,7 @@ public: { mWStr = LLWString(1, emoji); mEmoji = emoji; - mTitle = title; + mTitle = utf8str_to_wstring(title); mBegin = begin; mEnd = end; } @@ -204,9 +204,9 @@ public: drawIcon(centerX, centerY - 1, iconWidth); static LLColor4 defaultColor(0.75f, 0.75f, 0.75f, 1.0f); - LLColor4 textColor = LLUIColorTable::instance().getColor("MenuItemEnabledColor", defaultColor); + static LLUIColor textColor = LLUIColorTable::instance().getColor("MenuItemEnabledColor", defaultColor); S32 max_pixels = clientWidth - iconWidth; - drawName((F32)iconWidth, centerY, max_pixels, textColor); + drawName((F32)iconWidth, centerY, max_pixels, textColor.get()); } protected: @@ -226,16 +226,16 @@ protected: max_pixels); // max_pixels } - void drawName(F32 x, F32 y, S32 max_pixels, LLColor4& color) + void drawName(F32 x, F32 y, S32 max_pixels, const LLColor4& color) { F32 x0 = x; F32 x1 = (F32)max_pixels; LLFontGL* font = LLFontGL::getFontEmojiLarge(); if (mBegin) { - std::string text = mTitle.substr(0, mBegin); - font->renderUTF8( - text, // text + LLWString text = mTitle.substr(0, mBegin); + font->render( + text.c_str(), // text 0, // begin_offset x0, // x y, // y @@ -246,14 +246,14 @@ protected: LLFontGL::DROP_SHADOW_SOFT, // shadow static_cast(text.size()), // max_chars (S32)x1); // max_pixels - F32 dx = font->getWidthF32(text); + F32 dx = font->getWidthF32(text.c_str()); x0 += dx; x1 -= dx; } if (x1 > 0 && mEnd > mBegin) { - std::string text = mTitle.substr(mBegin, mEnd - mBegin); - font->renderUTF8( + LLWString text = mTitle.substr(mBegin, mEnd - mBegin); + font->render( text, // text 0, // begin_offset x0, // x @@ -265,14 +265,14 @@ protected: LLFontGL::DROP_SHADOW_SOFT, // shadow static_cast(text.size()), // max_chars (S32)x1); // max_pixels - F32 dx = font->getWidthF32(text); + F32 dx = font->getWidthF32(text.c_str()); x0 += dx; x1 -= dx; } if (x1 > 0 && mEnd < mTitle.size()) { - std::string text = mEnd ? mTitle.substr(mEnd) : mTitle; - font->renderUTF8( + LLWString text = mEnd ? mTitle.substr(mEnd) : mTitle; + font->render( text, // text 0, // begin_offset x0, // x @@ -290,7 +290,7 @@ protected: private: llwchar mEmoji; LLWString mWStr; - std::string mTitle; + LLWString mTitle; size_t mBegin; size_t mEnd; }; -- cgit v1.2.3 From c4e921828a41c0e759ee103c6cfdb2cc40c1a581 Mon Sep 17 00:00:00 2001 From: Rye Mutt Date: Sat, 3 Aug 2024 10:10:17 -0400 Subject: Optimization and cleanup of various color finds during draw --- indra/newview/llfloateremojipicker.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'indra/newview/llfloateremojipicker.cpp') diff --git a/indra/newview/llfloateremojipicker.cpp b/indra/newview/llfloateremojipicker.cpp index 50f71c9c0b..cc13e5d059 100644 --- a/indra/newview/llfloateremojipicker.cpp +++ b/indra/newview/llfloateremojipicker.cpp @@ -203,8 +203,7 @@ public: F32 centerY = 0.5f * clientHeight; drawIcon(centerX, centerY - 1, iconWidth); - static LLColor4 defaultColor(0.75f, 0.75f, 0.75f, 1.0f); - static LLUIColor textColor = LLUIColorTable::instance().getColor("MenuItemEnabledColor", defaultColor); + static LLUIColor textColor = LLUIColorTable::instance().getColor("MenuItemEnabledColor", LLColor4(0.75f, 0.75f, 0.75f, 1.0f)); S32 max_pixels = clientWidth - iconWidth; drawName((F32)iconWidth, centerY, max_pixels, textColor.get()); } @@ -704,8 +703,7 @@ void LLFloaterEmojiPicker::fillEmojis(bool fromResize) LLPanel::Params icon_params; LLRect icon_rect(0, icon_size, icon_size, 0); - static LLColor4 default_color(0.75f, 0.75f, 0.75f, 1.0f); - LLColor4 bg_color = LLUIColorTable::instance().getColor("MenuItemHighlightBgColor", default_color); + static LLUIColor bg_color = LLUIColorTable::instance().getColor("MenuItemHighlightBgColor", LLColor4(0.75f, 0.75f, 0.75f, 1.0f)); if (!mSelectedGroupIndex) { -- cgit v1.2.3