From 9d3fc5d930bd1dae07771350080e5140c0113891 Mon Sep 17 00:00:00 2001 From: Paul ProductEngine Date: Thu, 29 Sep 2011 21:43:07 +0300 Subject: EXP-1209 FIXED Sidetray removed. - Removed all sidetray dependencies and the sidetray itself. - Also removed LLFloaterSidetrayTab and LLSidetrayListener as unused. --- indra/newview/llscreenchannel.cpp | 41 +++------------------------------------ 1 file changed, 3 insertions(+), 38 deletions(-) (limited to 'indra/newview/llscreenchannel.cpp') diff --git a/indra/newview/llscreenchannel.cpp b/indra/newview/llscreenchannel.cpp index e3bc67a414..a3b0574bca 100644 --- a/indra/newview/llscreenchannel.cpp +++ b/indra/newview/llscreenchannel.cpp @@ -41,7 +41,6 @@ #include "llsyswellwindow.h" #include "llimfloater.h" #include "llscriptfloater.h" -#include "llsidetray.h" #include @@ -83,25 +82,8 @@ bool LLScreenChannelBase::isHovering() return mHoveredToast->isHovered(); } -void LLScreenChannelBase::resetPositionAndSize() -{ - LLRect rc = gViewerWindow->getWorldViewRectScaled(); - updatePositionAndSize(rc, rc); -} - void LLScreenChannelBase::updatePositionAndSize(LLRect old_world_rect, LLRect new_world_rect) { - /* - take sidetray into account - screenchannel should not overlap sidetray - */ - S32 world_rect_padding = 0; - if (gSavedSettings.getBOOL("SidebarCameraMovement") == FALSE - && LLSideTray::instanceCreated ()) - { - world_rect_padding += LLSideTray::getInstance()->getVisibleWidth(); - } - - S32 top_delta = old_world_rect.mTop - new_world_rect.mTop; LLRect this_rect = getRect(); @@ -111,10 +93,10 @@ void LLScreenChannelBase::updatePositionAndSize(LLRect old_world_rect, LLRect ne case CA_LEFT : break; case CA_CENTRE : - this_rect.setCenterAndSize( (new_world_rect.getWidth() - world_rect_padding) / 2, new_world_rect.getHeight() / 2, this_rect.getWidth(), this_rect.getHeight()); + this_rect.setCenterAndSize( (new_world_rect.getWidth()) / 2, new_world_rect.getHeight() / 2, this_rect.getWidth(), this_rect.getHeight()); break; case CA_RIGHT : - this_rect.setLeftTopAndSize(new_world_rect.mRight - world_rect_padding - this_rect.getWidth(), + this_rect.setLeftTopAndSize(new_world_rect.mRight - this_rect.getWidth(), this_rect.mTop, this_rect.getWidth(), this_rect.getHeight()); @@ -126,12 +108,6 @@ void LLScreenChannelBase::updatePositionAndSize(LLRect old_world_rect, LLRect ne void LLScreenChannelBase::init(S32 channel_left, S32 channel_right) { - if(LLSideTray::instanceCreated()) - { - LLSideTray* side_bar = LLSideTray::getInstance(); - side_bar->setVisibleWidthChangeCallback(boost::bind(&LLScreenChannelBase::resetPositionAndSize, this)); - } - // top and bottom set by updateBottom() setRect(LLRect(channel_left, 0, channel_right, 0)); updateBottom(); @@ -203,17 +179,6 @@ std::list LLScreenChannel::findToasts(const Matcher& matcher) //-------------------------------------------------------------------------- void LLScreenChannel::updatePositionAndSize(LLRect old_world_rect, LLRect new_world_rect) { - /* - take sidetray into account - screenchannel should not overlap sidetray - */ - S32 world_rect_padding = 0; - if (gSavedSettings.getBOOL("SidebarCameraMovement") == FALSE - && LLSideTray::instanceCreated ()) - { - world_rect_padding += LLSideTray::getInstance()->getVisibleWidth(); - } - - LLRect this_rect = getRect(); switch(mChannelAlignment) @@ -226,7 +191,7 @@ void LLScreenChannel::updatePositionAndSize(LLRect old_world_rect, LLRect new_wo return; case CA_RIGHT : this_rect.mTop = (S32) (new_world_rect.getHeight() * getHeightRatio()); - this_rect.setLeftTopAndSize(new_world_rect.mRight - world_rect_padding - this_rect.getWidth(), + this_rect.setLeftTopAndSize(new_world_rect.mRight - this_rect.getWidth(), this_rect.mTop, this_rect.getWidth(), this_rect.getHeight()); -- cgit v1.3 From d3ef6289529aafda3675b811ccc3ab9058d54dfa Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 13 Oct 2011 19:16:54 -0700 Subject: EXP-1319 FIX Nearby chat toasts should not underlap toolbars --- indra/newview/llchannelmanager.cpp | 27 ++++------- indra/newview/llchannelmanager.h | 18 ++------ indra/newview/llnearbychathandler.cpp | 64 ++++++++++++-------------- indra/newview/llnotificationalerthandler.cpp | 4 +- indra/newview/llscreenchannel.cpp | 69 +++++++++++++++------------- indra/newview/llscreenchannel.h | 33 +++++++------ 6 files changed, 101 insertions(+), 114 deletions(-) (limited to 'indra/newview/llscreenchannel.cpp') diff --git a/indra/newview/llchannelmanager.cpp b/indra/newview/llchannelmanager.cpp index 4ab3d8dc98..59842aeb6c 100644 --- a/indra/newview/llchannelmanager.cpp +++ b/indra/newview/llchannelmanager.cpp @@ -68,7 +68,7 @@ LLChannelManager::~LLChannelManager() LLScreenChannel* LLChannelManager::createNotificationChannel() { // creating params for a channel - LLChannelManager::Params p; + LLScreenChannelBase::Params p; p.id = LLUUID(gSavedSettings.getString("NotificationChannelUUID")); p.channel_align = CA_RIGHT; @@ -106,7 +106,7 @@ void LLChannelManager::onLoginCompleted() else { // create a channel for the StartUp Toast - LLChannelManager::Params p; + LLScreenChannelBase::Params p; p.id = LLUUID(gSavedSettings.getString("StartUpChannelUUID")); p.channel_align = CA_RIGHT; mStartUpChannel = createChannel(p); @@ -164,26 +164,15 @@ LLScreenChannelBase* LLChannelManager::addChannel(LLScreenChannelBase* channel) return channel; } -LLScreenChannel* LLChannelManager::createChannel(LLChannelManager::Params& p) +LLScreenChannel* LLChannelManager::createChannel(LLScreenChannelBase::Params& p) { - LLScreenChannel* new_channel = new LLScreenChannel(p.id); + LLScreenChannel* new_channel = new LLScreenChannel(p); - if(!new_channel) - { - llerrs << "LLChannelManager::getChannel(LLChannelManager::Params& p) - can't create a channel!" << llendl; - } - else - { - new_channel->setToastAlignment(p.toast_align); - new_channel->setChannelAlignment(p.channel_align); - new_channel->setDisplayToastsAlways(p.display_toasts_always); - - addChannel(new_channel); - } + addChannel(new_channel); return new_channel; } -LLScreenChannelBase* LLChannelManager::getChannel(LLChannelManager::Params& p) +LLScreenChannelBase* LLChannelManager::getChannel(LLScreenChannelBase::Params& p) { LLScreenChannelBase* new_channel = findChannelByID(p.id); @@ -195,7 +184,7 @@ LLScreenChannelBase* LLChannelManager::getChannel(LLChannelManager::Params& p) } //-------------------------------------------------------------------------- -LLScreenChannelBase* LLChannelManager::findChannelByID(const LLUUID id) +LLScreenChannelBase* LLChannelManager::findChannelByID(const LLUUID& id) { std::vector::iterator it = find(mChannelList.begin(), mChannelList.end(), id); if(it != mChannelList.end()) @@ -207,7 +196,7 @@ LLScreenChannelBase* LLChannelManager::findChannelByID(const LLUUID id) } //-------------------------------------------------------------------------- -void LLChannelManager::removeChannelByID(const LLUUID id) +void LLChannelManager::removeChannelByID(const LLUUID& id) { std::vector::iterator it = find(mChannelList.begin(), mChannelList.end(), id); if(it != mChannelList.end()) diff --git a/indra/newview/llchannelmanager.h b/indra/newview/llchannelmanager.h index 1a0b98f6cf..671e545465 100644 --- a/indra/newview/llchannelmanager.h +++ b/indra/newview/llchannelmanager.h @@ -44,17 +44,7 @@ namespace LLNotificationsUI class LLChannelManager : public LLSingleton { public: - struct Params - { - LLUUID id; - bool display_toasts_always; - EToastAlignment toast_align; - EChannelAlignment channel_align; - Params() - : id(LLUUID("")), display_toasts_always(false), toast_align(NA_BOTTOM), channel_align(CA_LEFT) - {} - }; struct ChannelElem { @@ -84,18 +74,18 @@ public: void onStartUpToastClose(); // creates a new ScreenChannel according to the given parameters or returns existing if present - LLScreenChannelBase* getChannel(LLChannelManager::Params& p); + LLScreenChannelBase* getChannel(LLScreenChannelBase::Params& p); LLScreenChannelBase* addChannel(LLScreenChannelBase* channel); // returns a channel by its ID - LLScreenChannelBase* findChannelByID(const LLUUID id); + LLScreenChannelBase* findChannelByID(const LLUUID& id); // creator of the Notification channel, that is used in more than one handler LLScreenChannel* createNotificationChannel(); // remove channel methods - void removeChannelByID(const LLUUID id); + void removeChannelByID(const LLUUID& id); /** * Manages toasts showing for all channels. @@ -117,7 +107,7 @@ public: std::vector& getChannelList() { return mChannelList;} private: - LLScreenChannel* createChannel(LLChannelManager::Params& p); + LLScreenChannel* createChannel(LLScreenChannelBase::Params& p); LLScreenChannel* mStartUpChannel; std::vector mChannelList; diff --git a/indra/newview/llnearbychathandler.cpp b/indra/newview/llnearbychathandler.cpp index 7503164fe6..573985b76e 100644 --- a/indra/newview/llnearbychathandler.cpp +++ b/indra/newview/llnearbychathandler.cpp @@ -42,6 +42,8 @@ #include "llfloaterreg.h"//for LLFloaterReg::getTypedInstance #include "llviewerwindow.h"//for screen channel position #include "llnearbychatbar.h" +#include "llrootview.h" +#include "lllayoutstack.h" //add LLNearbyChatHandler to LLNotificationsUI namespace using namespace LLNotificationsUI; @@ -62,7 +64,7 @@ public: typedef std::vector > toast_vec_t; typedef std::list > toast_list_t; - LLNearbyChatScreenChannel(const LLUUID& id):LLScreenChannelBase(id) + LLNearbyChatScreenChannel(const Params& p):LLScreenChannelBase(p) { mStopProcessing = false; @@ -81,7 +83,6 @@ public: void addNotification (LLSD& notification); void arrangeToasts (); - void showToastsBottom (); typedef boost::function create_toast_panel_callback_t; void setCreatePanelCallback(create_toast_panel_callback_t value) { m_create_toast_panel_callback_t = value;} @@ -150,6 +151,7 @@ protected: toast_list_t m_toast_pool; bool mStopProcessing; + bool mChannelRect; }; //----------------------------------------------------------------------------------------------- @@ -352,27 +354,6 @@ void LLNearbyChatScreenChannel::addNotification(LLSD& notification) arrangeToasts(); } -void LLNearbyChatScreenChannel::arrangeToasts() -{ - if(!isHovering()) - { - showToastsBottom(); - } - - if (m_active_toasts.empty()) - { - LLHints::registerHintTarget("incoming_chat", LLHandle()); - } - else - { - LLToast* toast = m_active_toasts.front().get(); - if (toast) - { - LLHints::registerHintTarget("incoming_chat", m_active_toasts.front().get()->LLView::getHandle()); - } - } -} - static bool sort_toasts_predicate(LLHandle first, LLHandle second) { if (!first.get() || !second.get()) return false; // STORM-1352 @@ -382,14 +363,30 @@ static bool sort_toasts_predicate(LLHandle first, LLHandle sec return v1 > v2; } -void LLNearbyChatScreenChannel::showToastsBottom() +void LLNearbyChatScreenChannel::arrangeToasts() { - if(mStopProcessing) + if(mStopProcessing || isHovering()) + return; + LLLayoutStack::updateClass(); + LLView* floater_snap_region = gViewerWindow->getRootView()->getChildView("floater_snap_region"); + + if (!getParent()) + { + // connect to floater snap region to get resize events + floater_snap_region->addChild(this); + setFollows(FOLLOWS_ALL); + } + LLRect toast_rect; updateBottom(); - S32 channel_bottom = getRect().mBottom; + + LLRect channel_rect; + floater_snap_region->localRectToOtherView(floater_snap_region->getLocalRect(), &channel_rect, gFloaterView); + channel_rect.mRight = channel_rect.mLeft + 300; + + S32 channel_bottom = channel_rect.mBottom; S32 bottom = channel_bottom; S32 margin = gSavedSettings.getS32("ToastGap"); @@ -410,7 +407,7 @@ void LLNearbyChatScreenChannel::showToastsBottom() S32 toast_top = bottom + toast->getRect().getHeight() + margin; - if(toast_top > gFloaterView->getRect().getHeight()) + if(toast_top > channel_rect.getHeight()) { while(it!=m_active_toasts.end()) { @@ -421,7 +418,7 @@ void LLNearbyChatScreenChannel::showToastsBottom() } toast_rect = toast->getRect(); - toast_rect.setLeftTopAndSize(getRect().mLeft , bottom + toast_rect.getHeight(), toast_rect.getWidth() ,toast_rect.getHeight()); + toast_rect.setLeftTopAndSize(channel_rect.mLeft , bottom + toast_rect.getHeight(), toast_rect.getWidth() ,toast_rect.getHeight()); toast->setRect(toast_rect); bottom += toast_rect.getHeight() - toast->getTopPad() + margin; @@ -458,7 +455,9 @@ LLNearbyChatHandler::LLNearbyChatHandler(e_notification_type type, const LLSD& i mType = type; // Getting a Channel for our notifications - LLNearbyChatScreenChannel* channel = new LLNearbyChatScreenChannel(LLUUID(gSavedSettings.getString("NearByChatChannelUUID"))); + LLNearbyChatScreenChannel::Params p; + p.id = LLUUID(gSavedSettings.getString("NearByChatChannelUUID")); + LLNearbyChatScreenChannel* channel = new LLNearbyChatScreenChannel(p); LLNearbyChatScreenChannel::create_toast_panel_callback_t callback = createToastPanel; @@ -474,11 +473,8 @@ LLNearbyChatHandler::~LLNearbyChatHandler() void LLNearbyChatHandler::initChannel() { - LLNearbyChatBar* chat_bar = LLFloaterReg::getTypedInstance("chat_bar", LLSD()); - LLView* chat_box = chat_bar->getChatBox(); - LLNearbyChat* nearby_chat = LLNearbyChat::getInstance(); - S32 channel_right_bound = nearby_chat->getRect().mRight; - mChannel->init(chat_box->getRect().mLeft, channel_right_bound); + //LLRect snap_rect = gFloaterView->getSnapRect(); + //mChannel->init(snap_rect.mLeft, snap_rect.mLeft + 200); } diff --git a/indra/newview/llnotificationalerthandler.cpp b/indra/newview/llnotificationalerthandler.cpp index 9d824dcd59..cae7d02fed 100644 --- a/indra/newview/llnotificationalerthandler.cpp +++ b/indra/newview/llnotificationalerthandler.cpp @@ -44,7 +44,7 @@ LLAlertHandler::LLAlertHandler(e_notification_type type, const LLSD& id) : mIsMo { mType = type; - LLChannelManager::Params p; + LLScreenChannelBase::Params p; p.id = LLUUID(gSavedSettings.getString("AlertChannelUUID")); p.display_toasts_always = true; p.toast_align = NA_CENTRE; @@ -114,7 +114,7 @@ bool LLAlertHandler::processNotification(const LLSD& notify) // Show alert in middle of progress view (during teleport) (EXT-1093) LLProgressView* progress = gViewerWindow->getProgressView(); LLRect rc = progress && progress->getVisible() ? progress->getRect() : gViewerWindow->getWorldViewRectScaled(); - mChannel->updatePositionAndSize(rc, rc); + mChannel->updatePositionAndSize(rc); LLScreenChannel* channel = dynamic_cast(mChannel); if(channel) diff --git a/indra/newview/llscreenchannel.cpp b/indra/newview/llscreenchannel.cpp index a3b0574bca..71b6c18d8f 100644 --- a/indra/newview/llscreenchannel.cpp +++ b/indra/newview/llscreenchannel.cpp @@ -48,29 +48,38 @@ using namespace LLNotificationsUI; bool LLScreenChannel::mWasStartUpToastShown = false; + +LLRect get_channel_rect() +{ + LLRect channel_rect; + LLView* floater_snap_region = LLUI::getRootView()->getChildView("floater_snap_region"); + floater_snap_region->localRectToScreen(floater_snap_region->getLocalRect(), &channel_rect); + return channel_rect; +} + + //-------------------------------------------------------------------------- ////////////////////// // LLScreenChannelBase ////////////////////// -LLScreenChannelBase::LLScreenChannelBase(const LLUUID& id) : - mToastAlignment(NA_BOTTOM) - ,mCanStoreToasts(true) - ,mHiddenToastsNum(0) - ,mHoveredToast(NULL) - ,mControlHovering(false) - ,mShowToasts(true) +LLScreenChannelBase::LLScreenChannelBase(const Params& p) +: LLUICtrl(p), + mToastAlignment(p.toast_align), + mCanStoreToasts(true), + mHiddenToastsNum(0), + mHoveredToast(NULL), + mControlHovering(false), + mShowToasts(true), + mID(p.id), + mDisplayToastsAlways(p.display_toasts_always), + mChannelAlignment(p.channel_align) { - mID = id; - mWorldViewRectConnection = gViewerWindow->setOnWorldViewRectUpdated(boost::bind(&LLScreenChannelBase::updatePositionAndSize, this, _1, _2)); + mID = p.id; setMouseOpaque( false ); setVisible(FALSE); } -LLScreenChannelBase::~LLScreenChannelBase() -{ - mWorldViewRectConnection.disconnect(); -} bool LLScreenChannelBase::isHovering() { @@ -82,21 +91,20 @@ bool LLScreenChannelBase::isHovering() return mHoveredToast->isHovered(); } -void LLScreenChannelBase::updatePositionAndSize(LLRect old_world_rect, LLRect new_world_rect) +void LLScreenChannelBase::updatePositionAndSize(LLRect rect) { - S32 top_delta = old_world_rect.mTop - new_world_rect.mTop; LLRect this_rect = getRect(); - this_rect.mTop -= top_delta; + this_rect.mTop = rect.mTop; switch(mChannelAlignment) { case CA_LEFT : break; case CA_CENTRE : - this_rect.setCenterAndSize( (new_world_rect.getWidth()) / 2, new_world_rect.getHeight() / 2, this_rect.getWidth(), this_rect.getHeight()); + this_rect.setCenterAndSize( (rect.getWidth()) / 2, rect.getHeight() / 2, this_rect.getWidth(), this_rect.getHeight()); break; case CA_RIGHT : - this_rect.setLeftTopAndSize(new_world_rect.mRight - this_rect.getWidth(), + this_rect.setLeftTopAndSize(rect.mRight - this_rect.getWidth(), this_rect.mTop, this_rect.getWidth(), this_rect.getHeight()); @@ -116,31 +124,30 @@ void LLScreenChannelBase::init(S32 channel_left, S32 channel_right) void LLScreenChannelBase::updateBottom() { - S32 channel_top = gViewerWindow->getWorldViewRectScaled().getHeight(); - S32 channel_bottom = gSavedSettings.getS32("ChannelBottomPanelMargin"); + S32 channel_top = get_channel_rect().mTop; + S32 channel_bottom = get_channel_rect().mBottom + gSavedSettings.getS32("ChannelBottomPanelMargin"); S32 channel_left = getRect().mLeft; S32 channel_right = getRect().mRight; setRect(LLRect(channel_left, channel_top, channel_right, channel_bottom)); } - //-------------------------------------------------------------------------- ////////////////////// // LLScreenChannel ////////////////////// //-------------------------------------------------------------------------- -LLScreenChannel::LLScreenChannel(LLUUID& id): -LLScreenChannelBase(id) -,mStartUpToastPanel(NULL) -{ +LLScreenChannel::LLScreenChannel(const Params& p) +: LLScreenChannelBase(p), + mStartUpToastPanel(NULL) +{ } //-------------------------------------------------------------------------- void LLScreenChannel::init(S32 channel_left, S32 channel_right) { LLScreenChannelBase::init(channel_left, channel_right); - LLRect world_rect = gViewerWindow->getWorldViewRectScaled(); - updatePositionAndSize(world_rect, world_rect); + LLRect channel_rect = get_channel_rect(); + updatePositionAndSize(channel_rect); } //-------------------------------------------------------------------------- @@ -177,7 +184,7 @@ std::list LLScreenChannel::findToasts(const Matcher& matcher) } //-------------------------------------------------------------------------- -void LLScreenChannel::updatePositionAndSize(LLRect old_world_rect, LLRect new_world_rect) +void LLScreenChannel::updatePositionAndSize(LLRect new_world_rect) { LLRect this_rect = getRect(); @@ -187,7 +194,7 @@ void LLScreenChannel::updatePositionAndSize(LLRect old_world_rect, LLRect new_wo this_rect.mTop = (S32) (new_world_rect.getHeight() * getHeightRatio()); break; case CA_CENTRE : - LLScreenChannelBase::updatePositionAndSize(old_world_rect, new_world_rect); + LLScreenChannelBase::updatePositionAndSize(new_world_rect); return; case CA_RIGHT : this_rect.mTop = (S32) (new_world_rect.getHeight() * getHeightRatio()); @@ -511,9 +518,9 @@ void LLScreenChannel::showToastsBottom() (*it).toast->translate(0, shift); } - LLRect world_rect = gViewerWindow->getWorldViewRectScaled(); + LLRect channel_rect = get_channel_rect(); // don't show toasts if there is not enough space - if(toast_rect.mTop > world_rect.mTop) + if(toast_rect.mTop > channel_rect.mTop) { break; } diff --git a/indra/newview/llscreenchannel.h b/indra/newview/llscreenchannel.h index 8f11c82673..4d8e3e9e93 100644 --- a/indra/newview/llscreenchannel.h +++ b/indra/newview/llscreenchannel.h @@ -53,21 +53,30 @@ class LLScreenChannelBase : public LLUICtrl { friend class LLChannelManager; public: - LLScreenChannelBase(const LLUUID& id); - ~LLScreenChannelBase(); + struct Params : public LLInitParam::Block + { + Mandatory id; + Optional display_toasts_always; + Optional toast_align; + Optional channel_align; + + Params() + : id("id", LLUUID("")), + display_toasts_always("display_toasts_always", false), + toast_align("toast_align", NA_BOTTOM), + channel_align("channel_align", CA_LEFT) + {} + }; + + LLScreenChannelBase(const Params&); // Channel's outfit-functions // update channel's size and position in the World View - virtual void updatePositionAndSize(LLRect old_world_rect, LLRect new_world_rect); + virtual void updatePositionAndSize(LLRect rect); // initialization of channel's shape and position virtual void init(S32 channel_left, S32 channel_right); - - virtual void setToastAlignment(EToastAlignment align) {mToastAlignment = align;} - - virtual void setChannelAlignment(EChannelAlignment align) {mChannelAlignment = align;} - // kill or modify a toast by its ID virtual void killToastByNotificationID(LLUUID id) {}; virtual void modifyToastNotificationByID(LLUUID id, LLSD data) {}; @@ -90,7 +99,6 @@ public: void setCanStoreToasts(bool store) { mCanStoreToasts = store; } - void setDisplayToastsAlways(bool display_toasts) { mDisplayToastsAlways = display_toasts; } bool getDisplayToastsAlways() { return mDisplayToastsAlways; } // get number of hidden notifications from a channel @@ -124,9 +132,6 @@ protected: // channel's ID LLUUID mID; - - // store a connection to prevent futher crash that is caused by sending a signal to a destroyed channel - boost::signals2::connection mWorldViewRectConnection; }; @@ -137,7 +142,7 @@ class LLScreenChannel : public LLScreenChannelBase { friend class LLChannelManager; public: - LLScreenChannel(LLUUID& id); + LLScreenChannel(const Params&); virtual ~LLScreenChannel(); class Matcher @@ -152,7 +157,7 @@ public: // Channel's outfit-functions // update channel's size and position in the World View - void updatePositionAndSize(LLRect old_world_rect, LLRect new_world_rect); + void updatePositionAndSize(LLRect new_rect); // initialization of channel's shape and position void init(S32 channel_left, S32 channel_right); -- cgit v1.3 From 0976964f8315aab5879678f07318267b6887ed95 Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Fri, 14 Oct 2011 18:25:30 -0700 Subject: EXP-1336 FIX Move Notifications to upper right also made toolbar buttons not trigger if enabled callback returns false --- indra/llui/lltoolbar.cpp | 14 +++- indra/llui/lltoolbar.h | 4 +- indra/newview/llchannelmanager.cpp | 1 + indra/newview/llnearbychathandler.cpp | 11 +-- indra/newview/llscreenchannel.cpp | 136 +++++++++++++++++++++++++++++++--- indra/newview/llscreenchannel.h | 5 +- 6 files changed, 144 insertions(+), 27 deletions(-) (limited to 'indra/newview/llscreenchannel.cpp') diff --git a/indra/llui/lltoolbar.cpp b/indra/llui/lltoolbar.cpp index 7fcd1da7b1..bd2b55c105 100644 --- a/indra/llui/lltoolbar.cpp +++ b/indra/llui/lltoolbar.cpp @@ -668,6 +668,7 @@ void LLToolBar::draw() if (command && btn->mIsEnabledSignal) { const bool button_command_enabled = (*btn->mIsEnabledSignal)(btn, command->isEnabledParameters()); + // TODO: make button appear disabled but have it still respond to drag and drop btn->setEnabled(button_command_enabled); } @@ -941,6 +942,16 @@ void LLToolBarButton::onMouseCaptureLost() mIsDragged = false; } +void LLToolBarButton::onCommit() +{ + LLCommand* command = LLCommandManager::instance().getCommand(mId); + + if (!mIsEnabledSignal || (*mIsEnabledSignal)(this, command->isEnabledParameters())) + { + LLButton::onCommit(); + } +} + void LLToolBarButton::reshape(S32 width, S32 height, BOOL called_from_parent) { LLButton::reshape(mWidthRange.clamp(width), height, called_from_parent); @@ -967,6 +978,3 @@ const std::string LLToolBarButton::getToolTip() const - - - diff --git a/indra/llui/lltoolbar.h b/indra/llui/lltoolbar.h index 3be252298d..5fac613f50 100644 --- a/indra/llui/lltoolbar.h +++ b/indra/llui/lltoolbar.h @@ -72,9 +72,9 @@ public: void onMouseEnter(S32 x, S32 y, MASK mask); void onMouseCaptureLost(); - virtual const std::string getToolTip() const; - + void onCommit(); + virtual const std::string getToolTip() const; private: LLCommandId mId; diff --git a/indra/newview/llchannelmanager.cpp b/indra/newview/llchannelmanager.cpp index ca635eaa8f..987651fc80 100644 --- a/indra/newview/llchannelmanager.cpp +++ b/indra/newview/llchannelmanager.cpp @@ -74,6 +74,7 @@ LLScreenChannel* LLChannelManager::createNotificationChannel() LLScreenChannelBase::Params p; p.id = LLUUID(gSavedSettings.getString("NotificationChannelUUID")); p.channel_align = CA_RIGHT; + p.toast_align = NA_TOP; // Getting a Channel for our notifications return dynamic_cast (LLChannelManager::getInstance()->getChannel(p)); diff --git a/indra/newview/llnearbychathandler.cpp b/indra/newview/llnearbychathandler.cpp index 3faf190618..1ba1d2f0f0 100644 --- a/indra/newview/llnearbychathandler.cpp +++ b/indra/newview/llnearbychathandler.cpp @@ -89,8 +89,6 @@ public: void onToastDestroyed (LLToast* toast, bool app_quitting); void onToastFade (LLToast* toast); - void reshape (S32 width, S32 height, BOOL called_from_parent); - void redrawToasts() { arrangeToasts(); @@ -379,7 +377,7 @@ void LLNearbyChatScreenChannel::arrangeToasts() } LLRect toast_rect; - updateBottom(); + updateRect(); LLRect channel_rect; floater_snap_region->localRectToOtherView(floater_snap_region->getLocalRect(), &channel_rect, gFloaterView); @@ -436,15 +434,10 @@ void LLNearbyChatScreenChannel::arrangeToasts() } } - } - -void LLNearbyChatScreenChannel::reshape (S32 width, S32 height, BOOL called_from_parent) -{ - LLScreenChannelBase::reshape(width, height, called_from_parent); - arrangeToasts(); } + //----------------------------------------------------------------------------------------------- //LLNearbyChatHandler //----------------------------------------------------------------------------------------------- diff --git a/indra/newview/llscreenchannel.cpp b/indra/newview/llscreenchannel.cpp index 71b6c18d8f..45cf81751b 100644 --- a/indra/newview/llscreenchannel.cpp +++ b/indra/newview/llscreenchannel.cpp @@ -41,6 +41,7 @@ #include "llsyswellwindow.h" #include "llimfloater.h" #include "llscriptfloater.h" +#include "llrootview.h" #include @@ -48,12 +49,19 @@ using namespace LLNotificationsUI; bool LLScreenChannel::mWasStartUpToastShown = false; - -LLRect get_channel_rect() +LLFastTimer::DeclareTimer FTM_GET_CHANNEL_RECT("Calculate Notification Channel Region"); +LLRect LLScreenChannelBase::getChannelRect() { + LLFastTimer _(FTM_GET_CHANNEL_RECT); LLRect channel_rect; - LLView* floater_snap_region = LLUI::getRootView()->getChildView("floater_snap_region"); + LLRect chiclet_rect; + LLView* floater_snap_region = gViewerWindow->getRootView()->getChildView("floater_snap_region"); floater_snap_region->localRectToScreen(floater_snap_region->getLocalRect(), &channel_rect); + + LLView* chiclet_region = gViewerWindow->getRootView()->getChildView("chiclet_container"); + chiclet_region->localRectToScreen(chiclet_region->getLocalRect(), &chiclet_rect); + + channel_rect.mTop = chiclet_rect.mBottom; return channel_rect; } @@ -81,6 +89,11 @@ LLScreenChannelBase::LLScreenChannelBase(const Params& p) setVisible(FALSE); } +void LLScreenChannelBase::reshape(S32 width, S32 height, BOOL called_from_parent) +{ + redrawToasts(); +} + bool LLScreenChannelBase::isHovering() { if (!mHoveredToast) @@ -116,16 +129,16 @@ void LLScreenChannelBase::updatePositionAndSize(LLRect rect) void LLScreenChannelBase::init(S32 channel_left, S32 channel_right) { - // top and bottom set by updateBottom() + // top and bottom set by updateRect() setRect(LLRect(channel_left, 0, channel_right, 0)); - updateBottom(); + updateRect(); setVisible(TRUE); } -void LLScreenChannelBase::updateBottom() +void LLScreenChannelBase::updateRect() { - S32 channel_top = get_channel_rect().mTop; - S32 channel_bottom = get_channel_rect().mBottom + gSavedSettings.getS32("ChannelBottomPanelMargin"); + S32 channel_top = getChannelRect().mTop; + S32 channel_bottom = getChannelRect().mBottom + gSavedSettings.getS32("ChannelBottomPanelMargin"); S32 channel_left = getRect().mLeft; S32 channel_right = getRect().mRight; setRect(LLRect(channel_left, channel_top, channel_right, channel_bottom)); @@ -146,7 +159,7 @@ LLScreenChannel::LLScreenChannel(const Params& p) void LLScreenChannel::init(S32 channel_left, S32 channel_right) { LLScreenChannelBase::init(channel_left, channel_right); - LLRect channel_rect = get_channel_rect(); + LLRect channel_rect = getChannelRect(); updatePositionAndSize(channel_rect); } @@ -460,6 +473,15 @@ void LLScreenChannel::modifyToastByNotificationID(LLUUID id, LLPanel* panel) //-------------------------------------------------------------------------- void LLScreenChannel::redrawToasts() { + LLView* floater_snap_region = gViewerWindow->getRootView()->getChildView("floater_snap_region"); + + if (!getParent()) + { + // connect to floater snap region just to get resize events, we don't care about being a proper widget + floater_snap_region->addChild(this); + setFollows(FOLLOWS_ALL); + } + if(mToastList.size() == 0) return; @@ -486,7 +508,7 @@ void LLScreenChannel::showToastsBottom() S32 toast_margin = 0; std::vector::reverse_iterator it; - updateBottom(); + updateRect(); LLDockableFloater* floater = dynamic_cast(LLDockableFloater::getInstanceHandle().get()); @@ -518,7 +540,7 @@ void LLScreenChannel::showToastsBottom() (*it).toast->translate(0, shift); } - LLRect channel_rect = get_channel_rect(); + LLRect channel_rect = getChannelRect(); // don't show toasts if there is not enough space if(toast_rect.mTop > channel_rect.mTop) { @@ -591,6 +613,96 @@ void LLScreenChannel::showToastsCentre() //-------------------------------------------------------------------------- void LLScreenChannel::showToastsTop() { + LLRect channel_rect = getChannelRect(); + + LLRect toast_rect; + S32 top = channel_rect.mTop; + S32 toast_margin = 0; + std::vector::reverse_iterator it; + + updateRect(); + + LLDockableFloater* floater = dynamic_cast(LLDockableFloater::getInstanceHandle().get()); + + for(it = mToastList.rbegin(); it != mToastList.rend(); ++it) + { + if(it != mToastList.rbegin()) + { + LLToast* toast = (*(it-1)).toast; + top = toast->getRect().mBottom - toast->getTopPad(); + toast_margin = gSavedSettings.getS32("ToastGap"); + } + + toast_rect = (*it).toast->getRect(); + toast_rect.setLeftTopAndSize(channel_rect.mRight - toast_rect.getWidth(), + top, toast_rect.getWidth(), + toast_rect.getHeight()); + (*it).toast->setRect(toast_rect); + + if(floater && floater->overlapsScreenChannel()) + { + if(it == mToastList.rbegin()) + { + // move first toast above docked floater + S32 shift = -floater->getRect().getHeight(); + if(floater->getDockControl()) + { + shift -= floater->getDockControl()->getTongueHeight(); + } + (*it).toast->translate(0, shift); + } + + LLRect channel_rect = getChannelRect(); + // don't show toasts if there is not enough space + if(toast_rect.mBottom < channel_rect.mBottom) + { + break; + } + } + + bool stop_showing_toasts = (*it).toast->getRect().mBottom < channel_rect.mBottom; + + if(!stop_showing_toasts) + { + if( it != mToastList.rend()-1) + { + S32 toast_bottom = (*it).toast->getRect().mBottom - gSavedSettings.getS32("ToastGap"); + stop_showing_toasts = toast_bottom < channel_rect.mBottom; + } + } + + // at least one toast should be visible + if(it == mToastList.rbegin()) + { + stop_showing_toasts = false; + } + + if(stop_showing_toasts) + break; + + if( !(*it).toast->getVisible() ) + { + // HACK + // EXT-2653: it is necessary to prevent overlapping for secondary showed toasts + (*it).toast->setVisible(TRUE); + } + if(!(*it).toast->hasFocus()) + { + // Fixing Z-order of toasts (EXT-4862) + // Next toast will be positioned under this one. + gFloaterView->sendChildToBack((*it).toast); + } + } + + // Dismiss toasts we don't have space for (STORM-391). + if(it != mToastList.rend()) + { + mHiddenToastsNum = 0; + for(; it != mToastList.rend(); it++) + { + (*it).toast->hide(); + } + } } //-------------------------------------------------------------------------- @@ -820,7 +932,7 @@ void LLScreenChannel::updateShowToastsState() return; } - updateBottom(); + updateRect(); } //-------------------------------------------------------------------------- diff --git a/indra/newview/llscreenchannel.h b/indra/newview/llscreenchannel.h index f4f52eea19..2f23552828 100644 --- a/indra/newview/llscreenchannel.h +++ b/indra/newview/llscreenchannel.h @@ -70,6 +70,8 @@ public: LLScreenChannelBase(const Params&); + void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); + // Channel's outfit-functions // update channel's size and position in the World View virtual void updatePositionAndSize(LLRect rect); @@ -116,7 +118,8 @@ public: LLHandle getHandle() { mRootHandle.bind(this); return mRootHandle; } protected: - void updateBottom(); + void updateRect(); + LLRect getChannelRect(); // Channel's flags bool mControlHovering; -- cgit v1.3 From ad4ae99c30f1293bf8266c1f53ae62161bcb68bb Mon Sep 17 00:00:00 2001 From: Paul ProductEngine Date: Thu, 27 Oct 2011 16:34:45 +0200 Subject: EXP-1389 FIXED ("New notifications while offline" notification shown in lower right corner of FUI viewer) - Moved startup toast to the top of the LLScreenChannel --- indra/newview/llscreenchannel.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'indra/newview/llscreenchannel.cpp') diff --git a/indra/newview/llscreenchannel.cpp b/indra/newview/llscreenchannel.cpp index 45cf81751b..15ba5195d9 100644 --- a/indra/newview/llscreenchannel.cpp +++ b/indra/newview/llscreenchannel.cpp @@ -708,6 +708,8 @@ void LLScreenChannel::showToastsTop() //-------------------------------------------------------------------------- void LLScreenChannel::createStartUpToast(S32 notif_num, F32 timer) { + LLScreenChannelBase::updateRect(); + LLRect toast_rect; LLToast::Params p; p.lifetime_secs = timer; @@ -730,13 +732,10 @@ void LLScreenChannel::createStartUpToast(S32 notif_num, F32 timer) text_box->setValue(text); text_box->setVisible(TRUE); - S32 old_height = text_box->getRect().getHeight(); text_box->reshapeToFitText(); text_box->setOrigin(text_box->getRect().mLeft, (wrapper_panel->getRect().getHeight() - text_box->getRect().getHeight())/2); - S32 new_height = text_box->getRect().getHeight(); - S32 height_delta = new_height - old_height; - toast_rect.setLeftTopAndSize(0, toast_rect.getHeight() + height_delta +gSavedSettings.getS32("ToastGap"), getRect().getWidth(), toast_rect.getHeight()); + toast_rect.setLeftTopAndSize(0, getRect().getHeight() - gSavedSettings.getS32("ToastGap"), getRect().getWidth(), toast_rect.getHeight()); mStartUpToastPanel->setRect(toast_rect); addChild(mStartUpToastPanel); -- cgit v1.3 From 943789b53ac3f2750cb71dca6facc0de7fa39539 Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Wed, 23 Nov 2011 12:11:53 -0800 Subject: SH-2710 FIX -- Removed calls to getChild happening every frame and during idle calls. Reviewed by davep. --- indra/llui/llscrolllistctrl.cpp | 8 +- indra/llui/llscrolllistctrl.h | 2 + indra/newview/lldebugview.cpp | 39 +++++---- indra/newview/lldebugview.h | 6 +- indra/newview/llfloaterwebcontent.cpp | 40 ++++++--- indra/newview/llfloaterwebcontent.h | 6 ++ indra/newview/llnearbychatbar.cpp | 17 ++-- indra/newview/llnearbychatbar.h | 7 +- indra/newview/llnearbychathandler.cpp | 11 ++- indra/newview/llscreenchannel.cpp | 42 +++++++-- indra/newview/llscreenchannel.h | 7 +- indra/newview/llsidepaneltaskinfo.cpp | 159 +++++++++++++++++++++------------- indra/newview/llsidepaneltaskinfo.h | 40 ++++++++- indra/newview/llstatusbar.cpp | 5 +- indra/newview/llstatusbar.h | 3 +- 15 files changed, 272 insertions(+), 120 deletions(-) (limited to 'indra/newview/llscreenchannel.cpp') diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp index 622f3e215c..466fac33ea 100644 --- a/indra/llui/llscrolllistctrl.cpp +++ b/indra/llui/llscrolllistctrl.cpp @@ -175,6 +175,7 @@ LLScrollListCtrl::LLScrollListCtrl(const LLScrollListCtrl::Params& p) mBorder(NULL), mSortCallback(NULL), mPopupMenu(NULL), + mCommentTextView(NULL), mNumDynamicWidthColumns(0), mTotalStaticColumnWidth(0), mTotalColumnPadding(0), @@ -476,7 +477,12 @@ void LLScrollListCtrl::updateLayout() getRect().getWidth() - 2 * mBorderThickness, getRect().getHeight() - (2 * mBorderThickness ) - heading_size ); - getChildView("comment_text")->setShape(mItemListRect); + if (mCommentTextView == NULL) + { + mCommentTextView = getChildView("comment_text"); + } + + mCommentTextView->setShape(mItemListRect); // how many lines of content in a single "page" S32 page_lines = getLinesPerPage(); diff --git a/indra/llui/llscrolllistctrl.h b/indra/llui/llscrolllistctrl.h index 09ab89960d..ae8aea9245 100644 --- a/indra/llui/llscrolllistctrl.h +++ b/indra/llui/llscrolllistctrl.h @@ -480,6 +480,8 @@ private: S32 mHighlightedItem; class LLViewBorder* mBorder; LLContextMenu *mPopupMenu; + + LLView *mCommentTextView; LLWString mSearchString; LLFrameTimer mSearchTimer; diff --git a/indra/newview/lldebugview.cpp b/indra/newview/lldebugview.cpp index ba511a3693..92ac336d0d 100644 --- a/indra/newview/lldebugview.cpp +++ b/indra/newview/lldebugview.cpp @@ -55,9 +55,30 @@ LLDebugView* gDebugView = NULL; static LLDefaultChildRegistry::Register r("debug_view"); LLDebugView::LLDebugView(const LLDebugView::Params& p) -: LLView(p) +: LLView(p), + mFastTimerView(NULL), + mMemoryView(NULL), + mDebugConsolep(NULL), + mFloaterSnapRegion(NULL) {} +LLDebugView::~LLDebugView() +{ + // These have already been deleted. Fix the globals appropriately. + gDebugView = NULL; + gTextureView = NULL; + gSceneView = NULL; + gTextureSizeView = NULL; + gTextureCategoryView = NULL; +} + +BOOL LLDebugView::postBuild() +{ + mFloaterSnapRegion = getRootView()->getChildView("floater_snap_region"); + + return TRUE; +} + void LLDebugView::init() { LLRect r; @@ -109,8 +130,6 @@ void LLDebugView::init() addChild(gTextureView); //gTextureView->reshape(r.getWidth(), r.getHeight(), TRUE); - - if(gAuditTexture) { @@ -136,22 +155,10 @@ void LLDebugView::init() } } - -LLDebugView::~LLDebugView() -{ - // These have already been deleted. Fix the globals appropriately. - gDebugView = NULL; - gTextureView = NULL; - gSceneView = NULL; - gTextureSizeView = NULL; - gTextureCategoryView = NULL; -} - void LLDebugView::draw() { - LLView* floater_snap_region = getRootView()->getChildView("floater_snap_region"); LLRect debug_rect; - floater_snap_region->localRectToOtherView(floater_snap_region->getLocalRect(), &debug_rect, getParent()); + mFloaterSnapRegion->localRectToOtherView(mFloaterSnapRegion->getLocalRect(), &debug_rect, getParent()); setShape(debug_rect); LLView::draw(); diff --git a/indra/newview/lldebugview.h b/indra/newview/lldebugview.h index 907a42c981..33d6a7394f 100644 --- a/indra/newview/lldebugview.h +++ b/indra/newview/lldebugview.h @@ -51,17 +51,21 @@ public: changeDefault(mouse_opaque, false); } }; + LLDebugView(const Params&); ~LLDebugView(); + BOOL postBuild(); + void init(); void draw(); - + void setStatsVisible(BOOL visible); LLFastTimerView* mFastTimerView; LLMemoryView* mMemoryView; LLConsole* mDebugConsolep; + LLView* mFloaterSnapRegion; }; extern LLDebugView* gDebugView; diff --git a/indra/newview/llfloaterwebcontent.cpp b/indra/newview/llfloaterwebcontent.cpp index f410c31f44..02f1899e6e 100644 --- a/indra/newview/llfloaterwebcontent.cpp +++ b/indra/newview/llfloaterwebcontent.cpp @@ -55,6 +55,15 @@ LLFloaterWebContent::_Params::_Params() LLFloaterWebContent::LLFloaterWebContent( const Params& params ) : LLFloater( params ), LLInstanceTracker(params.id()), + mWebBrowser(NULL), + mAddressCombo(NULL), + mSecureLockIcon(NULL), + mStatusBarText(NULL), + mStatusBarProgress(NULL), + mBtnBack(NULL), + mBtnForward(NULL), + mBtnReload(NULL), + mBtnStop(NULL), mUUID(params.id()), mShowPageTitle(params.show_page_title) { @@ -74,11 +83,16 @@ BOOL LLFloaterWebContent::postBuild() mStatusBarText = getChild< LLTextBox >( "statusbartext" ); mStatusBarProgress = getChild("statusbarprogress" ); + mBtnBack = getChildView( "back" ); + mBtnForward = getChildView( "forward" ); + mBtnReload = getChildView( "reload" ); + mBtnStop = getChildView( "stop" ); + // observe browser events mWebBrowser->addObserver( this ); // these buttons are always enabled - getChildView("reload")->setEnabled( true ); + mBtnReload->setEnabled( true ); getChildView("popexternal")->setEnabled( true ); // cache image for secure browsing @@ -276,8 +290,8 @@ void LLFloaterWebContent::onClose(bool app_quitting) void LLFloaterWebContent::draw() { // this is asynchronous so we need to keep checking - getChildView( "back" )->setEnabled( mWebBrowser->canNavigateBack() ); - getChildView( "forward" )->setEnabled( mWebBrowser->canNavigateForward() ); + mBtnBack->setEnabled( mWebBrowser->canNavigateBack() ); + mBtnForward->setEnabled( mWebBrowser->canNavigateForward() ); LLFloater::draw(); } @@ -297,12 +311,12 @@ void LLFloaterWebContent::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent else if(event == MEDIA_EVENT_NAVIGATE_BEGIN) { // flags are sent with this event - getChildView("back")->setEnabled( self->getHistoryBackAvailable() ); - getChildView("forward")->setEnabled( self->getHistoryForwardAvailable() ); + mBtnBack->setEnabled( self->getHistoryBackAvailable() ); + mBtnForward->setEnabled( self->getHistoryForwardAvailable() ); // toggle visibility of these buttons based on browser state - getChildView("reload")->setVisible( false ); - getChildView("stop")->setVisible( true ); + mBtnReload->setVisible( false ); + mBtnStop->setVisible( true ); // turn "on" progress bar now we're about to start loading mStatusBarProgress->setVisible( true ); @@ -310,12 +324,12 @@ void LLFloaterWebContent::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent else if(event == MEDIA_EVENT_NAVIGATE_COMPLETE) { // flags are sent with this event - getChildView("back")->setEnabled( self->getHistoryBackAvailable() ); - getChildView("forward")->setEnabled( self->getHistoryForwardAvailable() ); + mBtnBack->setEnabled( self->getHistoryBackAvailable() ); + mBtnForward->setEnabled( self->getHistoryForwardAvailable() ); // toggle visibility of these buttons based on browser state - getChildView("reload")->setVisible( true ); - getChildView("stop")->setVisible( false ); + mBtnReload->setVisible( true ); + mBtnStop->setVisible( false ); // turn "off" progress bar now we're loaded mStatusBarProgress->setVisible( false ); @@ -421,8 +435,8 @@ void LLFloaterWebContent::onClickStop() // still should happen when we catch the navigate complete event // but sometimes (don't know why) that event isn't sent from Qt // and we ghetto a point where the stop button stays active. - getChildView("reload")->setVisible( true ); - getChildView("stop")->setVisible( false ); + mBtnReload->setVisible( true ); + mBtnStop->setVisible( false ); } void LLFloaterWebContent::onEnterAddress() diff --git a/indra/newview/llfloaterwebcontent.h b/indra/newview/llfloaterwebcontent.h index 6fc66d1ad8..0340eedd93 100644 --- a/indra/newview/llfloaterwebcontent.h +++ b/indra/newview/llfloaterwebcontent.h @@ -97,6 +97,12 @@ protected: LLIconCtrl* mSecureLockIcon; LLTextBox* mStatusBarText; LLProgressBar* mStatusBarProgress; + + LLView* mBtnBack; + LLView* mBtnForward; + LLView* mBtnReload; + LLView* mBtnStop; + std::string mCurrentURL; std::string mUUID; bool mShowPageTitle; diff --git a/indra/newview/llnearbychatbar.cpp b/indra/newview/llnearbychatbar.cpp index 4674c85324..701fdf43c7 100644 --- a/indra/newview/llnearbychatbar.cpp +++ b/indra/newview/llnearbychatbar.cpp @@ -70,9 +70,14 @@ static LLChatTypeTrigger sChatTypeTriggers[] = { }; LLNearbyChatBar::LLNearbyChatBar(const LLSD& key) - : LLFloater(key), - mChatBox(NULL) -{ mSpeakerMgr = LLLocalSpeakerMgr::getInstance(); +: LLFloater(key), + mChatBox(NULL), + mNearbyChat(NULL), + mOutputMonitor(NULL), + mSpeakerMgr(NULL), + mExpandedHeight(COLLAPSED_HEIGHT + EXPANDED_HEIGHT) +{ + mSpeakerMgr = LLLocalSpeakerMgr::getInstance(); } //virtual @@ -94,6 +99,7 @@ BOOL LLNearbyChatBar::postBuild() mChatBox->setEnableLineHistory(TRUE); mChatBox->setFont(LLViewerChat::getChatFont()); + mNearbyChat = getChildView("nearby_chat"); LLUICtrl* show_btn = getChild("show_nearby_chat"); show_btn->setCommitCallback(boost::bind(&LLNearbyChatBar::onToggleNearbyChatPanel, this)); @@ -104,8 +110,6 @@ BOOL LLNearbyChatBar::postBuild() // Register for font change notifications LLViewerChat::setFontChangedCallback(boost::bind(&LLNearbyChatBar::onChatFontChange, this, _1)); - mExpandedHeight = COLLAPSED_HEIGHT + EXPANDED_HEIGHT; - enableResizeCtrls(true, true, false); return TRUE; @@ -115,8 +119,7 @@ bool LLNearbyChatBar::applyRectControl() { bool rect_controlled = LLFloater::applyRectControl(); - LLView* nearby_chat = getChildView("nearby_chat"); - if (!nearby_chat->getVisible()) + if (!mNearbyChat->getVisible()) { reshape(getRect().getWidth(), getMinHeight()); enableResizeCtrls(true, true, false); diff --git a/indra/newview/llnearbychatbar.h b/indra/newview/llnearbychatbar.h index e9734899b3..c2f57dc4ca 100644 --- a/indra/newview/llnearbychatbar.h +++ b/indra/newview/llnearbychatbar.h @@ -84,9 +84,10 @@ protected: // Which non-zero channel did we last chat on? static S32 sLastSpecialChatChannel; - LLLineEditor* mChatBox; - LLOutputMonitorCtrl* mOutputMonitor; - LLLocalSpeakerMgr* mSpeakerMgr; + LLLineEditor* mChatBox; + LLView* mNearbyChat; + LLOutputMonitorCtrl* mOutputMonitor; + LLLocalSpeakerMgr* mSpeakerMgr; S32 mExpandedHeight; }; diff --git a/indra/newview/llnearbychathandler.cpp b/indra/newview/llnearbychathandler.cpp index c43c95a366..7a17dbce3d 100644 --- a/indra/newview/llnearbychathandler.cpp +++ b/indra/newview/llnearbychathandler.cpp @@ -365,12 +365,15 @@ void LLNearbyChatScreenChannel::arrangeToasts() if(mStopProcessing || isHovering()) return; - LLView* floater_snap_region = gViewerWindow->getRootView()->getChildView("floater_snap_region"); - + if (mFloaterSnapRegion == NULL) + { + mFloaterSnapRegion = gViewerWindow->getRootView()->getChildView("floater_snap_region"); + } + if (!getParent()) { // connect to floater snap region just to get resize events, we don't care about being a proper widget - floater_snap_region->addChild(this); + mFloaterSnapRegion->addChild(this); setFollows(FOLLOWS_ALL); } @@ -378,7 +381,7 @@ void LLNearbyChatScreenChannel::arrangeToasts() updateRect(); LLRect channel_rect; - floater_snap_region->localRectToOtherView(floater_snap_region->getLocalRect(), &channel_rect, gFloaterView); + mFloaterSnapRegion->localRectToOtherView(mFloaterSnapRegion->getLocalRect(), &channel_rect, gFloaterView); channel_rect.mLeft += 10; channel_rect.mRight = channel_rect.mLeft + 300; diff --git a/indra/newview/llscreenchannel.cpp b/indra/newview/llscreenchannel.cpp index 45cf81751b..33dbd3bdc3 100644 --- a/indra/newview/llscreenchannel.cpp +++ b/indra/newview/llscreenchannel.cpp @@ -53,13 +53,22 @@ LLFastTimer::DeclareTimer FTM_GET_CHANNEL_RECT("Calculate Notification Channel R LLRect LLScreenChannelBase::getChannelRect() { LLFastTimer _(FTM_GET_CHANNEL_RECT); + + if (mFloaterSnapRegion == NULL) + { + mFloaterSnapRegion = gViewerWindow->getRootView()->getChildView("floater_snap_region"); + } + + if (mChicletRegion == NULL) + { + mChicletRegion = gViewerWindow->getRootView()->getChildView("chiclet_container"); + } + LLRect channel_rect; LLRect chiclet_rect; - LLView* floater_snap_region = gViewerWindow->getRootView()->getChildView("floater_snap_region"); - floater_snap_region->localRectToScreen(floater_snap_region->getLocalRect(), &channel_rect); - LLView* chiclet_region = gViewerWindow->getRootView()->getChildView("chiclet_container"); - chiclet_region->localRectToScreen(chiclet_region->getLocalRect(), &chiclet_rect); + mFloaterSnapRegion->localRectToScreen(mFloaterSnapRegion->getLocalRect(), &channel_rect); + mChicletRegion->localRectToScreen(mChicletRegion->getLocalRect(), &chiclet_rect); channel_rect.mTop = chiclet_rect.mBottom; return channel_rect; @@ -81,14 +90,31 @@ LLScreenChannelBase::LLScreenChannelBase(const Params& p) mShowToasts(true), mID(p.id), mDisplayToastsAlways(p.display_toasts_always), - mChannelAlignment(p.channel_align) -{ + mChannelAlignment(p.channel_align), + mFloaterSnapRegion(NULL), + mChicletRegion(NULL) +{ mID = p.id; setMouseOpaque( false ); setVisible(FALSE); } +BOOL LLScreenChannelBase::postBuild() +{ + if (mFloaterSnapRegion == NULL) + { + mFloaterSnapRegion = gViewerWindow->getRootView()->getChildView("floater_snap_region"); + } + + if (mChicletRegion == NULL) + { + mChicletRegion = gViewerWindow->getRootView()->getChildView("chiclet_container"); + } + + return TRUE; +} + void LLScreenChannelBase::reshape(S32 width, S32 height, BOOL called_from_parent) { redrawToasts(); @@ -473,12 +499,10 @@ void LLScreenChannel::modifyToastByNotificationID(LLUUID id, LLPanel* panel) //-------------------------------------------------------------------------- void LLScreenChannel::redrawToasts() { - LLView* floater_snap_region = gViewerWindow->getRootView()->getChildView("floater_snap_region"); - if (!getParent()) { // connect to floater snap region just to get resize events, we don't care about being a proper widget - floater_snap_region->addChild(this); + mFloaterSnapRegion->addChild(this); setFollows(FOLLOWS_ALL); } diff --git a/indra/newview/llscreenchannel.h b/indra/newview/llscreenchannel.h index 2f23552828..c9f8855fe6 100644 --- a/indra/newview/llscreenchannel.h +++ b/indra/newview/llscreenchannel.h @@ -69,6 +69,8 @@ public: }; LLScreenChannelBase(const Params&); + + BOOL postBuild(); void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); @@ -123,7 +125,7 @@ protected: // Channel's flags bool mControlHovering; - LLToast* mHoveredToast; + LLToast* mHoveredToast; bool mCanStoreToasts; bool mDisplayToastsAlways; // controls whether a channel shows toasts or not @@ -137,6 +139,9 @@ protected: // channel's ID LLUUID mID; + + LLView* mFloaterSnapRegion; + LLView* mChicletRegion; }; diff --git a/indra/newview/llsidepaneltaskinfo.cpp b/indra/newview/llsidepaneltaskinfo.cpp index 8774482acd..24cb559fd0 100644 --- a/indra/newview/llsidepaneltaskinfo.cpp +++ b/indra/newview/llsidepaneltaskinfo.cpp @@ -117,6 +117,42 @@ BOOL LLSidepanelTaskInfo::postBuild() childSetCommitCallback("checkbox next owner can transfer", &LLSidepanelTaskInfo::onCommitNextOwnerTransfer,this); childSetCommitCallback("clickaction", &LLSidepanelTaskInfo::onCommitClickAction,this); childSetCommitCallback("search_check", &LLSidepanelTaskInfo::onCommitIncludeInSearch,this); + + mDAPermModify = getChild("perm_modify"); + mDACreator = getChildView("Creator:"); + mDACreatorName = getChild("Creator Name"); + mDAOwner = getChildView("Owner:"); + mDAOwnerName = getChild("Owner Name"); + mDAGroup = getChildView("Group:"); + mDAGroupName = getChild("Group Name"); + mDAButtonSetGroup = getChildView("button set group"); + mDAObjectName = getChild("Object Name"); + mDAName = getChildView("Name:"); + mDADescription = getChildView("Description:"); + mDAObjectDescription = getChild("Object Description"); + mDAPermissions = getChildView("Permissions:"); + mDACheckboxShareWithGroup = getChild("checkbox share with group"); + mDAButtonDeed = getChildView("button deed"); + mDACheckboxAllowEveryoneMove = getChild("checkbox allow everyone move"); + mDACheckboxAllowEveryoneCopy = getChild("checkbox allow everyone copy"); + mDANextOwnerCan = getChildView("Next owner can:"); + mDACheckboxNextOwnerCanModify = getChild("checkbox next owner can modify"); + mDACheckboxNextOwnerCanCopy = getChild("checkbox next owner can copy"); + mDACheckboxNextOwnerCanTransfer = getChild("checkbox next owner can transfer"); + mDACheckboxForSale = getChild("checkbox for sale"); + mDASearchCheck = getChild("search_check"); + mDAComboSaleType = getChild("sale type"); + mDACost = getChild("Cost"); + mDAEditCost = getChild("Edit Cost"); + mDALabelClickAction = getChildView("label click action"); + mDAComboClickAction = getChild("clickaction"); + mDAB = getChildView("B:"); + mDAO = getChildView("O:"); + mDAG = getChildView("G:"); + mDAE = getChildView("E:"); + mDAN = getChildView("N:"); + mDAF = getChildView("F:"); + return TRUE; } @@ -138,81 +174,80 @@ BOOL LLSidepanelTaskInfo::postBuild() void LLSidepanelTaskInfo::disableAll() { - getChildView("perm_modify")->setEnabled(FALSE); - getChild("perm_modify")->setValue(LLStringUtil::null); - - getChildView("Creator:")->setEnabled(FALSE); - getChild("Creator Name")->setValue(LLStringUtil::null); - getChildView("Creator Name")->setEnabled(FALSE); - - getChildView("Owner:")->setEnabled(FALSE); - getChild("Owner Name")->setValue(LLStringUtil::null); - getChildView("Owner Name")->setEnabled(FALSE); - - getChildView("Group:")->setEnabled(FALSE); - getChild("Group Name")->setValue(LLStringUtil::null); - getChildView("Group Name")->setEnabled(FALSE); - getChildView("button set group")->setEnabled(FALSE); - - getChild("Object Name")->setValue(LLStringUtil::null); - getChildView("Object Name")->setEnabled(FALSE); - getChildView("Name:")->setEnabled(FALSE); - getChild("Group Name")->setValue(LLStringUtil::null); - getChildView("Group Name")->setEnabled(FALSE); - getChildView("Description:")->setEnabled(FALSE); - getChild("Object Description")->setValue(LLStringUtil::null); - getChildView("Object Description")->setEnabled(FALSE); - - getChildView("Permissions:")->setEnabled(FALSE); + mDAPermModify->setEnabled(FALSE); + mDAPermModify->setValue(LLStringUtil::null); + + mDACreator->setEnabled(FALSE); + mDACreatorName->setValue(LLStringUtil::null); + mDACreatorName->setEnabled(FALSE); + + mDAOwner->setEnabled(FALSE); + mDAOwnerName->setValue(LLStringUtil::null); + mDAOwnerName->setEnabled(FALSE); + + mDAGroup->setEnabled(FALSE); + mDAGroupName->setValue(LLStringUtil::null); + mDAGroupName->setEnabled(FALSE); + mDAButtonSetGroup->setEnabled(FALSE); + + mDAObjectName->setValue(LLStringUtil::null); + mDAObjectName->setEnabled(FALSE); + mDAName->setEnabled(FALSE); + mDAGroupName->setValue(LLStringUtil::null); + mDAGroupName->setEnabled(FALSE); + mDADescription->setEnabled(FALSE); + mDAObjectDescription->setValue(LLStringUtil::null); + mDAObjectDescription->setEnabled(FALSE); + + mDAPermissions->setEnabled(FALSE); - getChild("checkbox share with group")->setValue(FALSE); - getChildView("checkbox share with group")->setEnabled(FALSE); - getChildView("button deed")->setEnabled(FALSE); + mDACheckboxShareWithGroup->setValue(FALSE); + mDACheckboxShareWithGroup->setEnabled(FALSE); + mDAButtonDeed->setEnabled(FALSE); - getChild("checkbox allow everyone move")->setValue(FALSE); - getChildView("checkbox allow everyone move")->setEnabled(FALSE); - getChild("checkbox allow everyone copy")->setValue(FALSE); - getChildView("checkbox allow everyone copy")->setEnabled(FALSE); + mDACheckboxAllowEveryoneMove->setValue(FALSE); + mDACheckboxAllowEveryoneMove->setEnabled(FALSE); + mDACheckboxAllowEveryoneCopy->setValue(FALSE); + mDACheckboxAllowEveryoneCopy->setEnabled(FALSE); //Next owner can: - getChildView("Next owner can:")->setEnabled(FALSE); - getChild("checkbox next owner can modify")->setValue(FALSE); - getChildView("checkbox next owner can modify")->setEnabled(FALSE); - getChild("checkbox next owner can copy")->setValue(FALSE); - getChildView("checkbox next owner can copy")->setEnabled(FALSE); - getChild("checkbox next owner can transfer")->setValue(FALSE); - getChildView("checkbox next owner can transfer")->setEnabled(FALSE); + mDANextOwnerCan->setEnabled(FALSE); + mDACheckboxNextOwnerCanModify->setValue(FALSE); + mDACheckboxNextOwnerCanModify->setEnabled(FALSE); + mDACheckboxNextOwnerCanCopy->setValue(FALSE); + mDACheckboxNextOwnerCanCopy->setEnabled(FALSE); + mDACheckboxNextOwnerCanTransfer->setValue(FALSE); + mDACheckboxNextOwnerCanTransfer->setEnabled(FALSE); //checkbox for sale - getChild("checkbox for sale")->setValue(FALSE); - getChildView("checkbox for sale")->setEnabled(FALSE); + mDACheckboxForSale->setValue(FALSE); + mDACheckboxForSale->setEnabled(FALSE); //checkbox include in search - getChild("search_check")->setValue(FALSE); - getChildView("search_check")->setEnabled(FALSE); + mDASearchCheck->setValue(FALSE); + mDASearchCheck->setEnabled(FALSE); - LLComboBox* combo_sale_type = getChild("sale type"); - combo_sale_type->setValue(LLSaleInfo::FS_COPY); - combo_sale_type->setEnabled(FALSE); + mDAComboSaleType->setValue(LLSaleInfo::FS_COPY); + mDAComboSaleType->setEnabled(FALSE); - getChildView("Cost")->setEnabled(FALSE); - getChild("Cost")->setValue(getString("Cost Default")); - getChild("Edit Cost")->setValue(LLStringUtil::null); - getChildView("Edit Cost")->setEnabled(FALSE); + mDACost->setEnabled(FALSE); + mDACost->setValue(getString("Cost Default")); + mDAEditCost->setValue(LLStringUtil::null); + mDAEditCost->setEnabled(FALSE); - getChildView("label click action")->setEnabled(FALSE); - LLComboBox* combo_click_action = getChild("clickaction"); - if (combo_click_action) + mDALabelClickAction->setEnabled(FALSE); + if (mDAComboClickAction) { - combo_click_action->setEnabled(FALSE); - combo_click_action->clear(); + mDAComboClickAction->setEnabled(FALSE); + mDAComboClickAction->clear(); } - getChildView("B:")->setVisible( FALSE); - getChildView("O:")->setVisible( FALSE); - getChildView("G:")->setVisible( FALSE); - getChildView("E:")->setVisible( FALSE); - getChildView("N:")->setVisible( FALSE); - getChildView("F:")->setVisible( FALSE); + + mDAB->setVisible(FALSE); + mDAO->setVisible(FALSE); + mDAG->setVisible(FALSE); + mDAE->setVisible(FALSE); + mDAN->setVisible(FALSE); + mDAF->setVisible(FALSE); mOpenBtn->setEnabled(FALSE); mPayBtn->setEnabled(FALSE); diff --git a/indra/newview/llsidepaneltaskinfo.h b/indra/newview/llsidepaneltaskinfo.h index 384bc479d6..be0fee2127 100644 --- a/indra/newview/llsidepaneltaskinfo.h +++ b/indra/newview/llsidepaneltaskinfo.h @@ -37,8 +37,9 @@ // Panel for permissions of an object. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -class LLNameBox; class LLCheckBoxCtrl; +class LLComboBox; +class LLNameBox; class LLViewerObject; class LLSidepanelTaskInfo : public LLSidepanelInventorySubpanel @@ -118,6 +119,43 @@ private: LLPointer mObject; LLObjectSelectionHandle mObjectSelection; static LLSidepanelTaskInfo* sActivePanel; + +private: + // Pointers cached here to speed up the "disableAll" function which gets called on idle + LLUICtrl* mDAPermModify; + LLView* mDACreator; + LLUICtrl* mDACreatorName; + LLView* mDAOwner; + LLUICtrl* mDAOwnerName; + LLView* mDAGroup; + LLUICtrl* mDAGroupName; + LLView* mDAButtonSetGroup; + LLUICtrl* mDAObjectName; + LLView* mDAName; + LLView* mDADescription; + LLUICtrl* mDAObjectDescription; + LLView* mDAPermissions; + LLUICtrl* mDACheckboxShareWithGroup; + LLView* mDAButtonDeed; + LLUICtrl* mDACheckboxAllowEveryoneMove; + LLUICtrl* mDACheckboxAllowEveryoneCopy; + LLView* mDANextOwnerCan; + LLUICtrl* mDACheckboxNextOwnerCanModify; + LLUICtrl* mDACheckboxNextOwnerCanCopy; + LLUICtrl* mDACheckboxNextOwnerCanTransfer; + LLUICtrl* mDACheckboxForSale; + LLUICtrl* mDASearchCheck; + LLComboBox* mDAComboSaleType; + LLUICtrl* mDACost; + LLUICtrl* mDAEditCost; + LLView* mDALabelClickAction; + LLComboBox* mDAComboClickAction; + LLView* mDAB; + LLView* mDAO; + LLView* mDAG; + LLView* mDAE; + LLView* mDAN; + LLView* mDAF; }; diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp index 75db269bde..89240c982f 100644 --- a/indra/newview/llstatusbar.cpp +++ b/indra/newview/llstatusbar.cpp @@ -114,6 +114,7 @@ LLStatusBar::LLStatusBar(const LLRect& rect) mTextTime(NULL), mSGBandwidth(NULL), mSGPacketLoss(NULL), + mBtnStats(NULL), mBtnVolume(NULL), mBoxBalance(NULL), mBalance(0), @@ -173,6 +174,8 @@ BOOL LLStatusBar::postBuild() mBoxBalance = getChild("balance"); mBoxBalance->setClickedCallback( &LLStatusBar::onClickBalance, this ); + + mBtnStats = getChildView("stat_btn"); mBtnVolume = getChild( "volume_btn" ); mBtnVolume->setClickedCallback( onClickVolume, this ); @@ -288,7 +291,7 @@ void LLStatusBar::refresh() mSGBandwidth->setVisible(net_stats_visible); mSGPacketLoss->setVisible(net_stats_visible); - getChildView("stat_btn")->setEnabled(net_stats_visible); + mBtnStats->setEnabled(net_stats_visible); // update the master volume button state bool mute_audio = LLAppViewer::instance()->getMasterSystemAudioMute(); diff --git a/indra/newview/llstatusbar.h b/indra/newview/llstatusbar.h index 4ea3183d18..9d28e6c2bc 100644 --- a/indra/newview/llstatusbar.h +++ b/indra/newview/llstatusbar.h @@ -102,10 +102,11 @@ private: LLStatGraph *mSGBandwidth; LLStatGraph *mSGPacketLoss; + LLView *mBtnStats; LLButton *mBtnVolume; LLTextBox *mBoxBalance; LLButton *mMediaToggle; - LLView* mScriptOut; + LLView *mScriptOut; LLFrameTimer mClockUpdateTimer; S32 mBalance; -- cgit v1.3