diff options
| author | Richard Nelson <richard@lindenlab.com> | 2011-10-12 18:17:18 -0700 |
|---|---|---|
| committer | Richard Nelson <richard@lindenlab.com> | 2011-10-12 18:17:18 -0700 |
| commit | 86cbb16e27b63d540d39a3e7342b0c07acabcaee (patch) | |
| tree | c1dcc86e8159a66e8ca0becd742075d630bf4a55 /indra/llui/llbutton.cpp | |
| parent | 40ebe180a6592381804555d1c9e8df84bf35345a (diff) | |
| parent | 9206226a377c88d34036ebd8a3ac6d9d55bc4146 (diff) | |
Automated merge with ssh://hg.lindenlab.com/richard/viewer-experience-fui
Diffstat (limited to 'indra/llui/llbutton.cpp')
| -rw-r--r-- | indra/llui/llbutton.cpp | 39 |
1 files changed, 19 insertions, 20 deletions
diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp index 4f0c0d31bd..f40d99c024 100644 --- a/indra/llui/llbutton.cpp +++ b/indra/llui/llbutton.cpp @@ -732,16 +732,7 @@ void LLButton::draw() } // Unselected label assignments - LLWString label; - - if( getToggleState() ) - { - label = mSelectedLabel; - } - else - { - label = mUnselectedLabel; - } + LLWString label = getCurrentLabel(); // overlay with keyboard focus border if (hasFocus()) @@ -988,6 +979,23 @@ void LLButton::setLabelSelected( const LLStringExplicit& label ) mSelectedLabel = label; } +bool LLButton::labelIsTruncated() const +{ + return getCurrentLabel().getString().size() > mLastDrawCharsCount; +} + +const LLUIString& LLButton::getCurrentLabel() const +{ + if( getToggleState() ) + { + return mSelectedLabel; + } + else + { + return mUnselectedLabel; + } +} + void LLButton::setImageUnselected(LLPointer<LLUIImage> image) { mImageUnselected = image; @@ -999,16 +1007,7 @@ void LLButton::setImageUnselected(LLPointer<LLUIImage> image) void LLButton::autoResize() { - LLUIString label; - if(getToggleState()) - { - label = mSelectedLabel; - } - else - { - label = mUnselectedLabel; - } - resize(label); + resize(getCurrentLabel()); } void LLButton::resize(LLUIString label) |
