summaryrefslogtreecommitdiff
path: root/indra/newview/lltexturectrl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/lltexturectrl.cpp')
-rwxr-xr-xindra/newview/lltexturectrl.cpp25
1 files changed, 17 insertions, 8 deletions
diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp
index e2d0fdf357..4676f7b251 100755
--- a/indra/newview/lltexturectrl.cpp
+++ b/indra/newview/lltexturectrl.cpp
@@ -144,7 +144,7 @@ public:
static void onBtnCancel( void* userdata );
void onBtnPipette( );
//static void onBtnRevert( void* userdata );
- static void onBtnWhite( void* userdata );
+ static void onBtnBlank( void* userdata );
static void onBtnNone( void* userdata );
static void onBtnClear( void* userdata );
void onSelectionChange(const std::deque<LLFolderViewItem*> &items, BOOL user_action);
@@ -165,7 +165,6 @@ protected:
LLUUID mImageAssetID; // Currently selected texture
LLUIImagePtr mFallbackImage; // What to show if currently selected texture is null.
- LLUUID mWhiteImageAssetID;
LLUUID mSpecialCurrentImageAssetID; // Used when the asset id has no corresponding texture in the user's inventory.
LLUUID mOriginalImageAssetID;
@@ -208,8 +207,7 @@ LLFloaterTexturePicker::LLFloaterTexturePicker(
: LLFloater(LLSD()),
mOwner( owner ),
mImageAssetID( owner->getImageAssetID() ),
- mFallbackImage( fallback_image ),
- mWhiteImageAssetID( gSavedSettings.getString( "UIImgWhiteUUID" ) ),
+ mFallbackImage( fallback_image ),
mOriginalImageAssetID(owner->getImageAssetID()),
mLabel(label),
mTentativeLabel(NULL),
@@ -426,7 +424,7 @@ BOOL LLFloaterTexturePicker::postBuild()
childSetAction("Default",LLFloaterTexturePicker::onBtnSetToDefault,this);
childSetAction("None", LLFloaterTexturePicker::onBtnNone,this);
- childSetAction("Blank", LLFloaterTexturePicker::onBtnWhite,this);
+ childSetAction("Blank", LLFloaterTexturePicker::onBtnBlank,this);
childSetCommitCallback("show_folders_check", onShowFolders, this);
@@ -581,7 +579,7 @@ void LLFloaterTexturePicker::draw()
}
getChildView("Default")->setEnabled(mImageAssetID != mOwner->getDefaultImageAssetID());
- getChildView("Blank")->setEnabled(mImageAssetID != mWhiteImageAssetID );
+ getChildView("Blank")->setEnabled(mImageAssetID != mOwner->getBlankImageAssetID());
getChildView("None")->setEnabled(mOwner->getAllowNoTexture() && !mImageAssetID.isNull() );
LLFloater::draw();
@@ -721,11 +719,11 @@ void LLFloaterTexturePicker::onBtnSetToDefault(void* userdata)
}
// static
-void LLFloaterTexturePicker::onBtnWhite(void* userdata)
+void LLFloaterTexturePicker::onBtnBlank(void* userdata)
{
LLFloaterTexturePicker* self = (LLFloaterTexturePicker*) userdata;
self->setCanApply(true, true);
- self->setImageID( self->mWhiteImageAssetID );
+ self->setImageID( self->mOwner->getBlankImageAssetID() );
self->commitIfImmediateSet();
}
@@ -1042,6 +1040,7 @@ LLTextureCtrl::LLTextureCtrl(const LLTextureCtrl::Params& p)
mDragCallback(NULL),
mDropCallback(NULL),
mOnCancelCallback(NULL),
+ mOnCloseCallback(NULL),
mOnSelectCallback(NULL),
mBorderColor( p.border_color() ),
mAllowNoTexture( FALSE ),
@@ -1056,6 +1055,12 @@ LLTextureCtrl::LLTextureCtrl(const LLTextureCtrl::Params& p)
mDefaultImageName(p.default_image_name),
mFallbackImage(p.fallback_image)
{
+
+ // Default of defaults is white image for diff tex
+ //
+ LLUUID whiteImage( gSavedSettings.getString( "UIImgWhiteUUID" ) );
+ setBlankImageAssetID( whiteImage );
+
setAllowNoTexture(p.allow_no_texture);
setCanApplyImmediately(p.can_apply_immediately);
mCommitOnSelection = !p.no_commit_on_selection;
@@ -1292,6 +1297,10 @@ void LLTextureCtrl::onFloaterClose()
if (floaterp)
{
+ if (mOnCloseCallback)
+ {
+ mOnCloseCallback(this,LLSD());
+ }
floaterp->setOwner(NULL);
}