summaryrefslogtreecommitdiff
path: root/indra/newview/lltexturectrl.cpp
diff options
context:
space:
mode:
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();
}