summaryrefslogtreecommitdiff
path: root/indra/newview/llinventorypanel.cpp
diff options
context:
space:
mode:
authorKitty Barnett <develop@catznip.com>2022-12-29 19:51:33 +0100
committerakleshchev <117672381+akleshchev@users.noreply.github.com>2023-02-01 16:38:47 +0200
commit1140ae3489a9e260a0abb808b4152f2d57384d67 (patch)
tree497ccdf9e635f8662ca6a298c448762d0af5e453 /indra/newview/llinventorypanel.cpp
parent3375e1a7b518eb40eb1814ced745266ce3a54ce7 (diff)
Add a texture inspector and show it when hovering over an inventory textory (or folder containing - among others - exactly one texture) and when hovering over notecard embedded textures
Diffstat (limited to 'indra/newview/llinventorypanel.cpp')
-rw-r--r--indra/newview/llinventorypanel.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp
index 6b102c7500..dabe633b8c 100644
--- a/indra/newview/llinventorypanel.cpp
+++ b/indra/newview/llinventorypanel.cpp
@@ -40,6 +40,7 @@
#include "llfolderviewitem.h"
#include "llfloaterimcontainer.h"
#include "llimview.h"
+#include "llinspecttexture.h"
#include "llinventorybridge.h"
#include "llinventoryfunctions.h"
#include "llinventorymodelbackgroundfetch.h"
@@ -1278,6 +1279,28 @@ BOOL LLInventoryPanel::handleHover(S32 x, S32 y, MASK mask)
return TRUE;
}
+BOOL LLInventoryPanel::handleToolTip(S32 x, S32 y, MASK mask)
+{
+ if (const LLFolderViewItem* hover_item_p = (!mFolderRoot.isDead()) ? mFolderRoot.get()->getHoveredItem() : nullptr)
+ {
+ 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");
+ LLToolTipMgr::instance().show(LLToolTip::Params()
+ .message(hover_item_p->getToolTip())
+ .sticky_rect(hover_item_p->calcScreenRect())
+ .delay_time(nTimeout)
+ .create_callback(boost::bind(&LLInspectTextureUtil::createInventoryToolTip, _1))
+ .create_params(LLSD().with("inv_type", vm_item_p->getInventoryType()).with("item_id", vm_item_p->getUUID())));
+ return TRUE;
+ }
+ }
+ return LLPanel::handleToolTip(x, y, mask);
+}
+
BOOL LLInventoryPanel::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
EDragAndDropType cargo_type,
void* cargo_data,