From 79f2fac886f1a3f99fbc172794ecdcdcccbf32c1 Mon Sep 17 00:00:00 2001 From: Arrehn Date: Mon, 17 Jan 2011 09:41:14 -0500 Subject: [PATCH] Temporary commit to re-enable moving of detached sidebars. Will be replaced by work coming soon, work in progress. --- indra/newview/llsidetray.cpp | 67 +------------ indra/newview/llsidetraytab.h | 96 +++++++++++++++++++ .../default/xui/en/floater_side_bar_tab.xml | 7 +- .../xui/en/floater_side_bar_tab.xml | 7 +- 4 files changed, 105 insertions(+), 72 deletions(-) create mode 100644 indra/newview/llsidetraytab.h diff --git a/indra/newview/llsidetray.cpp b/indra/newview/llsidetray.cpp index e222402df4..b14e8cf664 100644 --- a/indra/newview/llsidetray.cpp +++ b/indra/newview/llsidetray.cpp @@ -40,6 +40,7 @@ #include "llfocusmgr.h" #include "llrootview.h" #include "llnavigationbar.h" +#include "llsidetraytab.h" #include "llaccordionctrltab.h" @@ -89,69 +90,6 @@ bool LLSideTray::instanceCreated () return sInstance!=0; } -////////////////////////////////////////////////////////////////////////////// -// LLSideTrayTab -// Represents a single tab in the side tray, only used by LLSideTray -////////////////////////////////////////////////////////////////////////////// - -class LLSideTrayTab: public LLPanel -{ - friend class LLUICtrlFactory; - friend class LLSideTray; -public: - - struct Params - : public LLInitParam::Block - { - // image name - Optional image; - Optional image_selected; - Optional tab_title; - Optional description; - Params() - : image("image"), - image_selected("image_selected"), - tab_title("tab_title","no title"), - description("description","no description") - {}; - }; -protected: - LLSideTrayTab(const Params& params); - - void dock(); - void undock(LLFloater* floater_tab); - - LLSideTray* getSideTray(); - -public: - virtual ~LLSideTrayTab(); - - /*virtual*/ BOOL postBuild (); - /*virtual*/ bool addChild (LLView* view, S32 tab_group); - - - void reshape (S32 width, S32 height, BOOL called_from_parent = TRUE); - - static LLSideTrayTab* createInstance (); - - const std::string& getDescription () const { return mDescription;} - const std::string& getTabTitle() const { return mTabTitle;} - - void onOpen (const LLSD& key); - - void toggleTabDocked(); -//-TT - Patch : MinimizeSidetabs - void minimizeTab(); -//-TT - LLPanel *getPanel(); -private: - std::string mTabTitle; - std::string mImage; - std::string mImageSelected; - std::string mDescription; - - LLView* mMainPanel; -}; LLSideTrayTab::LLSideTrayTab(const Params& p) : LLPanel(), @@ -261,7 +199,7 @@ void LLSideTrayTab::minimizeTab() floater_tab->setMinimized(true); } } -//-TT + void LLSideTrayTab::toggleTabDocked() { @@ -323,6 +261,7 @@ static void on_minimize(LLSidepanelAppearance* panel, LLSD minimized) void LLSideTrayTab::undock(LLFloater* floater_tab) { + LLSideTray* side_tray = getSideTray(); if (!side_tray) return; diff --git a/indra/newview/llsidetraytab.h b/indra/newview/llsidetraytab.h new file mode 100644 index 0000000000..9ee3b03de6 --- /dev/null +++ b/indra/newview/llsidetraytab.h @@ -0,0 +1,96 @@ +/** + * @file llsidetray.cpp + * @brief SideBartray definition, broken out from llsidebar.cpp - Arrehn + * + * $LicenseInfo:firstyear=2011&license=viewerlgpl$ + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + + +#include "llsidetray.h" +#include "llpanel.h" + +////////////////////////////////////////////////////////////////////////////// +// LLSideTrayTab +// Represents a single tab in the side tray, only used by LLSideTray +////////////////////////////////////////////////////////////////////////////// + +class llSideTray; + + +class LLSideTrayTab: public LLPanel +{ + friend class LLUICtrlFactory; + friend class LLSideTray; + +public: + + struct Params + : public LLInitParam::Block + { + // image name + Optional image; + Optional image_selected; + Optional tab_title; + Optional description; + Params() + : image("image"), + image_selected("image_selected"), + tab_title("tab_title","no title"), + description("description","no description") + {}; + }; +protected: + LLSideTrayTab(const Params& params); + + void dock(); + void undock(LLFloater* floater_tab); + + LLSideTray* getSideTray(); + +public: + virtual ~LLSideTrayTab(); + + /*virtual*/ BOOL postBuild (); + /*virtual*/ bool addChild (LLView* view, S32 tab_group); + + + void reshape (S32 width, S32 height, BOOL called_from_parent = TRUE); + + static LLSideTrayTab* createInstance (); + + const std::string& getDescription () const { return mDescription;} + const std::string& getTabTitle() const { return mTabTitle;} + + void onOpen (const LLSD& key); + + void toggleTabDocked(); + //-TT - Patch : MinimizeSidetabs + void minimizeTab(); + void setMinimized(BOOL b); + + LLPanel *getPanel(); +private: + std::string mTabTitle; + std::string mImage; + std::string mImageSelected; + std::string mDescription; + + LLView* mMainPanel; +}; diff --git a/indra/newview/skins/default/xui/en/floater_side_bar_tab.xml b/indra/newview/skins/default/xui/en/floater_side_bar_tab.xml index 2c7091a33e..f20698be7c 100644 --- a/indra/newview/skins/default/xui/en/floater_side_bar_tab.xml +++ b/indra/newview/skins/default/xui/en/floater_side_bar_tab.xml @@ -2,12 +2,11 @@ diff --git a/indra/newview/skins/metaharper/xui/en/floater_side_bar_tab.xml b/indra/newview/skins/metaharper/xui/en/floater_side_bar_tab.xml index 2c7091a33e..f20698be7c 100644 --- a/indra/newview/skins/metaharper/xui/en/floater_side_bar_tab.xml +++ b/indra/newview/skins/metaharper/xui/en/floater_side_bar_tab.xml @@ -2,12 +2,11 @@