summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexanderP ProductEngine <apaschenko@productengine.com>2012-11-16 12:38:40 +0200
committerAlexanderP ProductEngine <apaschenko@productengine.com>2012-11-16 12:38:40 +0200
commit50b69c3f97c0b58791f7dd67f8b2fbdc9e8ef503 (patch)
tree1a97f8460be345cf88203222260d330b1fb09894
parent0b910871ab2935bde912314515f8b53ec3ff754e (diff)
CHUI-487, CHUI-488 W.I.P. #3 (Enable flashing FUI button behavior and Implement Flashing Conversations panel line item behavior): implemented conversation's item flashing
-rw-r--r--indra/llui/llbutton.cpp6
-rwxr-xr-xindra/llui/llfolderviewitem.cpp16
-rwxr-xr-xindra/llui/llfolderviewitem.h2
-rw-r--r--indra/newview/llflashtimer.cpp14
-rw-r--r--indra/newview/llflashtimer.h6
-rw-r--r--indra/newview/llfloaterimcontainer.cpp11
-rw-r--r--indra/newview/llfloaterimcontainer.h1
7 files changed, 48 insertions, 8 deletions
diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp
index 705fe16559..3b9076ee54 100644
--- a/indra/llui/llbutton.cpp
+++ b/indra/llui/llbutton.cpp
@@ -176,7 +176,11 @@ LLButton::LLButton(const LLButton::Params& p)
{
static LLUICachedControl<S32> llbutton_orig_h_pad ("UIButtonOrigHPad", 0);
static Params default_params(LLUICtrlFactory::getDefaultParams<LLButton>());
-
+if (this->getName() == "chat")
+{
+bool q = false;
+q = !q;
+}
if (!p.label_selected.isProvided())
{
mSelectedLabel = mUnselectedLabel;
diff --git a/indra/llui/llfolderviewitem.cpp b/indra/llui/llfolderviewitem.cpp
index 822534ffcf..90568f344a 100755
--- a/indra/llui/llfolderviewitem.cpp
+++ b/indra/llui/llfolderviewitem.cpp
@@ -23,9 +23,11 @@
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
+
+#include "../newview/llflashtimer.h"
+
#include "linden_common.h"
#include "llfolderviewitem.h"
-
#include "llfolderview.h"
#include "llfolderviewmodel.h"
#include "llpanel.h"
@@ -142,6 +144,8 @@ 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);
@@ -676,12 +680,16 @@ 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 (mIsSelected) // always render "current" item. Only render other selected items if mShowSingleSelection is FALSE
{
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
LLColor4 bg_color = bgColor;
- if (!mIsCurSelection)
+ bool selection = flashing? mFlashTimer->isHighlight() : mIsCurSelection;
+ if (!selection)
{
// do time-based fade of extra objects
F32 fade_time = (getRoot() ? getRoot()->getSelectionFadeElapsedTime() : 0.0f);
@@ -701,7 +709,7 @@ void LLFolderViewItem::drawHighlight(const BOOL showContent, const BOOL hasKeybo
getRect().getWidth() - 2,
focus_bottom,
bg_color, hasKeyboardFocus);
- if (mIsCurSelection)
+ if (selection)
{
gl_rect_2d(FOCUS_LEFT,
focus_top,
diff --git a/indra/llui/llfolderviewitem.h b/indra/llui/llfolderviewitem.h
index 152ca242e1..c16d65206f 100755
--- a/indra/llui/llfolderviewitem.h
+++ b/indra/llui/llfolderviewitem.h
@@ -29,6 +29,7 @@
#include "llview.h"
#include "lluiimage.h"
+class LLFlashTimer;
class LLFolderView;
class LLFolderViewModelItem;
class LLFolderViewFolder;
@@ -272,6 +273,7 @@ public:
private:
static std::map<U8, LLFontGL*> sFonts; // map of styles to fonts
+ LLFlashTimer* mFlashTimer;
};
diff --git a/indra/newview/llflashtimer.cpp b/indra/newview/llflashtimer.cpp
index f44ca9f90c..2feacfa218 100644
--- a/indra/newview/llflashtimer.cpp
+++ b/indra/newview/llflashtimer.cpp
@@ -29,11 +29,13 @@
#include "llflashtimer.h"
#include "llviewercontrol.h"
+#include "lleventtimer.h"
LLFlashTimer::LLFlashTimer(callback_t cb, S32 count, F32 period)
: LLEventTimer(period)
, mCallback(cb)
, mCurrentTickCount(0)
+ , mIsFlashing(false)
{
mEventTimer.stop();
@@ -49,8 +51,11 @@ LLFlashTimer::LLFlashTimer(callback_t cb, S32 count, F32 period)
BOOL LLFlashTimer::tick()
{
- bool blink = !(mCurrentTickCount % 2);
- mCallback(blink);
+ mIsHighlight = !(mCurrentTickCount % 2);
+ if (mCallback)
+ {
+ mCallback(mIsHighlight);
+ }
if (++mCurrentTickCount >= mFlashCount)
{
@@ -63,10 +68,15 @@ BOOL LLFlashTimer::tick()
void LLFlashTimer::startFlashing()
{
mCurrentTickCount = 0;
+ mIsFlashing = true;
mEventTimer.start();
}
void LLFlashTimer::stopFlashing()
{
+ mIsFlashing = false;
+ mIsHighlight = false;
mEventTimer.stop();
}
+
+
diff --git a/indra/newview/llflashtimer.h b/indra/newview/llflashtimer.h
index 95e458dff6..c030edfc52 100644
--- a/indra/newview/llflashtimer.h
+++ b/indra/newview/llflashtimer.h
@@ -42,13 +42,15 @@ public:
* @param period - how frequently callback should be called
* @param cb - callback to be called each tick
*/
- LLFlashTimer(callback_t cb, S32 count = 0, F32 period = 0.0);
+ LLFlashTimer(callback_t cb = NULL, S32 count = 0, F32 period = 0.0);
~LLFlashTimer() {};
/*virtual*/ BOOL tick();
void startFlashing();
void stopFlashing();
+ bool isFlashing() {return mIsFlashing;}
+ bool isHighlight() {return mIsHighlight;}
private:
callback_t mCallback;
@@ -57,6 +59,8 @@ private:
*/
S32 mFlashCount;
S32 mCurrentTickCount;
+ bool mIsHighlight;
+ bool mIsFlashing;
};
#endif /* LL_FLASHTIMER_H */
diff --git a/indra/newview/llfloaterimcontainer.cpp b/indra/newview/llfloaterimcontainer.cpp
index aebfdb5bce..da6f3a484d 100644
--- a/indra/newview/llfloaterimcontainer.cpp
+++ b/indra/newview/llfloaterimcontainer.cpp
@@ -1154,6 +1154,7 @@ void LLFloaterIMContainer::selectConversation(const LLUUID& session_id)
}
}
+
// Synchronous select the conversation item and the conversation floater
BOOL LLFloaterIMContainer::selectConversationPair(const LLUUID& session_id, bool select_widget)
{
@@ -1596,4 +1597,14 @@ void LLFloaterIMContainer::reSelectConversation()
}
+void LLFloaterIMContainer::flashConversationItemWidget(const LLUUID& session_id)
+{
+ LLFolderViewItem* widget = get_ptr_in_map(mConversationsWidgets,session_id);
+ if (widget)
+ {
+ widget->;
+ }
+
+}
+
// EOF
diff --git a/indra/newview/llfloaterimcontainer.h b/indra/newview/llfloaterimcontainer.h
index afc8d00174..443688668b 100644
--- a/indra/newview/llfloaterimcontainer.h
+++ b/indra/newview/llfloaterimcontainer.h
@@ -164,6 +164,7 @@ public:
void setTimeNow(const LLUUID& session_id, const LLUUID& participant_id);
void setNearbyDistances();
void reSelectConversation();
+ void flashConversationItemWidget(const LLUUID& session_id);
private:
LLConversationViewSession* createConversationItemWidget(LLConversationItem* item);