summaryrefslogtreecommitdiff
path: root/indra/llui/llfolderviewitem.cpp
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2020-04-30 16:28:40 +0300
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2020-04-30 16:32:16 +0300
commit59433e3132b057003afcc1ba230ff16ffe62f92c (patch)
tree16f94bc4265881544a34388875ff7631004e1e53 /indra/llui/llfolderviewitem.cpp
parentd70b749101f5a954fc824e73519102a0d88f24ae (diff)
SL-13119 Made control settings cached and fixed potential filtering issue
Diffstat (limited to 'indra/llui/llfolderviewitem.cpp')
-rw-r--r--indra/llui/llfolderviewitem.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/indra/llui/llfolderviewitem.cpp b/indra/llui/llfolderviewitem.cpp
index 9754192b06..863a72b6c0 100644
--- a/indra/llui/llfolderviewitem.cpp
+++ b/indra/llui/llfolderviewitem.cpp
@@ -183,10 +183,13 @@ LLFolderViewItem::~LLFolderViewItem()
BOOL LLFolderViewItem::postBuild()
{
LLFolderViewModelItem& vmi = *getViewModelItem();
- mLabel = vmi.getDisplayName(); // slightly expensive, but only first time
+ // getDisplayName() is slightly expensive and requires a filter reset
+ mLabel = vmi.getDisplayName();
setToolTip(vmi.getName());
// Dirty the filter flag of the model from the view (CHUI-849)
+ vmi.dirtyFilter();
+
mLabelNeedsRefresh = true;
mLabelWidthDirty = true;
return TRUE;
@@ -288,10 +291,6 @@ void LLFolderViewItem::refresh()
{
LLFolderViewModelItem& vmi = *getViewModelItem();
- // getDisplayName() is slightly expensive on first run
- mLabel = vmi.getDisplayName();
- setToolTip(vmi.getName());
-
// icons are slightly expensive to get, can be optimized
// see LLInventoryIcon::getIcon()
mIcon = vmi.getIcon();
@@ -306,8 +305,6 @@ void LLFolderViewItem::refresh()
mLabelSuffix = vmi.getLabelSuffix();
}
- // Dirty the filter flag of the model from the view (CHUI-849)
- vmi.dirtyFilter();
mLabelWidthDirty = true;
mLabelNeedsRefresh = false;
}
@@ -362,6 +359,8 @@ S32 LLFolderViewItem::arrange( S32* width, S32* height )
{
if (mLabelNeedsRefresh)
{
+ // Expensive. But despite refreshing label,
+ // it is purely visual, so it is fine to do at our laisure
refresh();
}
mLabelWidth = getLabelXPos() + getLabelFontForStyle(mLabelStyle)->getWidth(mLabel) + getLabelFontForStyle(mLabelStyle)->getWidth(mLabelSuffix) + mLabelPaddingRight;