summaryrefslogtreecommitdiff
path: root/indra/llui/lllineeditor.cpp
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2024-03-04 18:01:05 +0200
committerAndrey Lihatskiy <alihatskiy@productengine.com>2024-03-04 18:01:05 +0200
commitb68a05e7c30930976ed1273b4c7a0fec01d2a84f (patch)
tree03ababecc49376c0e607b3548d9beb596f79c3a7 /indra/llui/lllineeditor.cpp
parentd47c6536820d1ed6e373147678dd0fab90e80ab8 (diff)
parent701d1a33bb8227aa55a71f48caeb30a453e77ee0 (diff)
Merge branch 'main' into marchcat/x-merge
# Conflicts: # indra/llcommon/llstring.cpp # indra/llcommon/llstring.h
Diffstat (limited to 'indra/llui/lllineeditor.cpp')
-rw-r--r--indra/llui/lllineeditor.cpp20
1 files changed, 18 insertions, 2 deletions
diff --git a/indra/llui/lllineeditor.cpp b/indra/llui/lllineeditor.cpp
index 06ece90e30..1928c0157e 100644
--- a/indra/llui/lllineeditor.cpp
+++ b/indra/llui/lllineeditor.cpp
@@ -89,6 +89,7 @@ LLLineEditor::Params::Params()
background_image_disabled("background_image_disabled"),
background_image_focused("background_image_focused"),
bg_image_always_focused("bg_image_always_focused", false),
+ show_label_focused("show_label_focused", false),
select_on_focus("select_on_focus", false),
revert_on_esc("revert_on_esc", true),
spellcheck("spellcheck", false),
@@ -154,6 +155,7 @@ LLLineEditor::LLLineEditor(const LLLineEditor::Params& p)
mBgImageDisabled( p.background_image_disabled ),
mBgImageFocused( p.background_image_focused ),
mShowImageFocused( p.bg_image_always_focused ),
+ mShowLabelFocused( p.show_label_focused ),
mUseBgColor(p.use_bg_color),
mHaveHistory(FALSE),
mReplaceNewlinesWithSpaces( TRUE ),
@@ -1759,6 +1761,20 @@ void LLLineEditor::drawBackground()
}
}
+//virtual
+const std::string LLLineEditor::getToolTip() const
+{
+ if (sDebugUnicode)
+ {
+ std::string text = getText();
+ std::string tooltip = utf8str_showBytesUTF8(text);
+ return tooltip;
+ }
+
+ return LLUICtrl::getToolTip();
+}
+
+//virtual
void LLLineEditor::draw()
{
F32 alpha = getDrawContext().mAlpha;
@@ -2091,7 +2107,7 @@ void LLLineEditor::draw()
//draw label if no text is provided
//but we should draw it in a different color
//to give indication that it is not text you typed in
- if (0 == mText.length() && mReadOnly)
+ if (0 == mText.length() && (mReadOnly || mShowLabelFocused))
{
mGLFont->render(mLabel.getWString(), 0,
mTextLeftEdge, (F32)text_bottom,
@@ -2127,7 +2143,7 @@ void LLLineEditor::draw()
LLFontGL::NO_SHADOW,
S32_MAX,
mTextRightEdge - ll_round(rendered_pixels_right),
- &rendered_pixels_right, FALSE);
+ &rendered_pixels_right);
}
// Draw children (border)
LLView::draw();