proper right click support for textures added
This commit is contained in:
@@ -1275,15 +1275,41 @@ BOOL LLTextureCtrl::handleMouseDown(S32 x, S32 y, MASK mask)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// <edit>
|
// <edit>
|
||||||
|
|
||||||
|
//static
|
||||||
|
void LLTextureCtrl::handleClickOpenTexture(void* userdata)
|
||||||
|
{
|
||||||
|
LLTextureCtrl* clickedTexture = static_cast<LLTextureCtrl*>(userdata);
|
||||||
|
|
||||||
|
if(clickedTexture)
|
||||||
|
LLLocalInventory::addItem(clickedTexture->mImageAssetID.asString(), (int)LLAssetType::AT_TEXTURE, clickedTexture->mImageAssetID, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
//static
|
||||||
|
void LLTextureCtrl::handleClickCopyAssetID(void* userdata)
|
||||||
|
{
|
||||||
|
LLTextureCtrl* clickedTexture = static_cast<LLTextureCtrl*>(userdata);
|
||||||
|
|
||||||
|
if(clickedTexture)
|
||||||
|
gViewerWindow->mWindow->copyTextToClipboard(utf8str_to_wstring(clickedTexture->mImageAssetID.asString()));
|
||||||
|
}
|
||||||
|
|
||||||
BOOL LLTextureCtrl::handleRightMouseDown(S32 x, S32 y, MASK mask)
|
BOOL LLTextureCtrl::handleRightMouseDown(S32 x, S32 y, MASK mask)
|
||||||
{
|
{
|
||||||
if( mask & MASK_SHIFT )
|
BOOL handled = LLUICtrl::handleRightMouseDown( x, y , mask );
|
||||||
|
if( handled )
|
||||||
{
|
{
|
||||||
LLLocalInventory::addItem(mImageAssetID.asString(), (int)LLAssetType::AT_TEXTURE, mImageAssetID, true);
|
LLMenuGL* menu = new LLMenuGL(LLStringUtil::null);
|
||||||
return TRUE;
|
menu->append(new LLMenuItemCallGL("Open", LLTextureCtrl::handleClickOpenTexture, NULL, this));
|
||||||
|
menu->append(new LLMenuItemCallGL("Copy Asset UUID", LLTextureCtrl::handleClickCopyAssetID, NULL, this));
|
||||||
|
menu->updateParent(LLMenuGL::sMenuContainer);
|
||||||
|
menu->setCanTearOff(FALSE);
|
||||||
|
LLMenuGL::showPopup(this, menu, x, y);
|
||||||
}
|
}
|
||||||
return FALSE;
|
|
||||||
|
return handled;
|
||||||
}
|
}
|
||||||
|
|
||||||
// </edit>
|
// </edit>
|
||||||
|
|
||||||
void LLTextureCtrl::onFloaterClose()
|
void LLTextureCtrl::onFloaterClose()
|
||||||
|
|||||||
@@ -159,6 +159,9 @@ public:
|
|||||||
|
|
||||||
void setShowLoadingPlaceholder(BOOL showLoadingPlaceholder);
|
void setShowLoadingPlaceholder(BOOL showLoadingPlaceholder);
|
||||||
|
|
||||||
|
static void handleClickOpenTexture(void* userdata);
|
||||||
|
static void handleClickCopyAssetID(void* userdata);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
BOOL allowDrop(LLInventoryItem* item);
|
BOOL allowDrop(LLInventoryItem* item);
|
||||||
BOOL doDrop(LLInventoryItem* item);
|
BOOL doDrop(LLInventoryItem* item);
|
||||||
|
|||||||
Reference in New Issue
Block a user