summaryrefslogtreecommitdiff
path: root/indra/llui/llfolderviewitem.cpp
diff options
context:
space:
mode:
authorWilliam Todd Stinson <stinson@lindenlab.com>2012-11-21 16:01:54 -0800
committerWilliam Todd Stinson <stinson@lindenlab.com>2012-11-21 16:01:54 -0800
commitf23e0ffdb2ff2ad43a996c489b08c1324d9e5ee1 (patch)
treee5219901b9edc82f78a530219707f5859ccb54fc /indra/llui/llfolderviewitem.cpp
parentb76123589381a2f59b704e8850792f9dcdc62517 (diff)
parentedeeed95416be2679e1ad3d29bab5396dbcccaa2 (diff)
Pull and merge from ssh://stinson@hg.lindenlab.com/richard/viewer-chui/.
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,