summaryrefslogtreecommitdiff
path: root/indra/llui/llspinctrl.cpp
diff options
context:
space:
mode:
authorrichard <none@none>2010-01-22 16:51:13 -0800
committerrichard <none@none>2010-01-22 16:51:13 -0800
commit337716d946cf4ece8ba59cce82bd51b3c2148f75 (patch)
tree3dee9d70847c017e00e0090692606058565bfdd3 /indra/llui/llspinctrl.cpp
parent41f2b8e6017c4846430f501dc3d4877b505b9fbd (diff)
LLPointer cleanup and fix for EXT-4413
reviewed by Rick
Diffstat (limited to 'indra/llui/llspinctrl.cpp')
-rw-r--r--indra/llui/llspinctrl.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/indra/llui/llspinctrl.cpp b/indra/llui/llspinctrl.cpp
index 20a1ab7af3..28f3788817 100644
--- a/indra/llui/llspinctrl.cpp
+++ b/indra/llui/llspinctrl.cpp
@@ -270,13 +270,19 @@ void LLSpinCtrl::clear()
mbHasBeenSet = FALSE;
}
-
+void LLSpinCtrl::updateLabelColor()
+{
+ if( mLabelBox )
+ {
+ mLabelBox->setColor( getEnabled() ? mTextEnabledColor.get() : mTextDisabledColor.get() );
+ }
+}
void LLSpinCtrl::updateEditor()
{
LLLocale locale(LLLocale::USER_LOCALE);
- // Don't display very small negative values as -0.000
+ // Don't display very small negative valu es as -0.000
F32 displayed_value = clamp_precision((F32)getValue().asReal(), mPrecision);
// if( S32( displayed_value * pow( 10, mPrecision ) ) == 0 )
@@ -339,10 +345,7 @@ void LLSpinCtrl::setEnabled(BOOL b)
{
LLView::setEnabled( b );
mEditor->setEnabled( b );
- if( mLabelBox )
- {
- mLabelBox->setColor( b ? mTextEnabledColor.get() : mTextDisabledColor.get() );
- }
+ updateLabelColor();
}
@@ -390,6 +393,7 @@ void LLSpinCtrl::setLabel(const LLStringExplicit& label)
{
llwarns << "Attempting to set label on LLSpinCtrl constructed without one " << getName() << llendl;
}
+ updateLabelColor();
}
void LLSpinCtrl::setAllowEdit(BOOL allow_edit)