summaryrefslogtreecommitdiff
path: root/indra/llui/llfolderviewitem.cpp
diff options
context:
space:
mode:
authormaksymsproductengine <maksymsproductengine@lindenlab.com>2012-11-21 01:41:49 +0200
committermaksymsproductengine <maksymsproductengine@lindenlab.com>2012-11-21 01:41:49 +0200
commitedeeed95416be2679e1ad3d29bab5396dbcccaa2 (patch)
tree14699bebd00d0a4330fed43c3aa47f83259cf9f2 /indra/llui/llfolderviewitem.cpp
parent7f19e6de5c55c1a28d329fbd6dea728f48b99495 (diff)
CHUI-531 FIXED Poor fps in CHUI viewer
Diffstat (limited to 'indra/llui/llfolderviewitem.cpp')
-rwxr-xr-xindra/llui/llfolderviewitem.cpp24
1 files changed, 14 insertions, 10 deletions
diff --git a/indra/llui/llfolderviewitem.cpp b/indra/llui/llfolderviewitem.cpp
index d65f53cd4d..95407d2364 100755
--- a/indra/llui/llfolderviewitem.cpp
+++ b/indra/llui/llfolderviewitem.cpp
@@ -145,8 +145,6 @@ LLFolderViewItem::LLFolderViewItem(const LLFolderViewItem::Params& p)
mArrowSize(p.arrow_size),
mMaxFolderItemOverlap(p.max_folder_item_overlap)
{
- mFlashTimer = new LLFlashTimer();
-
sFgColor = LLUIColorTable::instance().getColor("MenuItemEnabledColor", DEFAULT_WHITE);
sHighlightBgColor = LLUIColorTable::instance().getColor("MenuItemHighlightBgColor", DEFAULT_WHITE);
sHighlightFgColor = LLUIColorTable::instance().getColor("MenuItemHighlightFgColor", DEFAULT_WHITE);
@@ -168,7 +166,6 @@ LLFolderViewItem::LLFolderViewItem(const LLFolderViewItem::Params& p)
// Destroys the object
LLFolderViewItem::~LLFolderViewItem()
{
- delete mFlashTimer;
mViewModelItem = NULL;
}
@@ -671,6 +668,16 @@ void LLFolderViewItem::drawOpenFolderArrow(const Params& default_params, const L
}
}
+/*virtual*/ bool LLFolderViewItem::isHighlightAllowed()
+{
+ return mIsSelected;
+}
+
+/*virtual*/ bool LLFolderViewItem::isHighlightActive()
+{
+ return mIsCurSelection;
+}
+
void LLFolderViewItem::drawHighlight(const BOOL showContent, const BOOL hasKeyboardFocus, const LLUIColor &bgColor,
const LLUIColor &focusOutlineColor, const LLUIColor &mouseOverColor)
{
@@ -683,16 +690,13 @@ void LLFolderViewItem::drawHighlight(const BOOL showContent, const BOOL hasKeybo
const S32 focus_bottom = getRect().getHeight() - mItemHeight;
const bool folder_open = (getRect().getHeight() > mItemHeight + 4);
const S32 FOCUS_LEFT = 1;
- bool flashing = mFlashTimer->isFlashing();
-
- if (flashing? mFlashTimer->isHighlight() : mIsSelected) // always render "current" item (only render other selected items if
- // mShowSingleSelection is FALSE) or flashing item
+ if (isHighlightAllowed()) // always render "current" item (only render other selected items if
+ // mShowSingleSelection is FALSE) or flashing item
{
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
LLColor4 bg_color = bgColor;
- bool selection = flashing? mFlashTimer->isHighlight() : mIsCurSelection;
- if (!selection)
+ if (!isHighlightActive())
{
// do time-based fade of extra objects
F32 fade_time = (getRoot() ? getRoot()->getSelectionFadeElapsedTime() : 0.0f);
@@ -712,7 +716,7 @@ void LLFolderViewItem::drawHighlight(const BOOL showContent, const BOOL hasKeybo
getRect().getWidth() - 2,
focus_bottom,
bg_color, hasKeyboardFocus);
- if (selection)
+ if (isHighlightActive())
{
gl_rect_2d(FOCUS_LEFT,
focus_top,