diff options
author | Merov Linden <merov@lindenlab.com> | 2010-12-09 14:51:35 -0800 |
---|---|---|
committer | Merov Linden <merov@lindenlab.com> | 2010-12-09 14:51:35 -0800 |
commit | a1839ab425dd4c878d16b8705cfb62d3974b16d1 (patch) | |
tree | f673f42b73eab50641dbfe7dc50b2a56fdd23881 /indra | |
parent | 88fb64283310cc02bb6f6f55d6b660fc4cd90d72 (diff) | |
parent | 0308dbeda7645061e780db2bdb7dbdb0069faf67 (diff) |
STORM-732, STORM-733, STORM-735, STORM-766, STORM-774 : pull into viewer-development
Diffstat (limited to 'indra')
-rw-r--r-- | indra/llui/llfloater.cpp | 6 | ||||
-rw-r--r-- | indra/newview/llnearbychathandler.cpp | 45 | ||||
-rw-r--r-- | indra/newview/llscreenchannel.cpp | 20 | ||||
-rw-r--r-- | indra/newview/llscreenchannel.h | 4 | ||||
-rw-r--r-- | indra/newview/lltoast.cpp | 63 | ||||
-rw-r--r-- | indra/newview/lltoast.h | 19 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/floater_env_settings.xml | 1 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/panel_group_list_item.xml | 1 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/widgets/group_icon.xml | 3 |
9 files changed, 81 insertions, 81 deletions
diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index 7727e154da..1265733bf5 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -1,4 +1,5 @@ /** + * @file llfloater.cpp * @brief LLFloater base class * @@ -1189,7 +1190,7 @@ void LLFloater::setFocus( BOOL b ) last_focus->setFocus(TRUE); } } - updateTransparency(this, b ? TT_ACTIVE : TT_INACTIVE); + updateTransparency(b ? TT_ACTIVE : TT_INACTIVE); } // virtual @@ -1462,6 +1463,9 @@ void LLFloater::setFrontmost(BOOL take_focus) // there are more than one floater view // so we need to query our parent directly ((LLFloaterView*)getParent())->bringToFront(this, take_focus); + + // Make sure to set the appropriate transparency type (STORM-732). + updateTransparency(hasFocus() || getIsChrome() ? TT_ACTIVE : TT_INACTIVE); } } diff --git a/indra/newview/llnearbychathandler.cpp b/indra/newview/llnearbychathandler.cpp index dfbbaa0941..6f92dd6445 100644 --- a/indra/newview/llnearbychathandler.cpp +++ b/indra/newview/llnearbychathandler.cpp @@ -121,7 +121,7 @@ protected: if (!toast) return; LL_DEBUGS("NearbyChat") << "Pooling toast" << llendl; toast->setVisible(FALSE); - toast->stopFading(); + toast->stopTimer(); toast->setIsHidden(true); // Nearby chat toasts that are hidden, not destroyed. They are collected to the toast pool, so that @@ -165,20 +165,11 @@ public: : LLToast(p), mNearbyChatScreenChannelp(nc_channelp) { - updateTransparency(); - setMouseEnterCallback(boost::bind(&LLNearbyChatToast::updateTransparency, this)); - setMouseLeaveCallback(boost::bind(&LLNearbyChatToast::updateTransparency, this)); } /*virtual*/ void onClose(bool app_quitting); - /*virtual*/ void setBackgroundOpaque(BOOL b); - -protected: - /*virtual*/ void setTransparentState(bool transparent); private: - void updateTransparency(); - LLNearbyChatScreenChannel* mNearbyChatScreenChannelp; }; @@ -305,7 +296,7 @@ void LLNearbyChatScreenChannel::addNotification(LLSD& notification) { panel->addMessage(notification); toast->reshapeToPanel(); - toast->startFading(); + toast->startTimer(); arrangeToasts(); return; @@ -350,7 +341,7 @@ void LLNearbyChatScreenChannel::addNotification(LLSD& notification) panel->init(notification); toast->reshapeToPanel(); - toast->startFading(); + toast->startTimer(); m_active_toasts.push_back(toast->getHandle()); @@ -606,34 +597,4 @@ void LLNearbyChatToast::onClose(bool app_quitting) mNearbyChatScreenChannelp->onToastDestroyed(this, app_quitting); } -// virtual -void LLNearbyChatToast::setBackgroundOpaque(BOOL b) -{ - // We don't want background changes: transparency is handled differently. - LLToast::setBackgroundOpaque(TRUE); -} - -// virtual -void LLNearbyChatToast::setTransparentState(bool transparent) -{ - LLToast::setTransparentState(transparent); - updateTransparency(); -} - -void LLNearbyChatToast::updateTransparency() -{ - ETypeTransparency transparency_type; - - if (isHovered()) - { - transparency_type = TT_ACTIVE; - } - else - { - transparency_type = getTransparentState() ? TT_FADING : TT_INACTIVE; - } - - LLFloater::updateTransparency(transparency_type); -} - // EOF diff --git a/indra/newview/llscreenchannel.cpp b/indra/newview/llscreenchannel.cpp index 61f4897ed0..1645334b38 100644 --- a/indra/newview/llscreenchannel.cpp +++ b/indra/newview/llscreenchannel.cpp @@ -253,8 +253,8 @@ void LLScreenChannel::addToast(const LLToast::Params& p) if(mControlHovering) { new_toast_elem.toast->setOnToastHoverCallback(boost::bind(&LLScreenChannel::onToastHover, this, _1, _2)); - new_toast_elem.toast->setMouseEnterCallback(boost::bind(&LLScreenChannel::stopFadingToast, this, new_toast_elem.toast)); - new_toast_elem.toast->setMouseLeaveCallback(boost::bind(&LLScreenChannel::startFadingToast, this, new_toast_elem.toast)); + new_toast_elem.toast->setMouseEnterCallback(boost::bind(&LLScreenChannel::stopToastTimer, this, new_toast_elem.toast)); + new_toast_elem.toast->setMouseLeaveCallback(boost::bind(&LLScreenChannel::startToastTimer, this, new_toast_elem.toast)); } if(show_toast) @@ -369,7 +369,7 @@ void LLScreenChannel::loadStoredToastsToChannel() for(it = mStoredToastList.begin(); it != mStoredToastList.end(); ++it) { (*it).toast->setIsHidden(false); - (*it).toast->startFading(); + (*it).toast->startTimer(); mToastList.push_back((*it)); } @@ -394,7 +394,7 @@ void LLScreenChannel::loadStoredToastByNotificationIDToChannel(LLUUID id) } toast->setIsHidden(false); - toast->startFading(); + toast->startTimer(); mToastList.push_back((*it)); redrawToasts(); @@ -477,7 +477,7 @@ void LLScreenChannel::modifyToastByNotificationID(LLUUID id, LLPanel* panel) toast->removeChild(old_panel); delete old_panel; toast->insertPanel(panel); - toast->startFading(); + toast->startTimer(); redrawToasts(); } } @@ -588,7 +588,7 @@ void LLScreenChannel::showToastsBottom() mHiddenToastsNum = 0; for(; it != mToastList.rend(); it++) { - (*it).toast->stopFading(); + (*it).toast->stopTimer(); (*it).toast->setVisible(FALSE); mHiddenToastsNum++; } @@ -697,15 +697,15 @@ void LLScreenChannel::closeStartUpToast() } } -void LLNotificationsUI::LLScreenChannel::stopFadingToast(LLToast* toast) +void LLNotificationsUI::LLScreenChannel::stopToastTimer(LLToast* toast) { if (!toast || toast != mHoveredToast) return; // Pause fade timer of the hovered toast. - toast->stopFading(); + toast->stopTimer(); } -void LLNotificationsUI::LLScreenChannel::startFadingToast(LLToast* toast) +void LLNotificationsUI::LLScreenChannel::startToastTimer(LLToast* toast) { if (!toast || toast == mHoveredToast) { @@ -713,7 +713,7 @@ void LLNotificationsUI::LLScreenChannel::startFadingToast(LLToast* toast) } // Reset its fade timer. - toast->startFading(); + toast->startTimer(); } //-------------------------------------------------------------------------- diff --git a/indra/newview/llscreenchannel.h b/indra/newview/llscreenchannel.h index a1fdd6e32c..c9e511fb09 100644 --- a/indra/newview/llscreenchannel.h +++ b/indra/newview/llscreenchannel.h @@ -194,10 +194,10 @@ public: /** Stop fading given toast */ - virtual void stopFadingToast(LLToast* toast); + virtual void stopToastTimer(LLToast* toast); /** Start fading given toast */ - virtual void startFadingToast(LLToast* toast); + virtual void startToastTimer(LLToast* toast); // get StartUp Toast's state static bool getStartUpToastShown() { return mWasStartUpToastShown; } diff --git a/indra/newview/lltoast.cpp b/indra/newview/lltoast.cpp index 8916469e67..fd5582d6f7 100644 --- a/indra/newview/lltoast.cpp +++ b/indra/newview/lltoast.cpp @@ -113,7 +113,7 @@ LLToast::LLToast(const LLToast::Params& p) mHideBtnPressed(false), mIsTip(p.is_tip), mWrapperPanel(NULL), - mIsTransparent(false) + mIsFading(false) { mTimer.reset(new LLToastLifeTimer(this, p.lifetime_secs)); @@ -125,6 +125,9 @@ LLToast::LLToast(const LLToast::Params& p) mWrapperPanel->setMouseEnterCallback(boost::bind(&LLToast::onToastMouseEnter, this)); mWrapperPanel->setMouseLeaveCallback(boost::bind(&LLToast::onToastMouseLeave, this)); + setBackgroundOpaque(TRUE); // *TODO: obsolete + updateTransparency(); + if(mPanel) { insertPanel(mPanel); @@ -179,7 +182,7 @@ LLToast::~LLToast() void LLToast::hide() { setVisible(FALSE); - setTransparentState(false); + setFading(false); mTimer->stop(); mIsHidden = true; mOnFadeSignal(this); @@ -190,7 +193,7 @@ void LLToast::onFocusLost() if(mWrapperPanel && !isBackgroundVisible()) { // Lets make wrapper panel behave like a floater - setBackgroundOpaque(FALSE); + updateTransparency(); } } @@ -199,7 +202,7 @@ void LLToast::onFocusReceived() if(mWrapperPanel && !isBackgroundVisible()) { // Lets make wrapper panel behave like a floater - setBackgroundOpaque(TRUE); + updateTransparency(); } } @@ -244,22 +247,24 @@ void LLToast::expire() { if (mCanFade) { - if (mIsTransparent) + if (mIsFading) { + // Fade timer expired. Time to hide. hide(); } else { - setTransparentState(true); + // "Life" time has ended. Time to fade. + setFading(true); mTimer->restart(); } } } -void LLToast::setTransparentState(bool transparent) +void LLToast::setFading(bool transparent) { - setBackgroundOpaque(!transparent); - mIsTransparent = transparent; + mIsFading = transparent; + updateTransparency(); if (transparent) { @@ -275,7 +280,7 @@ F32 LLToast::getTimeLeftToLive() { F32 time_to_live = mTimer->getRemainingTimeF32(); - if (!mIsTransparent) + if (!mIsFading) { time_to_live += mToastFadingTime; } @@ -347,7 +352,6 @@ void LLToast::setVisible(BOOL show) if(show) { - setBackgroundOpaque(TRUE); if(!mTimer->getStarted() && mCanFade) { mTimer->start(); @@ -389,7 +393,7 @@ void LLToast::onToastMouseEnter() { mOnToastHoverSignal(this, MOUSE_ENTER); - setBackgroundOpaque(TRUE); + updateTransparency(); //toasts fading is management by Screen Channel @@ -418,6 +422,8 @@ void LLToast::onToastMouseLeave() { mOnToastHoverSignal(this, MOUSE_LEAVE); + updateTransparency(); + //toasts fading is management by Screen Channel if(mHideBtn && mHideBtn->getEnabled()) @@ -445,20 +451,45 @@ void LLToast::setBackgroundOpaque(BOOL b) } } -void LLNotificationsUI::LLToast::stopFading() +void LLToast::updateTransparency() +{ + ETypeTransparency transparency_type; + + if (mCanFade) + { + // Notification toasts (including IM/chat toasts) change their transparency on hover. + if (isHovered()) + { + transparency_type = TT_ACTIVE; + } + else + { + transparency_type = mIsFading ? TT_FADING : TT_INACTIVE; + } + } + else + { + // Transparency of alert toasts depends on focus. + transparency_type = hasFocus() ? TT_ACTIVE : TT_INACTIVE; + } + + LLFloater::updateTransparency(transparency_type); +} + +void LLNotificationsUI::LLToast::stopTimer() { if(mCanFade) { - setTransparentState(false); + setFading(false); mTimer->stop(); } } -void LLNotificationsUI::LLToast::startFading() +void LLNotificationsUI::LLToast::startTimer() { if(mCanFade) { - setTransparentState(false); + setFading(false); mTimer->start(); } } diff --git a/indra/newview/lltoast.h b/indra/newview/lltoast.h index d23e858c5c..242f786bf2 100644 --- a/indra/newview/lltoast.h +++ b/indra/newview/lltoast.h @@ -114,11 +114,11 @@ public: //Fading - /** Stop fading timer */ - virtual void stopFading(); + /** Stop lifetime/fading timer */ + virtual void stopTimer(); - /** Start fading timer */ - virtual void startFading(); + /** Start lifetime/fading timer */ + virtual void startTimer(); bool isHovered(); @@ -141,7 +141,7 @@ public: // virtual void setVisible(BOOL show); - virtual void setBackgroundOpaque(BOOL b); + /*virtual*/ void setBackgroundOpaque(BOOL b); // virtual void hide(); @@ -198,9 +198,8 @@ public: LLHandle<LLToast> getHandle() { mHandle.bind(this); return mHandle; } - bool getTransparentState() const { return mIsTransparent; } - virtual void setTransparentState(bool transparent); - +protected: + void updateTransparency(); private: @@ -210,6 +209,8 @@ private: void expire(); + void setFading(bool fading); + LLUUID mNotificationID; LLUUID mSessionID; LLNotificationPtr mNotification; @@ -234,7 +235,7 @@ private: bool mHideBtnPressed; bool mIsHidden; // this flag is TRUE when a toast has faded or was hidden with (x) button (EXT-1849) bool mIsTip; - bool mIsTransparent; + bool mIsFading; commit_signal_t mToastMouseEnterSignal; commit_signal_t mToastMouseLeaveSignal; diff --git a/indra/newview/skins/default/xui/en/floater_env_settings.xml b/indra/newview/skins/default/xui/en/floater_env_settings.xml index 14f9e2db95..8df5e232d9 100644 --- a/indra/newview/skins/default/xui/en/floater_env_settings.xml +++ b/indra/newview/skins/default/xui/en/floater_env_settings.xml @@ -44,6 +44,7 @@ left="85" name="EnvDayCycle" top="30" + use_draw_context_alpha="false" width="200" /> <slider control_name="EnvTimeSlider" diff --git a/indra/newview/skins/default/xui/en/panel_group_list_item.xml b/indra/newview/skins/default/xui/en/panel_group_list_item.xml index 0b84ac03c5..7d0b0890f0 100644 --- a/indra/newview/skins/default/xui/en/panel_group_list_item.xml +++ b/indra/newview/skins/default/xui/en/panel_group_list_item.xml @@ -34,6 +34,7 @@ mouse_opaque="true" left="5" top="2" + use_draw_context_alpha="false" width="20" /> <text parse_urls="false" diff --git a/indra/newview/skins/default/xui/en/widgets/group_icon.xml b/indra/newview/skins/default/xui/en/widgets/group_icon.xml index 58d5e19fcc..36ee6dd7eb 100644 --- a/indra/newview/skins/default/xui/en/widgets/group_icon.xml +++ b/indra/newview/skins/default/xui/en/widgets/group_icon.xml @@ -2,4 +2,5 @@ <group_icon default_icon_name="Generic_Group" image_name="Generic_Group" - name="group_icon" /> + name="group_icon" + use_draw_context_alpha="false" /> |