diff options
author | Alexander Gavriliuk <alexandrgproductengine@lindenlab.com> | 2024-03-08 13:25:43 +0100 |
---|---|---|
committer | Guru <alexandrgproductengine@lindenlab.com> | 2024-03-10 00:10:16 +0100 |
commit | 1781e2d17b777e32e9b51e5a901c1295db80a4d8 (patch) | |
tree | 720c3d9e2808b65fe58378022090bffbea91bbff /indra/llui/llview.cpp | |
parent | 636bf6cadec903d894c36db992f1ab17fb8e6796 (diff) |
viewer#944 Make 'Debug Unicode' feature available for all LLViews
Diffstat (limited to 'indra/llui/llview.cpp')
-rw-r--r-- | indra/llui/llview.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp index 139eb17efa..1a80a69293 100644 --- a/indra/llui/llview.cpp +++ b/indra/llui/llview.cpp @@ -898,6 +898,34 @@ F32 LLView::getTooltipTimeout() : tooltip_delay); } +// virtual +const std::string LLView::getToolTip() const +{ + if (sDebugUnicode) + { + std::string text = getText(); + if (!text.empty()) + { + const std::string& name = getName(); + std::string tooltip = llformat("Name: \"%s\"", name.c_str()); + + if (const LLFontGL* font = getFont()) + { + tooltip += llformat("\nFont: %s (%s)", + font->getFontDesc().getName().c_str(), + font->getFontDesc().getSize().c_str() + ); + } + + tooltip += "\n\n" + utf8str_showBytesUTF8(text); + + return tooltip; + } + } + + return mToolTipMsg.getString(); +} + BOOL LLView::handleToolTip(S32 x, S32 y, MASK mask) { BOOL handled = FALSE; |