summaryrefslogtreecommitdiff
path: root/indra/llui/llfolderviewitem.cpp
diff options
context:
space:
mode:
authorErik Kundiman <erik@megapahit.org>2026-09-01 18:35:23 +0800
committerErik Kundiman <erik@megapahit.org>2026-09-04 21:58:53 +0800
commit00bb3bb6f07660bd914d29a1389342bb3060d254 (patch)
tree431f574922494d2201718f13085f17bc6bd7fb42 /indra/llui/llfolderviewitem.cpp
parenta8636720129952c10cf49ab80da21bf8b340b96c (diff)
parent4ef9f8f14b35ed388c294d53767a0dca0e890924 (diff)
Merge remote-tracking branch 'secondlife/release/26.4' into 26.4
Diffstat (limited to 'indra/llui/llfolderviewitem.cpp')
-rw-r--r--indra/llui/llfolderviewitem.cpp30
1 files changed, 20 insertions, 10 deletions
diff --git a/indra/llui/llfolderviewitem.cpp b/indra/llui/llfolderviewitem.cpp
index fcc1964bd6..c8ef421677 100644
--- a/indra/llui/llfolderviewitem.cpp
+++ b/indra/llui/llfolderviewitem.cpp
@@ -4,7 +4,7 @@
*
* $LicenseInfo:firstyear=2001&license=viewerlgpl$
* Second Life Viewer Source Code
-* Copyright (C) 2010, Linden Research, Inc.
+* Copyright (C) 2026, Linden Research, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -190,7 +190,7 @@ LLFolderViewItem::LLFolderViewItem(const LLFolderViewItem::Params& p)
mItemHeight(p.item_height),
mControlLabelRotation(0.f),
mDragAndDropTarget(false),
- mLabel(utf8str_to_wstring(p.name)),
+ mLabel(utf8str_to_wstring(p.name)), // will be immediately reset in postBuild()
mRoot(p.root),
mViewModelItem(p.listener),
mIsMouseOverTitle(false),
@@ -244,21 +244,19 @@ bool LLFolderViewItem::postBuild()
llassert(vmi); // not supposed to happen, if happens, find out why and fix
if (vmi)
{
- // getDisplayName() is expensive (due to internal getLabelSuffix() and name building)
- // it also sets search strings so it requires a filter reset
+ // First getDisplayName() is expensive due to internal
+ // lazy getLabelSuffix(), it is however needed as it sets
+ // search string, which can later determine visibility.
+ // Refreshing a search string also requires a filter reset.
mLabel = utf8str_to_wstring(vmi->getDisplayName());
mIsFavorite = vmi->isFavorite() && !vmi->isItemInTrash();
- setToolTip(vmi->getName());
// Dirty the filter flag of the model from the view (CHUI-849)
vmi->dirtyFilter();
}
- // Don't do full refresh on constructor if it is possible to avoid
+ // Don't do full refresh on constructor if it is possible to avoid,
// it significantly slows down bulk view creation.
- // Todo: Ideally we need to move getDisplayName() out of constructor as well.
- // Like: make a logic that will let filter update search string,
- // while LLFolderViewItem::arrange() updates visual part
mSuffixNeedsRefresh = true;
mLabelWidthDirty = true;
return true;
@@ -363,7 +361,6 @@ void LLFolderViewItem::refresh()
mLabel = utf8str_to_wstring(vmi.getDisplayName());
mLabelFontBuffer.reset();
mIsFavorite = vmi.isFavorite() && !vmi.isItemInTrash();
- setToolTip(vmi.getName());
// icons are slightly expensive to get, can be optimized
// see LLInventoryIcon::getIcon()
mIcon = vmi.getIcon();
@@ -623,6 +620,19 @@ const std::string& LLFolderViewItem::getName( void ) const
return getViewModelItem() ? getViewModelItem()->getName() : noName;
}
+const std::string LLFolderViewItem::getToolTip() const
+{
+ // Return the item name as tooltip without storing it
+ if (!LLView::sDebugUnicode)
+ {
+ if (const LLFolderViewModelItem* vmi = getViewModelItem())
+ {
+ return vmi->getName();
+ }
+ }
+ return LLView::getToolTip();
+}
+
// LLView functionality
bool LLFolderViewItem::handleRightMouseDown( S32 x, S32 y, MASK mask )
{