From 5e6b4b5ad0dc56869430bcd31a942bdc7f8a2899 Mon Sep 17 00:00:00 2001 From: paul_productengine Date: Wed, 26 Jan 2011 20:24:49 +0200 Subject: STORM-351 FIXED Scrolling flat list by mouse wheel changes zoom level in-world - Prevent passing scroll event to in-world --- indra/newview/llsidetray.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'indra/newview/llsidetray.cpp') diff --git a/indra/newview/llsidetray.cpp b/indra/newview/llsidetray.cpp index 19d1bdee86..eb537c7d7b 100644 --- a/indra/newview/llsidetray.cpp +++ b/indra/newview/llsidetray.cpp @@ -141,6 +141,8 @@ public: void toggleTabDocked(); + BOOL handleScrollWheel(S32 x, S32 y, S32 clicks); + LLPanel *getPanel(); private: std::string mTabTitle; @@ -269,6 +271,15 @@ void LLSideTrayTab::toggleTabDocked() LLFloaterReg::toggleInstance("side_bar_tab", tab_name); } +BOOL LLSideTrayTab::handleScrollWheel(S32 x, S32 y, S32 clicks) +{ + // Let children handle the event + LLUICtrl::handleScrollWheel(x, y, clicks); + + // and then eat it to prevent in-world scrolling (STORM-351). + return TRUE; +} + void LLSideTrayTab::dock(LLFloater* floater_tab) { LLSideTray* side_tray = getSideTray(); -- cgit v1.2.3 From 5946d84eef30caeae6dee63767fabdcf81613984 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Wed, 16 Feb 2011 12:49:35 -0500 Subject: SWAT-484, SWAT-485: add LLSideTrayListener, a new LLEventAPI. Expand XUI-visible LLUICtrl::CommitCallbackRegistry operations to include "SideTray.Toggle" and "SideTray.Collapse". Give LLSideTrayListener friend access to LLSideTray so it can query the attached and detached tabs. Introduce tab_cast template to deal with the unavailability of the LLSideTrayTab class outside of llsidetray.cpp. --- indra/newview/llsidetray.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'indra/newview/llsidetray.cpp') diff --git a/indra/newview/llsidetray.cpp b/indra/newview/llsidetray.cpp index eb537c7d7b..85efebabfe 100644 --- a/indra/newview/llsidetray.cpp +++ b/indra/newview/llsidetray.cpp @@ -53,6 +53,8 @@ #include "llsidepanelappearance.h" +#include "llsidetraylistener.h" + //#include "llscrollcontainer.h" using namespace std; @@ -71,6 +73,8 @@ static const std::string TAB_PANEL_CAPTION_TITLE_BOX = "sidetray_tab_title"; LLSideTray* LLSideTray::sInstance = 0; +static LLSideTrayListener sSideTrayListener(LLSideTray::getInstance); + // static LLSideTray* LLSideTray::getInstance() { @@ -417,6 +421,11 @@ LLSideTrayTab* LLSideTrayTab::createInstance () return tab; } +// Now that we know the definition of LLSideTrayTab, we can implement +// tab_cast. +template <> +LLPanel* tab_cast(LLSideTrayTab* tab) { return tab; } + ////////////////////////////////////////////////////////////////////////////// // LLSideTrayButton // Side Tray tab button with "tear off" handling. @@ -530,6 +539,8 @@ LLSideTray::LLSideTray(const Params& params) // register handler function to process data from the xml. // panel_name should be specified via "parameter" attribute. commit.add("SideTray.ShowPanel", boost::bind(&LLSideTray::showPanel, this, _2, LLUUID::null)); + commit.add("SideTray.Toggle", boost::bind(&LLSideTray::onToggleCollapse, this)); + commit.add("SideTray.Collapse", boost::bind(&LLSideTray::collapseSideBar, this)); LLTransientFloaterMgr::getInstance()->addControlView(this); LLView* side_bar_tabs = gViewerWindow->getRootView()->getChildView("side_bar_tabs"); if (side_bar_tabs != NULL) -- cgit v1.2.3