summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
Diffstat (limited to 'indra')
-rwxr-xr-xindra/llui/llfolderviewitem.cpp46
-rwxr-xr-xindra/llui/llfolderviewitem.h5
-rwxr-xr-xindra/newview/llconversationview.cpp20
-rwxr-xr-xindra/newview/llconversationview.h5
-rw-r--r--indra/newview/skins/default/colors.xml6
5 files changed, 60 insertions, 22 deletions
diff --git a/indra/llui/llfolderviewitem.cpp b/indra/llui/llfolderviewitem.cpp
index 0a06ce66aa..100904c5a2 100755
--- a/indra/llui/llfolderviewitem.cpp
+++ b/indra/llui/llfolderviewitem.cpp
@@ -50,6 +50,7 @@ std::map<U8, LLFontGL*> LLFolderViewItem::sFonts; // map of styles to fonts
bool LLFolderViewItem::sColorSetInitialized = false;
LLUIColor LLFolderViewItem::sFgColor;
LLUIColor LLFolderViewItem::sHighlightBgColor;
+LLUIColor LLFolderViewItem::sFlashBgColor;
LLUIColor LLFolderViewItem::sFocusOutlineColor;
LLUIColor LLFolderViewItem::sMouseOverColor;
LLUIColor LLFolderViewItem::sFilterBGColor;
@@ -151,6 +152,7 @@ LLFolderViewItem::LLFolderViewItem(const LLFolderViewItem::Params& p)
{
sFgColor = LLUIColorTable::instance().getColor("MenuItemEnabledColor", DEFAULT_WHITE);
sHighlightBgColor = LLUIColorTable::instance().getColor("MenuItemHighlightBgColor", DEFAULT_WHITE);
+ sFlashBgColor = LLUIColorTable::instance().getColor("MenuItemFlashBgColor", DEFAULT_WHITE);
sFocusOutlineColor = LLUIColorTable::instance().getColor("InventoryFocusOutlineColor", DEFAULT_WHITE);
sMouseOverColor = LLUIColorTable::instance().getColor("InventoryMouseOverColor", DEFAULT_WHITE);
sFilterBGColor = LLUIColorTable::instance().getColor("FilterBackgroundColor", DEFAULT_WHITE);
@@ -686,26 +688,31 @@ void LLFolderViewItem::drawOpenFolderArrow(const Params& default_params, const L
return mIsCurSelection;
}
-void LLFolderViewItem::drawHighlight(const BOOL showContent, const BOOL hasKeyboardFocus, const LLUIColor &bgColor,
+void LLFolderViewItem::drawHighlight(const BOOL showContent, const BOOL hasKeyboardFocus, const LLUIColor &selectColor, const LLUIColor &flashColor,
const LLUIColor &focusOutlineColor, const LLUIColor &mouseOverColor)
{
-
- //--------------------------------------------------------------------------------//
- // Draw highlight for selected items
- //
-
const S32 focus_top = getRect().getHeight();
const S32 focus_bottom = getRect().getHeight() - mItemHeight;
const bool folder_open = (getRect().getHeight() > mItemHeight + 4);
const S32 FOCUS_LEFT = 1;
+
+ // Determine which background color to use for highlighting
+ LLUIColor bgColor = (isFlashing() ? flashColor : selectColor);
- if (isHighlightAllowed()) // always render "current" item (only render other selected items if
- // mShowSingleSelection is FALSE) or flashing item
+ //--------------------------------------------------------------------------------//
+ // Draw highlight for selected items
+ // Note: Always render "current" item or flashing item, only render other selected
+ // items if mShowSingleSelection is FALSE.
+ //
+ if (isHighlightAllowed())
+
{
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
- LLColor4 bg_color = bgColor;
- if (!isHighlightActive())
+
+ // Highlight for selected but not current items
+ if (!isHighlightActive() && !isFlashing())
{
+ LLColor4 bg_color = bgColor;
// do time-based fade of extra objects
F32 fade_time = (getRoot() ? getRoot()->getSelectionFadeElapsedTime() : 0.0f);
if (getRoot() && getRoot()->getShowSingleSelection())
@@ -718,25 +725,30 @@ void LLFolderViewItem::drawHighlight(const BOOL showContent, const BOOL hasKeybo
// fading in
bg_color.mV[VALPHA] = clamp_rescale(fade_time, 0.f, 0.4f, 0.f, bg_color.mV[VALPHA]);
}
+ gl_rect_2d(FOCUS_LEFT,
+ focus_top,
+ getRect().getWidth() - 2,
+ focus_bottom,
+ bg_color, hasKeyboardFocus);
}
- if (isHighlightAllowed() || isHighlightActive())
+ // Highlight for currently selected or flashing item
+ if (isHighlightActive())
{
+ // Background
gl_rect_2d(FOCUS_LEFT,
focus_top,
getRect().getWidth() - 2,
focus_bottom,
- bg_color, hasKeyboardFocus);
- }
-
- if (isHighlightActive())
- {
+ bgColor, hasKeyboardFocus);
+ // Outline
gl_rect_2d(FOCUS_LEFT,
focus_top,
getRect().getWidth() - 2,
focus_bottom,
focusOutlineColor, FALSE);
}
+
if (folder_open)
{
gl_rect_2d(FOCUS_LEFT,
@@ -810,7 +822,7 @@ void LLFolderViewItem::draw()
drawOpenFolderArrow(default_params, sFgColor);
- drawHighlight(show_context, filled, sHighlightBgColor, sFocusOutlineColor, sMouseOverColor);
+ drawHighlight(show_context, filled, sHighlightBgColor, sFlashBgColor, sFocusOutlineColor, sMouseOverColor);
//--------------------------------------------------------------------------------//
// Draw open icon
diff --git a/indra/llui/llfolderviewitem.h b/indra/llui/llfolderviewitem.h
index d7f5e86aea..ca31931e19 100755
--- a/indra/llui/llfolderviewitem.h
+++ b/indra/llui/llfolderviewitem.h
@@ -128,6 +128,7 @@ protected:
static LLUIColor sFgColor;
static LLUIColor sFgDisabledColor;
static LLUIColor sHighlightBgColor;
+ static LLUIColor sFlashBgColor;
static LLUIColor sFocusOutlineColor;
static LLUIColor sMouseOverColor;
static LLUIColor sFilterBGColor;
@@ -141,6 +142,8 @@ protected:
virtual void addFolder(LLFolderViewFolder*) { }
virtual bool isHighlightAllowed();
virtual bool isHighlightActive();
+ virtual bool isFlashing() { return false; }
+ virtual void setFlashState(bool) { }
static LLFontGL* getLabelFontForStyle(U8 style);
@@ -269,7 +272,7 @@ public:
// virtual void handleDropped();
virtual void draw();
void drawOpenFolderArrow(const Params& default_params, const LLUIColor& fg_color);
- void drawHighlight(const BOOL showContent, const BOOL hasKeyboardFocus, const LLUIColor &bgColor, const LLUIColor &outlineColor, const LLUIColor &mouseOverColor);
+ void drawHighlight(const BOOL showContent, const BOOL hasKeyboardFocus, const LLUIColor &selectColor, const LLUIColor &flashColor, const LLUIColor &outlineColor, const LLUIColor &mouseOverColor);
void drawLabel(const LLFontGL * font, const F32 x, const F32 y, const LLColor4& color, F32 &right_x);
virtual BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
EDragAndDropType cargo_type,
diff --git a/indra/newview/llconversationview.cpp b/indra/newview/llconversationview.cpp
index c0a209f22d..d3a0e882f5 100755
--- a/indra/newview/llconversationview.cpp
+++ b/indra/newview/llconversationview.cpp
@@ -101,7 +101,17 @@ LLConversationViewSession::~LLConversationViewSession()
void LLConversationViewSession::setFlashState(bool flash_state)
{
mFlashStateOn = flash_state;
- (flash_state ? mFlashTimer->startFlashing() : mFlashTimer->stopFlashing());
+ mFlashStarted = false;
+ mFlashTimer->stopFlashing();
+}
+
+void LLConversationViewSession::startFlashing()
+{
+ if (mFlashStateOn && !mFlashStarted)
+ {
+ mFlashStarted = true;
+ mFlashTimer->startFlashing();
+ }
}
bool LLConversationViewSession::isHighlightAllowed()
@@ -198,8 +208,11 @@ void LLConversationViewSession::draw()
drawOpenFolderArrow(default_params, sFgColor);
}
+ // Indicate that flash can start (moot operation if already started, done or not flashing)
+ startFlashing();
+
// draw highlight for selected items
- drawHighlight(show_context, true, sHighlightBgColor, sFocusOutlineColor, sMouseOverColor);
+ drawHighlight(show_context, true, sHighlightBgColor, sFlashBgColor, sFocusOutlineColor, sMouseOverColor);
// Draw children if root folder, or any other folder that is open. Do not draw children when animating to closed state or you get rendering overlap.
bool draw_children = getRoot() == static_cast<LLFolderViewFolder*>(this) || isOpen();
@@ -427,6 +440,7 @@ void LLConversationViewParticipant::draw()
static LLUIColor sFgDisabledColor = LLUIColorTable::instance().getColor("MenuItemDisabledColor", DEFAULT_WHITE);
static LLUIColor sHighlightFgColor = LLUIColorTable::instance().getColor("MenuItemHighlightFgColor", DEFAULT_WHITE);
static LLUIColor sHighlightBgColor = LLUIColorTable::instance().getColor("MenuItemHighlightBgColor", DEFAULT_WHITE);
+ static LLUIColor sFlashBgColor = LLUIColorTable::instance().getColor("MenuItemFlashBgColor", DEFAULT_WHITE);
static LLUIColor sFocusOutlineColor = LLUIColorTable::instance().getColor("InventoryFocusOutlineColor", DEFAULT_WHITE);
static LLUIColor sMouseOverColor = LLUIColorTable::instance().getColor("InventoryMouseOverColor", DEFAULT_WHITE);
@@ -450,7 +464,7 @@ void LLConversationViewParticipant::draw()
color = mIsSelected ? sHighlightFgColor : sFgColor;
}
- drawHighlight(show_context, mIsSelected, sHighlightBgColor, sFocusOutlineColor, sMouseOverColor);
+ drawHighlight(show_context, mIsSelected, sHighlightBgColor, sFlashBgColor, sFocusOutlineColor, sMouseOverColor);
drawLabel(font, text_left, y, color, right_x);
refresh();
diff --git a/indra/newview/llconversationview.h b/indra/newview/llconversationview.h
index 1e20fb8b7e..74443e1d88 100755
--- a/indra/newview/llconversationview.h
+++ b/indra/newview/llconversationview.h
@@ -58,6 +58,7 @@ protected:
/*virtual*/ bool isHighlightAllowed();
/*virtual*/ bool isHighlightActive();
+ /*virtual*/ bool isFlashing() { return mFlashStateOn; }
LLFloaterIMContainer* mContainer;
@@ -83,11 +84,12 @@ public:
virtual void refresh();
- void setFlashState(bool flash_state);
+ /*virtual*/ void setFlashState(bool flash_state);
private:
void onCurrentVoiceSessionChanged(const LLUUID& session_id);
+ void startFlashing();
LLPanel* mItemPanel;
LLPanel* mCallIconLayoutPanel;
@@ -95,6 +97,7 @@ private:
LLOutputMonitorCtrl* mSpeakingIndicator;
LLFlashTimer* mFlashTimer;
bool mFlashStateOn;
+ bool mFlashStarted;
bool mCollapsedMode;
bool mHasArrow;
diff --git a/indra/newview/skins/default/colors.xml b/indra/newview/skins/default/colors.xml
index 05230b8bd5..becdbda067 100644
--- a/indra/newview/skins/default/colors.xml
+++ b/indra/newview/skins/default/colors.xml
@@ -12,6 +12,9 @@
name="EmphasisColor_35"
value="0.38 0.694 0.573 0.35" />
<color
+ name="BeaconColor"
+ value="1 .67 .2 1" />
+ <color
name="White"
value="1 1 1 1" />
<color
@@ -523,6 +526,9 @@
name="MenuItemHighlightBgColor"
reference="EmphasisColor_35" />
<color
+ name="MenuItemFlashBgColor"
+ reference="BeaconColor" />
+ <color
name="MenuItemHighlightFgColor"
reference="White" />
<color