summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llinspecttexture.cpp49
-rw-r--r--indra/newview/llinventorypanel.cpp12
-rw-r--r--indra/newview/llviewertexteditor.cpp9
3 files changed, 41 insertions, 29 deletions
diff --git a/indra/newview/llinspecttexture.cpp b/indra/newview/llinspecttexture.cpp
index cd288e9603..af96561c45 100644
--- a/indra/newview/llinspecttexture.cpp
+++ b/indra/newview/llinspecttexture.cpp
@@ -136,14 +136,17 @@ BOOL LLInspectTexture::postBuild()
LLToolTip* LLInspectTextureUtil::createInventoryToolTip(LLToolTip::Params p)
{
- const LLSD& sdTooltip = p.create_params;
+ const LLSD& sdTooltip = p.create_params;
+
+ if (sdTooltip.has("thumbnail_id"))
+ {
+ // go straight for tooltip regardless of type
+ return LLUICtrlFactory::create<LLTextureToolTip>(p);
+ }
LLInventoryType::EType eInvType = (sdTooltip.has("inv_type")) ? (LLInventoryType::EType)sdTooltip["inv_type"].asInteger() : LLInventoryType::IT_NONE;
switch (eInvType)
{
- case LLInventoryType::IT_SNAPSHOT:
- case LLInventoryType::IT_TEXTURE:
- return LLUICtrlFactory::create<LLTextureToolTip>(p);
case LLInventoryType::IT_CATEGORY:
{
if (sdTooltip.has("item_id"))
@@ -277,23 +280,27 @@ LLTextureToolTip::~LLTextureToolTip()
void LLTextureToolTip::initFromParams(const LLToolTip::Params& p)
{
- LLToolTip::initFromParams(p);
-
- // Create and add the preview control
- LLView::Params p_preview;
- p_preview.name = "texture_preview";
- LLRect rctPreview;
- rctPreview.setOriginAndSize(mPadding, mTextBox->getRect().mTop, mPreviewSize, mPreviewSize);
- p_preview.rect = rctPreview;
- mPreviewView = LLUICtrlFactory::create<LLTexturePreviewView>(p_preview);
- addChild(mPreviewView);
-
- // Parse the control params
- const LLSD& sdTextureParams = p.create_params;
- if (sdTextureParams.has("asset_id"))
- mPreviewView->setImageFromAssetId(sdTextureParams["asset_id"].asUUID());
- else if (sdTextureParams.has("item_id"))
- mPreviewView->setImageFromItemId(sdTextureParams["item_id"].asUUID());
+ LLToolTip::initFromParams(p);
+
+ // Create and add the preview control
+ LLView::Params p_preview;
+ p_preview.name = "texture_preview";
+ LLRect rctPreview;
+ rctPreview.setOriginAndSize(mPadding, mTextBox->getRect().mTop, mPreviewSize, mPreviewSize);
+ p_preview.rect = rctPreview;
+ mPreviewView = LLUICtrlFactory::create<LLTexturePreviewView>(p_preview);
+ addChild(mPreviewView);
+
+ // Parse the control params
+ const LLSD& sdTextureParams = p.create_params;
+ if (sdTextureParams.has("thumbnail_id"))
+ {
+ mPreviewView->setImageFromAssetId(sdTextureParams["thumbnail_id"].asUUID());
+ }
+ else if (sdTextureParams.has("item_id"))
+ {
+ mPreviewView->setImageFromItemId(sdTextureParams["item_id"].asUUID());
+ }
snapToChildren();
}
diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp
index dabe633b8c..d6f4b8f103 100644
--- a/indra/newview/llinventorypanel.cpp
+++ b/indra/newview/llinventorypanel.cpp
@@ -1285,16 +1285,16 @@ BOOL LLInventoryPanel::handleToolTip(S32 x, S32 y, MASK mask)
{
if (const LLFolderViewModelItemInventory* vm_item_p = static_cast<const LLFolderViewModelItemInventory*>(hover_item_p->getViewModelItem()))
{
- // Copy/pasted from LLView::handleToolTip()
- F32 nTimeout = LLToolTipMgr::instance().toolTipVisible()
- ? LLUI::getInstance()->mSettingGroups["config"]->getF32("ToolTipFastDelay")
- : LLUI::getInstance()->mSettingGroups["config"]->getF32("ToolTipDelay");
+ LLSD params;
+ params["inv_type"] = vm_item_p->getInventoryType();
+ params["item_id"] = vm_item_p->getUUID();
+
LLToolTipMgr::instance().show(LLToolTip::Params()
.message(hover_item_p->getToolTip())
.sticky_rect(hover_item_p->calcScreenRect())
- .delay_time(nTimeout)
+ .delay_time(LLView::getTooltipTimeout())
.create_callback(boost::bind(&LLInspectTextureUtil::createInventoryToolTip, _1))
- .create_params(LLSD().with("inv_type", vm_item_p->getInventoryType()).with("item_id", vm_item_p->getUUID())));
+ .create_params(params));
return TRUE;
}
}
diff --git a/indra/newview/llviewertexteditor.cpp b/indra/newview/llviewertexteditor.cpp
index 299047d91b..13505a2cf3 100644
--- a/indra/newview/llviewertexteditor.cpp
+++ b/indra/newview/llviewertexteditor.cpp
@@ -246,12 +246,17 @@ public:
}
virtual BOOL handleToolTip(S32 x, S32 y, MASK mask )
{
- if (LLAssetType::AT_TEXTURE == mItem->getType())
+ if (mItem->getThumbnailUUID().notNull())
{
+ LLSD params;
+ params["inv_type"] = mItem->getInventoryType();
+ params["thumbnail_id"] = mItem->getThumbnailUUID();
+ params["asset_id"] = mItem->getAssetUUID();
+
LLToolTipMgr::instance().show(LLToolTip::Params()
.message(mToolTip)
.create_callback(boost::bind(&LLInspectTextureUtil::createInventoryToolTip, _1))
- .create_params(LLSD().with("inv_type", mItem->getInventoryType()).with("asset_id", mItem->getAssetUUID())));
+ .create_params(params));
return TRUE;
}