summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2023-05-18 22:22:07 +0300
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2023-05-18 22:22:16 +0300
commit706d8f17273f4718a2adf5a43c1de5a1dc08abad (patch)
treea13243cfa91992f8d187be55dd023e2dcd6240da
parent53ed0ec70ce5c774c57c9783050c7e1b35885eec (diff)
SL-19732 Fix folder's thumbnail from sticking over folder's content
-rw-r--r--indra/llui/llfolderview.cpp2
-rw-r--r--indra/llui/llfolderview.h2
-rw-r--r--indra/llui/llfolderviewitem.cpp2
-rw-r--r--indra/llui/llfolderviewitem.h8
-rw-r--r--indra/newview/llinventorypanel.cpp12
5 files changed, 17 insertions, 9 deletions
diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp
index 9fa8a84fa4..bf6f2436b1 100644
--- a/indra/llui/llfolderview.cpp
+++ b/indra/llui/llfolderview.cpp
@@ -2064,7 +2064,7 @@ LLFolderViewItem* LLFolderView::getNextUnselectedItem()
return new_selection;
}
-S32 LLFolderView::getItemHeight()
+S32 LLFolderView::getItemHeight() const
{
if(!hasVisibleChildren())
{
diff --git a/indra/llui/llfolderview.h b/indra/llui/llfolderview.h
index 22b8c475ec..73028f31b1 100644
--- a/indra/llui/llfolderview.h
+++ b/indra/llui/llfolderview.h
@@ -136,7 +136,7 @@ public:
// Find width and height of this object and its children. Also
// makes sure that this view and its children are the right size.
virtual S32 arrange( S32* width, S32* height );
- virtual S32 getItemHeight();
+ virtual S32 getItemHeight() const;
void arrangeAll() { mArrangeGeneration++; }
S32 getArrangeGeneration() { return mArrangeGeneration; }
diff --git a/indra/llui/llfolderviewitem.cpp b/indra/llui/llfolderviewitem.cpp
index bc7a2cc3f0..4fbfa7ed79 100644
--- a/indra/llui/llfolderviewitem.cpp
+++ b/indra/llui/llfolderviewitem.cpp
@@ -416,7 +416,7 @@ S32 LLFolderViewItem::arrange( S32* width, S32* height )
return *height;
}
-S32 LLFolderViewItem::getItemHeight()
+S32 LLFolderViewItem::getItemHeight() const
{
return mItemHeight;
}
diff --git a/indra/llui/llfolderviewitem.h b/indra/llui/llfolderviewitem.h
index c8d44de474..5c2a1ecff0 100644
--- a/indra/llui/llfolderviewitem.h
+++ b/indra/llui/llfolderviewitem.h
@@ -178,7 +178,7 @@ public:
// Finds width and height of this object and it's children. Also
// makes sure that this view and it's children are the right size.
virtual S32 arrange( S32* width, S32* height );
- virtual S32 getItemHeight();
+ virtual S32 getItemHeight() const;
virtual S32 getLabelXPos();
S32 getIconPad();
S32 getTextPad();
@@ -217,9 +217,9 @@ public:
void setIsCurSelection(BOOL select) { mIsCurSelection = select; }
- BOOL getIsCurSelection() { return mIsCurSelection; }
+ BOOL getIsCurSelection() const { return mIsCurSelection; }
- BOOL hasVisibleChildren() { return mHasVisibleChildren; }
+ BOOL hasVisibleChildren() const { return mHasVisibleChildren; }
// true if object can't have children
virtual bool isFolderComplete() { return true; }
@@ -268,7 +268,7 @@ public:
virtual LLFolderView* getRoot();
virtual const LLFolderView* getRoot() const;
BOOL isDescendantOf( const LLFolderViewFolder* potential_ancestor );
- S32 getIndentation() { return mIndentation; }
+ S32 getIndentation() const { return mIndentation; }
virtual BOOL passedFilter(S32 filter_generation = -1);
virtual BOOL isPotentiallyVisible(S32 filter_generation = -1);
diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp
index edcd45db79..c5d3fa3f7a 100644
--- a/indra/newview/llinventorypanel.cpp
+++ b/indra/newview/llinventorypanel.cpp
@@ -1311,10 +1311,18 @@ BOOL LLInventoryPanel::handleToolTip(S32 x, S32 y, MASK mask)
params["inv_type"] = vm_item_p->getInventoryType();
params["thumbnail_id"] = vm_item_p->getThumbnailUUID();
params["item_id"] = vm_item_p->getUUID();
-
+
+ // tooltip should only show over folder, but screen
+ // rect includes items under folder as well
+ LLRect actionable_rect = hover_item_p->calcScreenRect();
+ if (hover_item_p->isOpen() && hover_item_p->hasVisibleChildren())
+ {
+ actionable_rect.mBottom = actionable_rect.mTop - hover_item_p->getItemHeight();
+ }
+
LLToolTipMgr::instance().show(LLToolTip::Params()
.message(hover_item_p->getToolTip())
- .sticky_rect(hover_item_p->calcScreenRect())
+ .sticky_rect(actionable_rect)
.delay_time(LLView::getTooltipTimeout())
.create_callback(boost::bind(&LLInspectTextureUtil::createInventoryToolTip, _1))
.create_params(params));