diff options
author | Gilbert Gonzales <gilbert@lindenlab.com> | 2012-12-20 10:21:26 -0800 |
---|---|---|
committer | Gilbert Gonzales <gilbert@lindenlab.com> | 2012-12-20 10:21:26 -0800 |
commit | 9ea83e76f67406755a3a1ca5a8ac1d544e157e43 (patch) | |
tree | 08ae7a53990bd18fe6aeda34d28fdf756190c658 | |
parent | 2feff5fe7495dddbaa7878d4e804ad2bea149971 (diff) | |
parent | ba1bf891e54fbf30c674d5526a5a2040e1e23a1a (diff) |
mergining in latest changes
-rw-r--r-- | indra/llui/llbutton.cpp | 29 | ||||
-rwxr-xr-x | indra/llui/llfolderviewitem.cpp | 46 | ||||
-rwxr-xr-x | indra/llui/llfolderviewitem.h | 5 | ||||
-rwxr-xr-x | indra/newview/llconversationview.cpp | 25 | ||||
-rwxr-xr-x | indra/newview/llconversationview.h | 5 | ||||
-rw-r--r-- | indra/newview/llfloaterimcontainer.cpp | 40 | ||||
-rw-r--r-- | indra/newview/llfloaterimcontainer.h | 1 | ||||
-rw-r--r-- | indra/newview/llfloaterimsessiontab.cpp | 2 | ||||
-rw-r--r-- | indra/newview/llimview.cpp | 36 | ||||
-rw-r--r-- | indra/newview/skins/default/colors.xml | 9 |
10 files changed, 118 insertions, 80 deletions
diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp index 99384439d2..7ca9b869a8 100644 --- a/indra/llui/llbutton.cpp +++ b/indra/llui/llbutton.cpp @@ -311,7 +311,7 @@ void LLButton::onCommit() { make_ui_sound("UISndClickRelease"); } - + if (mIsToggle) { toggleState(); @@ -613,10 +613,6 @@ void LLButton::draw() static LLCachedControl<bool> sEnableButtonFlashing(*LLUI::sSettingGroups["config"], "EnableButtonFlashing", true); F32 alpha = mUseDrawContextAlpha ? getDrawContext().mAlpha : getCurrentTransparency(); - if (mFlashingTimer) - { - mFlashing = mFlashingTimer->isFlashingInProgress(); - } bool flash = mFlashing && sEnableButtonFlashing; bool pressed_by_keyboard = FALSE; @@ -701,7 +697,8 @@ void LLButton::draw() imagep = mImageDisabled; } - if (mFlashing) + // Selected has a higher priority than flashing. If both are set, flashing is ignored. + if (mFlashing && !selected) { // if button should flash and we have icon for flashing, use it as image for button if(flash && mImageFlash) @@ -711,13 +708,13 @@ void LLButton::draw() imagep = mImageFlash; } // else use usual flashing via flash_color - else + else if (mFlashingTimer) { LLColor4 flash_color = mFlashBgColor.get(); use_glow_effect = TRUE; glow_type = LLRender::BT_ALPHA; // blend the glow - if (mFlashingTimer->isCurrentlyHighlighted()) + if (mFlashingTimer->isCurrentlyHighlighted() || !mFlashingTimer->isFlashingInProgress()) { glow_color = flash_color; } @@ -773,8 +770,7 @@ void LLButton::draw() if (use_glow_effect) { mCurGlowStrength = lerp(mCurGlowStrength, - mFlashing ? (mFlashingTimer->isCurrentlyHighlighted() || mNeedsHighlight? 1.0 : 0.0) - : mHoverGlowStrength, + mFlashing ? (mFlashingTimer->isCurrentlyHighlighted() || !mFlashingTimer->isFlashingInProgress() || mNeedsHighlight? 1.0 : 0.0) : mHoverGlowStrength, LLCriticalDamp::getInterpolant(0.05f)); } else @@ -961,23 +957,18 @@ void LLButton::setToggleState(BOOL b) { setControlValue(b); // will fire LLControlVariable callbacks (if any) setValue(b); // may or may not be redundant + setFlashing(false); // stop flash state whenever the selected/unselected state if reset // Unselected label assignments autoResize(); } } -void LLButton::setFlashing( bool b ) +void LLButton::setFlashing(bool b) { if (mFlashingTimer) { - if (b) - { - mFlashingTimer->startFlashing(); - } - else - { - mFlashingTimer->stopFlashing(); - } + mFlashing = b; + (b ? mFlashingTimer->startFlashing() : mFlashingTimer->stopFlashing()); } else if (b != mFlashing) { diff --git a/indra/llui/llfolderviewitem.cpp b/indra/llui/llfolderviewitem.cpp index dc7e4777a7..1281d6bd66 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..e51efd48f5 100755 --- a/indra/newview/llconversationview.cpp +++ b/indra/newview/llconversationview.cpp @@ -81,7 +81,9 @@ LLConversationViewSession::LLConversationViewSession(const LLConversationViewSes mSpeakingIndicator(NULL), mVoiceClientObserver(NULL), mCollapsedMode(false), - mHasArrow(true) + mHasArrow(true), + mFlashStateOn(false), + mFlashStarted(false) { mFlashTimer = new LLFlashTimer(); } @@ -101,7 +103,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 +210,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(); @@ -231,6 +246,7 @@ BOOL LLConversationViewSession::handleMouseDown( S32 x, S32 y, MASK mask ) if(result && getRoot()->getCurSelectedItem() == this) { LLFloaterIMContainer *im_container = LLFloaterReg::getTypedInstance<LLFloaterIMContainer>("im_container"); + im_container->clearAllFlashStates(); im_container->selectConversationPair(session_id, false); im_container->collapseMessagesPane(false); } @@ -427,6 +443,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 +467,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/llfloaterimcontainer.cpp b/indra/newview/llfloaterimcontainer.cpp index 390eec84f6..92ea6dacde 100644 --- a/indra/newview/llfloaterimcontainer.cpp +++ b/indra/newview/llfloaterimcontainer.cpp @@ -1101,7 +1101,14 @@ bool LLFloaterIMContainer::enableContextMenuItem(const LLSD& userdata) uuid_vec_t uuids; getParticipantUUIDs(uuids); - if("can_activate_group" == item) + + // If nothing is selected, everything needs to be disabled + if (uuids.size() <= 0) + { + return false; + } + + if("can_activate_group" == item) { LLUUID selected_group_id = getCurSelectedViewModelItem()->getUUID(); return gAgent.getGroupID() != selected_group_id; @@ -1116,12 +1123,6 @@ bool LLFloaterIMContainer::enableContextMenuItem(const std::string& item, uuid_v { return gSavedSettings.getBOOL("KeepConversationLogTranscripts"); } - - // If nothing is selected, everything needs to be disabled - if (uuids.size() <= 0) - { - return false; - } // Extract the single select info bool is_single_select = (uuids.size() == 1); @@ -1229,6 +1230,20 @@ void LLFloaterIMContainer::showConversation(const LLUUID& session_id) selectConversationPair(session_id, true); } +void LLFloaterIMContainer::clearAllFlashStates() +{ + llinfos << "Merov debug : clear all flash states" << llendl; + conversations_widgets_map::iterator widget_it = mConversationsWidgets.begin(); + for (;widget_it != mConversationsWidgets.end(); ++widget_it) + { + LLConversationViewSession* widget = dynamic_cast<LLConversationViewSession*>(widget_it->second); + if (widget) + { + widget->setFlashState(false); + } + } +} + void LLFloaterIMContainer::selectConversation(const LLUUID& session_id) { selectConversationPair(session_id, true); @@ -1240,17 +1255,6 @@ BOOL LLFloaterIMContainer::selectConversationPair(const LLUUID& session_id, bool BOOL handled = TRUE; LLFloaterIMSessionTab* session_floater = LLFloaterIMSessionTab::findConversation(session_id); - // On selection, stop the flash state on all conversation widgets - conversations_widgets_map::iterator widget_it = mConversationsWidgets.begin(); - for (;widget_it != mConversationsWidgets.end(); ++widget_it) - { - LLConversationViewSession* widget = dynamic_cast<LLConversationViewSession*>(widget_it->second); - if (widget) - { - widget->setFlashState(false); - } - } - /* widget processing */ if (select_widget) { diff --git a/indra/newview/llfloaterimcontainer.h b/indra/newview/llfloaterimcontainer.h index 5db1565cea..09a24c0105 100644 --- a/indra/newview/llfloaterimcontainer.h +++ b/indra/newview/llfloaterimcontainer.h @@ -69,6 +69,7 @@ public: void showConversation(const LLUUID& session_id); void selectConversation(const LLUUID& session_id); BOOL selectConversationPair(const LLUUID& session_id, bool select_widget); + void clearAllFlashStates(); /*virtual*/ void tabClose(); void showStub(bool visible); diff --git a/indra/newview/llfloaterimsessiontab.cpp b/indra/newview/llfloaterimsessiontab.cpp index 7984034ded..53d2f31b79 100644 --- a/indra/newview/llfloaterimsessiontab.cpp +++ b/indra/newview/llfloaterimsessiontab.cpp @@ -308,7 +308,7 @@ void LLFloaterIMSessionTab::onFocusReceived() LLFloaterIMContainer* container = LLFloaterReg::getTypedInstance<LLFloaterIMContainer>("im_container"); if (container) { - container->selectConversationPair(mSessionID, ! getHost()); + container->selectConversationPair(mSessionID, true); container->showStub(! getHost()); } } diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 5b4d5466a1..cdc51ad2fc 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -155,7 +155,6 @@ void on_new_message(const LLSD& msg) } // execution of the action - LLFloaterIMContainer* im_box = LLFloaterReg::getTypedInstance<LLFloaterIMContainer>("im_container"); LLFloaterIMSessionTab* session_floater = LLFloaterIMSessionTab::getConversation(session_id); @@ -174,13 +173,11 @@ void on_new_message(const LLSD& msg) if ("toast" == action) { // Skip toasting if we have open window of IM with this session id - if ( - session_floater + if (session_floater && session_floater->isInVisibleChain() && session_floater->hasFocus() && !session_floater->isMinimized() - && !(session_floater->getHost() - && session_floater->getHost()->isMinimized()) + && !(session_floater->getHost() && session_floater->getHost()->isMinimized()) ) { return; @@ -222,10 +219,10 @@ void on_new_message(const LLSD& msg) gToolBarView->flashCommand(LLCommandId("chat"), true); } //conversation floater is open but a different conversation is focused - else - { + //else + //{ im_box->flashConversationItemWidget(session_id, true); - } + //} } } @@ -2491,16 +2488,23 @@ void LLIMMgr::addMessage( } // Open conversation log if offline messages are present and user allows a Call Log - if (is_offline_msg && gSavedSettings.getBOOL("KeepConversationLogTranscripts")) - { - LLFloaterConversationLog* floater_log = - LLFloaterReg::getTypedInstance<LLFloaterConversationLog>("conversation"); - if (floater_log && !(floater_log->isFrontmost())) + if (is_offline_msg) + { + if (gSavedSettings.getBOOL("KeepConversationLogTranscripts")) + { + LLFloaterConversationLog* floater_log = + LLFloaterReg::getTypedInstance<LLFloaterConversationLog>("conversation"); + if (floater_log && !(floater_log->isFrontmost())) + { + floater_log->openFloater(); + floater_log->setFrontmost(TRUE); + } + } + else { - floater_log->openFloater(); - floater_log->setFrontmost(TRUE); + gToolBarView->flashCommand(LLCommandId("chat"), true); } - } + } //*NOTE session_name is empty in case of incoming P2P sessions std::string fixed_session_name = from; diff --git a/indra/newview/skins/default/colors.xml b/indra/newview/skins/default/colors.xml index afd8ee4ba1..0de217fc0d 100644 --- a/indra/newview/skins/default/colors.xml +++ b/indra/newview/skins/default/colors.xml @@ -11,9 +11,9 @@ <color name="EmphasisColor_35" value="0.38 0.694 0.573 0.35" /> - <color - name="BeaconColor" - value="1 .67 .2 1" /> + <color + name="BeaconColor" + value="0.749 0.298 0 1" /> <color name="White" value="1 1 1 1" /> @@ -526,6 +526,9 @@ name="MenuItemHighlightBgColor" reference="EmphasisColor_35" /> <color + name="MenuItemFlashBgColor" + reference="BeaconColor" /> + <color name="MenuItemHighlightFgColor" reference="White" /> <color |