From 53c96ec24b70452ddd1947bb23ece84cc1c1004c Mon Sep 17 00:00:00 2001 From: Alexei Arabadji Date: Thu, 1 Apr 2010 17:48:07 +0300 Subject: EXT-2801 Record "object return" notification into IM history, not chat history, replaced toast timer LLTimer with LLEventTimer implementation that not depends on draw method; reviewed by Vadim Savchuk at https://codereview.productengine.com/secondlife/r/148/ --HG-- branch : product-engine --- indra/newview/lltoast.cpp | 59 +++++++++++++++-------------------------------- indra/newview/lltoast.h | 37 ++++++++++++++++++++--------- 2 files changed, 45 insertions(+), 51 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/lltoast.cpp b/indra/newview/lltoast.cpp index 60a89c02e4..60657d3fa7 100644 --- a/indra/newview/lltoast.cpp +++ b/indra/newview/lltoast.cpp @@ -41,6 +41,16 @@ using namespace LLNotificationsUI; +/*virtual*/ +BOOL LLToastLifeTimer::tick() +{ + if (mEventTimer.hasExpired()) + { + mToast->expire(); + } + return FALSE; +} + //-------------------------------------------------------------------------- LLToast::Params::Params() : can_fade("can_fade", true), @@ -57,7 +67,6 @@ LLToast::Params::Params() LLToast::LLToast(const LLToast::Params& p) : LLModalDialog(LLSD(), p.is_modal), mPanel(p.panel), - mToastLifetime(p.lifetime_secs), mToastFadingTime(p.fading_time_secs), mNotificationID(p.notif_id), mSessionID(p.session_id), @@ -71,6 +80,8 @@ LLToast::LLToast(const LLToast::Params& p) mIsTip(p.is_tip), mWrapperPanel(NULL) { + mTimer.reset(new LLToastLifeTimer(this, p.lifetime_secs)); + LLUICtrlFactory::getInstance()->buildFloater(this, "panel_toast.xml", NULL); setCanDrag(FALSE); @@ -105,7 +116,7 @@ BOOL LLToast::postBuild() { if(!mCanFade) { - mTimer.stop(); + mTimer->stop(); } if (mIsTip) @@ -144,39 +155,11 @@ LLToast::~LLToast() mOnToastDestroyedSignal(this); } -//-------------------------------------------------------------------------- -void LLToast::setAndStartTimer(F32 period) -{ - if(mCanFade) - { - mToastLifetime = period; - mTimer.start(); - } -} - -//-------------------------------------------------------------------------- -bool LLToast::lifetimeHasExpired() -{ - if (mTimer.getStarted()) - { - F32 elapsed_time = mTimer.getElapsedTimeF32(); - if ((mToastLifetime - elapsed_time) <= mToastFadingTime) - { - setBackgroundOpaque(FALSE); - } - if (elapsed_time > mToastLifetime) - { - return true; - } - } - return false; -} - //-------------------------------------------------------------------------- void LLToast::hide() { setVisible(FALSE); - mTimer.stop(); + mTimer->stop(); mIsHidden = true; mOnFadeSignal(this); } @@ -222,12 +205,13 @@ void LLToast::setCanFade(bool can_fade) { mCanFade = can_fade; if(!mCanFade) - mTimer.stop(); + mTimer->stop(); } //-------------------------------------------------------------------------- -void LLToast::tick() +void LLToast::expire() { + // if toast has fade property - hide it if(mCanFade) { hide(); @@ -263,11 +247,6 @@ void LLToast::insertPanel(LLPanel* panel) //-------------------------------------------------------------------------- void LLToast::draw() { - if(lifetimeHasExpired()) - { - tick(); - } - LLFloater::draw(); if(!isBackgroundVisible()) @@ -300,9 +279,9 @@ void LLToast::setVisible(BOOL show) if(show) { setBackgroundOpaque(TRUE); - if(!mTimer.getStarted() && mCanFade) + if(!mTimer->getStarted() && mCanFade) { - mTimer.start(); + mTimer->start(); } LLModalDialog::setFrontmost(FALSE); } diff --git a/indra/newview/lltoast.h b/indra/newview/lltoast.h index 64855020a9..20198a9398 100644 --- a/indra/newview/lltoast.h +++ b/indra/newview/lltoast.h @@ -36,7 +36,7 @@ #include "llpanel.h" #include "llmodaldialog.h" -#include "lltimer.h" +#include "lleventtimer.h" #include "llnotificationptr.h" #include "llviewercontrol.h" @@ -48,12 +48,32 @@ namespace LLNotificationsUI { +class LLToast; +/** + * Timer for toasts. + */ +class LLToastLifeTimer: public LLEventTimer +{ +public: + LLToastLifeTimer(LLToast* toast, F32 period) : mToast(toast), LLEventTimer(period){} + + /*virtual*/ + BOOL tick(); + void stop() { mEventTimer.stop(); } + void start() { mEventTimer.start(); } + void restart() {mEventTimer.reset(); } + BOOL getStarted() { return mEventTimer.getStarted(); } +private : + LLToast* mToast; +}; + /** * Represents toast pop-up. * This is a parent view for all toast panels. */ class LLToast : public LLModalDialog { + friend class LLToastLifeTimer; public: typedef boost::function toast_callback_t; typedef boost::signals2::signal toast_signal_t; @@ -107,12 +127,10 @@ public: LLPanel* getPanel() { return mPanel; } // enable/disable Toast's Hide button void setHideButtonEnabled(bool enabled); - // initialize and start Toast's timer - void setAndStartTimer(F32 period); // - void resetTimer() { mTimer.start(); } + void resetTimer() { mTimer->start(); } // - void stopTimer() { mTimer.stop(); } + void stopTimer() { mTimer->stop(); } // virtual void draw(); // @@ -176,10 +194,7 @@ private: void handleTipToastClick(S32 x, S32 y, MASK mask); - // check timer - bool lifetimeHasExpired(); - // on timer finished function - void tick(); + void expire(); LLUUID mNotificationID; LLUUID mSessionID; @@ -188,8 +203,8 @@ private: LLPanel* mWrapperPanel; // timer counts a lifetime of a toast - LLTimer mTimer; - F32 mToastLifetime; // in seconds + std::auto_ptr mTimer; + F32 mToastFadingTime; // in seconds LLPanel* mPanel; -- cgit v1.2.3 From 7b0dab508363e5da1ab180bdd0f8d63f1985105c Mon Sep 17 00:00:00 2001 From: Dmitry Zaporozhan Date: Thu, 1 Apr 2010 17:28:36 +0300 Subject: (work in progress) Update for LLAccordionCtrl arrange single expansion. Found this issue while working on EXT-6564(Fix wearable editing panels) - Every single_expansion accordion is treated like "fit_parent" is set to "true" after changes made in 9805 : e6c5f3b23be1 (fix for EXT-5128 Groups accordions should all appear on-screen w/out scrolling (open accordion should fill space)). Updated accordion to take into account "fit_parent" property. Reviewed by Vadim Savchuk - https://codereview.productengine.com/secondlife/r/147/ --HG-- branch : product-engine --- indra/newview/skins/default/xui/en/panel_group_info_sidetray.xml | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview') diff --git a/indra/newview/skins/default/xui/en/panel_group_info_sidetray.xml b/indra/newview/skins/default/xui/en/panel_group_info_sidetray.xml index 701a14e1c5..789d69bc68 100644 --- a/indra/newview/skins/default/xui/en/panel_group_info_sidetray.xml +++ b/indra/newview/skins/default/xui/en/panel_group_info_sidetray.xml @@ -98,6 +98,7 @@ background_visible="true" left="0" top="0" single_expansion="true" + fit_parent="true" follows="all" layout="topleft" name="groups_accordion"> -- cgit v1.2.3 From 3c036ef49b1e8690f5efe29393a4990e117e5bfe Mon Sep 17 00:00:00 2001 From: Dmitry Zaporozhan Date: Thu, 1 Apr 2010 17:41:47 +0300 Subject: (work in progress) EXT-6564(major) - Fix wearable editing panels Fixed Edit Shape panel layout: - fixed widget positioning according to spec - added gear button bar - fixed accordion positioning - fixed parameter list positioning TODO: - fix parameter panel positioning - apply changes to the rest of wearable panels Reviewed by Vadim Savchuk - https://codereview.productengine.com/secondlife/r/149/ --HG-- branch : product-engine --- indra/newview/llpaneleditwearable.cpp | 6 -- indra/newview/llsidepanelappearance.cpp | 2 + .../skins/default/xui/en/panel_edit_shape.xml | 86 ++++++++++++++++------ .../skins/default/xui/en/panel_edit_wearable.xml | 64 ++++++++++++++-- .../skins/default/xui/en/panel_scrolling_param.xml | 32 +++++++- .../skins/default/xui/en/sidepanel_appearance.xml | 2 +- 6 files changed, 155 insertions(+), 37 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llpaneleditwearable.cpp b/indra/newview/llpaneleditwearable.cpp index 805016f089..c0528da999 100644 --- a/indra/newview/llpaneleditwearable.cpp +++ b/indra/newview/llpaneleditwearable.cpp @@ -489,7 +489,6 @@ void LLPanelEditWearable::initializePanel() updateScrollingPanelUI(); } - } void LLPanelEditWearable::updateScrollingPanelUI() @@ -640,14 +639,9 @@ void LLPanelEditWearable::buildParamList(LLScrollingPanelList *panel_list, value { LLPanel::Params p; p.name("LLScrollingPanelParam"); - p.rect(LLRect(0, LLScrollingPanelParam::PARAM_PANEL_HEIGHT, LLScrollingPanelParam::PARAM_PANEL_WIDTH, 0 )); LLScrollingPanelParam* panel_param = new LLScrollingPanelParam( p, NULL, (*it).second, TRUE, this->getWearable()); height = panel_list->addPanel( panel_param ); } - - S32 width = tab->getRect().getWidth(); - - tab->reshape(width,height + tab->getHeaderHeight()+10,FALSE); } } diff --git a/indra/newview/llsidepanelappearance.cpp b/indra/newview/llsidepanelappearance.cpp index b951434010..a80687da4d 100644 --- a/indra/newview/llsidepanelappearance.cpp +++ b/indra/newview/llsidepanelappearance.cpp @@ -297,6 +297,8 @@ void LLSidepanelAppearance::toggleWearableEditPanel(BOOL visible, LLWearable *we return; } + mCurrOutfitPanel->setVisible(!visible); + mEditWearable->setVisible(visible); mEditWearable->setWearable(wearable); mFilterEditor->setVisible(!visible); diff --git a/indra/newview/skins/default/xui/en/panel_edit_shape.xml b/indra/newview/skins/default/xui/en/panel_edit_shape.xml index 45c4b92338..9a3b5c26ec 100644 --- a/indra/newview/skins/default/xui/en/panel_edit_shape.xml +++ b/indra/newview/skins/default/xui/en/panel_edit_shape.xml @@ -1,38 +1,43 @@ + width="333" > + top="0" + width="313" > + width="313"> Gender: + width="303" > + + top="0" + single_expansion="true" + fit_parent="false" + width="313"> @@ -73,11 +98,13 @@ - @@ -85,9 +112,11 @@ - - - - - - - + diff --git a/indra/newview/skins/default/xui/en/panel_edit_wearable.xml b/indra/newview/skins/default/xui/en/panel_edit_wearable.xml index f76a56bda4..b4272bb10a 100644 --- a/indra/newview/skins/default/xui/en/panel_edit_wearable.xml +++ b/indra/newview/skins/default/xui/en/panel_edit_wearable.xml @@ -150,7 +150,11 @@ left="0" value="Editing Shape" width="270" /> + +