Changes to allow disabling an LLTextBox (or LLTextBox subclass) to gray out the text.
Due to some legacy issues, text boxes will not gray out on disable unless they have their text_readonly_color property in xui set to "LabelDisabledColor" (or some other color distinct from their text color). Reviewed by Richard.master
parent
39f241aad2
commit
551f74125b
|
|
@ -269,9 +269,6 @@ void LLTextBase::initFromParams(const LLTextBase::Params& p)
|
|||
{
|
||||
mReadOnly = p.read_only;
|
||||
}
|
||||
|
||||
// HACK: text editors always need to be enabled so that we can scroll
|
||||
LLView::setEnabled(true);
|
||||
}
|
||||
|
||||
bool LLTextBase::truncate()
|
||||
|
|
|
|||
|
|
@ -119,6 +119,17 @@ BOOL LLTextBox::handleHover(S32 x, S32 y, MASK mask)
|
|||
return handled;
|
||||
}
|
||||
|
||||
void LLTextBox::setEnabled(BOOL enabled)
|
||||
{
|
||||
// just treat enabled as read-only flag
|
||||
bool read_only = !enabled;
|
||||
if (read_only != mReadOnly)
|
||||
{
|
||||
LLTextBase::setReadOnly(read_only);
|
||||
updateSegments();
|
||||
}
|
||||
}
|
||||
|
||||
void LLTextBox::setText(const LLStringExplicit& text , const LLStyle::Params& input_params )
|
||||
{
|
||||
// does string argument insertion
|
||||
|
|
|
|||
|
|
@ -58,6 +58,8 @@ public:
|
|||
/*virtual*/ BOOL handleMouseUp(S32 x, S32 y, MASK mask);
|
||||
/*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask);
|
||||
|
||||
/*virtual*/ void setEnabled(BOOL enabled);
|
||||
|
||||
/*virtual*/ void setText( const LLStringExplicit& text, const LLStyle::Params& input_params = LLStyle::Params() );
|
||||
|
||||
void setRightAlign() { mHAlign = LLFontGL::RIGHT; }
|
||||
|
|
|
|||
|
|
@ -289,6 +289,9 @@ void LLTextEditor::initFromParams( const LLTextEditor::Params& p)
|
|||
{
|
||||
LLTextBase::initFromParams(p);
|
||||
|
||||
// HACK: text editors always need to be enabled so that we can scroll
|
||||
LLView::setEnabled(true);
|
||||
|
||||
if (p.commit_on_focus_lost.isProvided())
|
||||
{
|
||||
mCommitOnFocusLost = p.commit_on_focus_lost;
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
halign="left"
|
||||
h_pad="0"
|
||||
allow_scroll="false"
|
||||
text_readonly_color="LabelDisabledColor"
|
||||
text_readonly_color="LabelTextColor"
|
||||
bg_writeable_color="FloaterDefaultBackgroundColor"
|
||||
use_ellipses="false"
|
||||
bg_visible="false"
|
||||
|
|
|
|||
|
|
@ -2,4 +2,5 @@
|
|||
<!-- Core parameters are in simple_text_editor.xml -->
|
||||
<text_editor
|
||||
allow_html="false"
|
||||
text_readonly_color="LabelDisabledColor"
|
||||
show_context_menu="true"/>
|
||||
|
|
|
|||
Loading…
Reference in New Issue