Skip to content
Snippets Groups Projects
Commit eb973fff authored by NiranV's avatar NiranV
Browse files

Added: Manual linebreak support to tooltips.

parent 3164fcf4
No related branches found
No related tags found
No related merge requests found
......@@ -298,7 +298,27 @@ void LLToolTip::initFromParams(const LLToolTip::Params& p)
}
else
{
mTextBox->setText(p.message());
//BD - UI Improvements
// Allow linebreaks whenever we find a | in our tooltip.
// This allows segmenting and properly organizing tooltips.
std::string msg = p.message();
std::string prev_msg;
while (true)
{
std::size_t pos = msg.find("|");
if (pos != std::string::npos)
{
prev_msg = msg.substr(0, pos);
msg = msg.substr(pos + 1);
mTextBox->appendText(prev_msg, false);
mTextBox->appendLineBreakSegment(LLStyle::Params());
}
else
{
mTextBox->appendText(msg, false);
break;
}
}
}
S32 text_width = llmin(p.max_width(), mTextBox->getTextPixelWidth() + 1);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment