summaryrefslogtreecommitdiff
path: root/indra/newview/lltexturectrl.cpp
diff options
context:
space:
mode:
authorJames Cook <james@lindenlab.com>2008-05-20 23:24:16 +0000
committerJames Cook <james@lindenlab.com>2008-05-20 23:24:16 +0000
commit2b863df7c8fdede8db5d30349f7778d9f7897e28 (patch)
treef08321bc46b7cd61ee756d33a3d0793a73c6b6ab /indra/newview/lltexturectrl.cpp
parent38558960978a0741dd9c79c4c7a108b8a1f99eff (diff)
svn merge -r87877:87878 svn+ssh://svn.lindenlab.com/svn/linden/branches/maint-ui/maint-ui-12-qa-5 which is the last iteration of the maint-ui series of branches. Future work will be in featurettes.
Diffstat (limited to 'indra/newview/lltexturectrl.cpp')
-rw-r--r--indra/newview/lltexturectrl.cpp26
1 files changed, 25 insertions, 1 deletions
diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp
index 6625e10982..22c0e08612 100644
--- a/indra/newview/lltexturectrl.cpp
+++ b/indra/newview/lltexturectrl.cpp
@@ -65,6 +65,7 @@
#include "llviewercontrol.h"
#include "llglheaders.h"
#include "lluictrlfactory.h"
+#include "lltrans.h"
static const S32 CLOSE_BTN_WIDTH = 100;
@@ -908,7 +909,8 @@ LLTextureCtrl::LLTextureCtrl(
mCanApplyImmediately( FALSE ),
mNeedsRawImageData( FALSE ),
mValid( TRUE ),
- mDirty( FALSE )
+ mDirty( FALSE ),
+ mShowLoadingPlaceholder( FALSE )
{
mCaption = new LLTextBox( label,
LLRect( 0, BTN_HEIGHT_SMALL, getRect().getWidth(), 0 ),
@@ -939,6 +941,7 @@ LLTextureCtrl::LLTextureCtrl(
addChild(mBorder);
setEnabled(TRUE); // for the tooltip
+ mLoadingPlaceholderString = LLTrans::getString("texture_loading");
}
@@ -1009,6 +1012,11 @@ LLView* LLTextureCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactor
return texture_picker;
}
+void LLTextureCtrl::setShowLoadingPlaceholder(BOOL showLoadingPlaceholder)
+{
+ mShowLoadingPlaceholder = showLoadingPlaceholder;
+}
+
void LLTextureCtrl::setCaption(const LLString& caption)
{
mCaption->setText( caption );
@@ -1318,6 +1326,22 @@ void LLTextureCtrl::draw()
}
mTentativeLabel->setVisible( !mTexturep.isNull() && getTentative() );
+
+ if ( mTexturep.notNull() &&
+ (mShowLoadingPlaceholder == TRUE) &&
+ (mTexturep->getDiscardLevel() != 1) &&
+ (mTexturep->getDiscardLevel() != 0))
+ {
+ LLFontGL* font = LLFontGL::sSansSerifBig;
+ font->renderUTF8(
+ mLoadingPlaceholderString, 0,
+ llfloor(interior.mLeft+10),
+ llfloor(interior.mTop-20),
+ LLColor4::white,
+ LLFontGL::LEFT,
+ LLFontGL::BASELINE,
+ LLFontGL::DROP_SHADOW);
+ }
LLUICtrl::draw();
}