From 39905b927d60e204438705728d2c214cb3f9ef81 Mon Sep 17 00:00:00 2001 From: Steven Bennetts Date: Thu, 2 Jul 2009 00:38:13 +0000 Subject: merge https://svn.aws.productengine.com/secondlife/export-from-ll/viewer-2-0@873 https://svn.aws.productengine.com/secondlife/pe/stable@888 -> viewer-2.0.0-pe-4 --- indra/newview/llsidetray.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'indra/newview/llsidetray.cpp') diff --git a/indra/newview/llsidetray.cpp b/indra/newview/llsidetray.cpp index e7008abe60..daee3ecfa6 100644 --- a/indra/newview/llsidetray.cpp +++ b/indra/newview/llsidetray.cpp @@ -704,6 +704,7 @@ void LLSideTray::createHomeTab() panel_params.padding_right(10); panel_params.padding_top(5); panel_params.padding_bottom(5); + panel_params.name(sidebar_tab->getTabTitle()); LLCollapsibleCtrl* ctrl = LLUICtrlFactory::create(panel_params); @@ -732,7 +733,8 @@ void LLSideTray::setPanelRect () panel_width+=mMaxBarWidth; S32 panel_height = parent_rect.getHeight()-fake_top_offset; - panel_height -= LLBottomTray::getInstance()->getRect().getHeight(); + if(gBottomTray) + panel_height -= gBottomTray->getRect().getHeight(); LLRect panel_rect; panel_rect.setLeftTopAndSize( parent_rect.mRight-panel_width, parent_rect.mTop-fake_top_offset, panel_width, panel_height); -- cgit v1.2.3 From d6101558a171dbd2390792ac1e78d09fc2c27711 Mon Sep 17 00:00:00 2001 From: James Cook Date: Mon, 6 Jul 2009 21:58:04 +0000 Subject: Merge xui-army-5 to viewer-2, includes layout, art, and color changes, also UI color refactoring and new FreeType font library on Linux. svn merge -r126038:126164 svn+ssh://svn.lindenlab.com/svn/linden/branches/skinning/xui-army-5 --- indra/newview/llsidetray.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llsidetray.cpp') diff --git a/indra/newview/llsidetray.cpp b/indra/newview/llsidetray.cpp index daee3ecfa6..2871b16f5c 100644 --- a/indra/newview/llsidetray.cpp +++ b/indra/newview/llsidetray.cpp @@ -162,8 +162,8 @@ BOOL LLSideTrayTab::postBuild() title_panel->getChild(TAB_PANEL_CAPTION_TITLE_BOX)->setValue(mTabTitle); - static LLUICachedControl default_background_color ("FloaterDefaultBackgroundColor", *(new LLColor4)); - static LLUICachedControl focus_background_color ("FloaterFocusBackgroundColor", *(new LLColor4)); + static LLUIColor default_background_color = LLUIColorTable::instance().getColor("FloaterDefaultBackgroundColor"); + static LLUIColor focus_background_color = LLUIColorTable::instance().getColor("FloaterFocusBackgroundColor"); setTransparentColor(default_background_color); setBackgroundColor(focus_background_color); -- cgit v1.2.3 From 52aeaa32841e7d0b37abab0a2a2540c2be2f16b7 Mon Sep 17 00:00:00 2001 From: James Cook Date: Tue, 7 Jul 2009 00:53:05 +0000 Subject: Merge skinning-14 to viewer-2, including refactoring many floaters to register them with LLFloaterReg, support for introspection of ParamBlock based UI widgets to dump XML schema, splitting llfolderview.cpp into three separate files to unravel dependencies and skeleton for for LLListView widget. Resolved conflicts in these files: lldraghandle.h, lluictrl.h, llchiclet.cpp, llfolderview.h/cpp, lliinventorybridge.cpp, llpanelpicks.cpp, llviewermenu.cpp, floater_mute.xml, floater_preferences.xml, notifications.xml, panel_preferences_audio.xml, panel_preferences_graphics1.xml, panel_region_general.xml svn merge -r124961:126284 svn+ssh://svn.lindenlab.com/svn/linden/branches/skinning/skinning-14 --- indra/newview/llsidetray.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'indra/newview/llsidetray.cpp') diff --git a/indra/newview/llsidetray.cpp b/indra/newview/llsidetray.cpp index 2871b16f5c..b7c4c74891 100644 --- a/indra/newview/llsidetray.cpp +++ b/indra/newview/llsidetray.cpp @@ -52,7 +52,7 @@ using namespace std; static LLRootViewRegistry::Register t1("side_tray"); -static LLDefaultWidgetRegistry::Register t2("sidetray_tab"); +static LLDefaultChildRegistry::Register t2("sidetray_tab"); static const std::string COLLAPSED_NAME = "<<"; static const std::string EXPANDED_NAME = ">>"; @@ -103,7 +103,7 @@ LLSideTray* LLSideTray::getInstance() { if (!sInstance) { - sInstance = LLUICtrlFactory::createFromFile("panel_side_tray.xml",gViewerWindow->getRootView()); + sInstance = LLUICtrlFactory::createFromFile("panel_side_tray.xml",gViewerWindow->getRootView(), LLRootView::child_registry_t::instance()); } return sInstance; @@ -156,7 +156,7 @@ bool LLSideTrayTab::addChild(LLView* view, S32 tab_group) //virtual BOOL LLSideTrayTab::postBuild() { - LLPanel* title_panel = LLUICtrlFactory::getInstance()->createFromFile("panel_side_tray_tab_caption.xml",this); + LLPanel* title_panel = LLUICtrlFactory::getInstance()->createFromFile("panel_side_tray_tab_caption.xml",this, child_registry_t::instance()); string name = title_panel->getName(); LLPanel::addChild(title_panel); @@ -374,7 +374,7 @@ bool LLSideTray::selectTabByName (const std::string& name) LLButton* LLSideTray::createButton (const std::string& name,const std::string& image,LLUICtrl::commit_callback_t callback) { - static LLSideTray::Params sidetray_params(LLUICtrlFactory::getDefaultParams()); + static LLSideTray::Params sidetray_params(LLUICtrlFactory::getDefaultParams()); LLButton::Params bparams; @@ -475,7 +475,7 @@ void LLSideTray::reflectCollapseChange() void LLSideTray::arrange () { - static LLSideTray::Params sidetray_params(LLUICtrlFactory::getDefaultParams()); + static LLSideTray::Params sidetray_params(LLUICtrlFactory::getDefaultParams()); calcMaxSideBarWidth(); @@ -600,7 +600,7 @@ void LLSideTray::reshape (S32 width, S32 height, BOOL called_from_parent) if(!mActiveTab) return; - static LLSideTray::Params sidetray_params(LLUICtrlFactory::getDefaultParams()); + static LLSideTray::Params sidetray_params(LLUICtrlFactory::getDefaultParams()); setPanelRect(); @@ -724,7 +724,7 @@ static const S32 fake_top_offset = 78; void LLSideTray::setPanelRect () { - static LLSideTray::Params sidetray_params(LLUICtrlFactory::getDefaultParams()); + static LLSideTray::Params sidetray_params(LLUICtrlFactory::getDefaultParams()); const LLRect& parent_rect = gViewerWindow->getRootView()->getRect(); @@ -743,6 +743,6 @@ void LLSideTray::setPanelRect () S32 LLSideTray::getTrayWidth() { - static LLSideTray::Params sidetray_params(LLUICtrlFactory::getDefaultParams()); + static LLSideTray::Params sidetray_params(LLUICtrlFactory::getDefaultParams()); return getRect().getWidth() - (sidetray_params.default_button_width + sidetray_params.default_button_margin); } -- cgit v1.2.3 From f26f7e3e29019abf3a10f6925e30baca19eb4e2d Mon Sep 17 00:00:00 2001 From: Steven Bennetts Date: Wed, 8 Jul 2009 05:19:19 +0000 Subject: merge -r 889-936 https://svn.aws.productengine.com/secondlife/pe/stable/ -> viewer-2-0 Also: * Moved media remote shortcut to Communicate menu * Changed mini map menu to toggle instead of show --- indra/newview/llsidetray.cpp | 4 ---- 1 file changed, 4 deletions(-) (limited to 'indra/newview/llsidetray.cpp') diff --git a/indra/newview/llsidetray.cpp b/indra/newview/llsidetray.cpp index b7c4c74891..53b88ba430 100644 --- a/indra/newview/llsidetray.cpp +++ b/indra/newview/llsidetray.cpp @@ -45,7 +45,6 @@ #include "llfloater.h" //for gFloaterView #include "lliconctrl.h"//for Home tab icon #include "llwindow.h"//for SetCursor -#include "llbottomtray.h"//for reshape //#include "llscrollcontainer.h" @@ -733,9 +732,6 @@ void LLSideTray::setPanelRect () panel_width+=mMaxBarWidth; S32 panel_height = parent_rect.getHeight()-fake_top_offset; - if(gBottomTray) - panel_height -= gBottomTray->getRect().getHeight(); - LLRect panel_rect; panel_rect.setLeftTopAndSize( parent_rect.mRight-panel_width, parent_rect.mTop-fake_top_offset, panel_width, panel_height); setRect(panel_rect); -- cgit v1.2.3 From 60ba000989347e92e78f9db7a966ea4e87cecc5b Mon Sep 17 00:00:00 2001 From: Steven Bennetts Date: Thu, 9 Jul 2009 03:40:30 +0000 Subject: Fixed LLPanel visible and enabled settings. Set the side panel width to 280. Changed the code to use the initial width of the side tray instead of the max of the panels. --- indra/newview/llsidetray.cpp | 35 +++-------------------------------- 1 file changed, 3 insertions(+), 32 deletions(-) (limited to 'indra/newview/llsidetray.cpp') diff --git a/indra/newview/llsidetray.cpp b/indra/newview/llsidetray.cpp index 53b88ba430..f50f5a3db0 100644 --- a/indra/newview/llsidetray.cpp +++ b/indra/newview/llsidetray.cpp @@ -170,11 +170,6 @@ BOOL LLSideTrayTab::postBuild() return true; } -S32 LLSideTrayTab::getMaxSideBarTabWidth() -{ - return (mAccordionPanel)?mAccordionPanel->getMaxPanelWidth():0; -} - static const S32 splitter_margin = 1; //virtual @@ -251,10 +246,11 @@ LLSideTrayTab* LLSideTrayTab::createInstance () //virtual LLSideTray::LLSideTray(Params& params) - :mActiveTab(0) + : LLPanel(params) + ,mActiveTab(0) ,mCollapsed(false) ,mCollapseButton(0) - ,mMaxBarWidth(0) + ,mMaxBarWidth(params.rect.width) ,mHomeTab(0) { mCollapsed=params.collapsed; @@ -263,8 +259,6 @@ LLSideTray::LLSideTray(Params& params) BOOL LLSideTray::postBuild() { - calcMaxSideBarWidth(); - createButtons(); createHomeTab(); @@ -476,10 +470,6 @@ void LLSideTray::arrange () { static LLSideTray::Params sidetray_params(LLUICtrlFactory::getDefaultParams()); - calcMaxSideBarWidth(); - - - setPanelRect(); LLRect ctrl_rect; @@ -552,25 +542,6 @@ void LLSideTray::expandSideBar () } -void LLSideTray::calcMaxSideBarWidth() -{ - - S32 max_bar_width = 0; - - - child_vector_const_iter_t child_it; - for ( child_it = mTabs.begin(); child_it != mTabs.end(); ++child_it) - { - LLSideTrayTab* sidebar_tab = dynamic_cast(*child_it); - if(sidebar_tab == NULL) - continue; - max_bar_width = llmax(max_bar_width,sidebar_tab->getMaxSideBarTabWidth()); - } - - if(max_bar_width > 0) - mMaxBarWidth = max_bar_width; - -} void LLSideTray::highlightFocused() { if(!mActiveTab) -- cgit v1.2.3 From 73a97010e6c8c7874fdc1778ab46e492f77d9394 Mon Sep 17 00:00:00 2001 From: Steven Bennetts Date: Tue, 21 Jul 2009 00:57:23 +0000 Subject: merge https://svn.aws.productengine.com/secondlife/export-from-ll/viewer-2-0/indra@1059 https://svn.aws.productengine.com/secondlife/pe/stable-1/indra@1070 -> svn+ssh://svn.lindenlab.com/svn/linden/branches/viewer/viewer-2.0.0-3 --- indra/newview/llsidetray.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'indra/newview/llsidetray.cpp') diff --git a/indra/newview/llsidetray.cpp b/indra/newview/llsidetray.cpp index f50f5a3db0..d8be1386c3 100644 --- a/indra/newview/llsidetray.cpp +++ b/indra/newview/llsidetray.cpp @@ -40,7 +40,7 @@ #include "llfocusmgr.h" #include "llrootview.h" -#include "llcollapsiblectrl.h" +#include "llaccordionctrltab.h" #include "llfloater.h" //for gFloaterView #include "lliconctrl.h"//for Home tab icon @@ -664,7 +664,7 @@ void LLSideTray::createHomeTab() panel->setCommitCallback(boost::bind(&LLSideTray::onTabButtonClick, this, sidebar_tab->getName())); - LLCollapsibleCtrl::Params panel_params; + LLAccordionCtrlTab::Params panel_params; panel_params.display_children(true); panel_params.collapsible(false); panel_params.header_visible(false); @@ -676,7 +676,7 @@ void LLSideTray::createHomeTab() panel_params.padding_bottom(5); panel_params.name(sidebar_tab->getTabTitle()); - LLCollapsibleCtrl* ctrl = LLUICtrlFactory::create(panel_params); + LLAccordionCtrlTab* ctrl = LLUICtrlFactory::create(panel_params); ctrl->setPanel(panel); -- cgit v1.2.3 From cef46d16453873691406c22be39ce0ee5e8076d1 Mon Sep 17 00:00:00 2001 From: Steven Bennetts Date: Tue, 21 Jul 2009 00:59:14 +0000 Subject: merge https://svn.aws.productengine.com/secondlife/pe/stable-1/indra -r 1078-1091 -> viewer-2.0.0-3 --- indra/newview/llsidetray.cpp | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'indra/newview/llsidetray.cpp') diff --git a/indra/newview/llsidetray.cpp b/indra/newview/llsidetray.cpp index d8be1386c3..37262b736e 100644 --- a/indra/newview/llsidetray.cpp +++ b/indra/newview/llsidetray.cpp @@ -36,7 +36,7 @@ #include "llsidetray.h" #include "llviewerwindow.h" -#include "llaccordionpanel.h" +#include "llaccordionctrl.h" #include "llfocusmgr.h" #include "llrootview.h" @@ -113,7 +113,7 @@ bool LLSideTray::instanceCreated () return sInstance!=0; } -LLSideTrayTab::LLSideTrayTab(const Params& params):mAccordionPanel(0) +LLSideTrayTab::LLSideTrayTab(const Params& params):mAccordionCtrl(0) { mImagePath = params.image_path; @@ -131,18 +131,18 @@ void LLSideTrayTab::addPanel(LLPanel* panel) bool LLSideTrayTab::addChild(LLView* view, S32 tab_group) { - if(mAccordionPanel == 0) + if(mAccordionCtrl == 0) { - mAccordionPanel = new LLAccordionPanel(); - mAccordionPanel->setVisible(TRUE); - LLPanel::addChild(mAccordionPanel,tab_group); + mAccordionCtrl = new LLAccordionCtrl(); + mAccordionCtrl->setVisible(TRUE); + LLPanel::addChild(mAccordionCtrl,tab_group); } bool res = true; if(TAB_PANEL_CAPTION_NAME != view->getName())//skip our caption panel { - mAccordionPanel->addCollapsibleCtrl(view); + mAccordionCtrl->addCollapsibleCtrl(view); } else res = LLPanel::addChild(view,tab_group); @@ -185,17 +185,17 @@ void LLSideTrayTab::arrange(S32 width, S32 height ) offset = title_panel->getRect().getHeight(); } - LLRect sRect = mAccordionPanel->getRect(); + LLRect sRect = mAccordionCtrl->getRect(); sRect.setLeftTopAndSize( splitter_margin, height - offset - splitter_margin, width - 2*splitter_margin, height - offset - 2*splitter_margin); - mAccordionPanel->setRect(sRect); + mAccordionCtrl->setRect(sRect); - mAccordionPanel->setMaxWidth(sRect.getWidth()); - mAccordionPanel->arrange(); + mAccordionCtrl->setMaxWidth(sRect.getWidth()); + mAccordionCtrl->arrange(); } void LLSideTrayTab::reshape (S32 width, S32 height, BOOL called_from_parent ) { - if(!mAccordionPanel) + if(!mAccordionCtrl) return; S32 offset = 0; @@ -210,12 +210,12 @@ void LLSideTrayTab::reshape (S32 width, S32 height, BOOL called_from_parent ) - LLRect sRect = mAccordionPanel->getRect(); + LLRect sRect = mAccordionCtrl->getRect(); sRect.setLeftTopAndSize( splitter_margin, height - offset - splitter_margin, width - 2*splitter_margin, height - offset - 2*splitter_margin); - mAccordionPanel->setMaxWidth(sRect.getWidth()); - mAccordionPanel->reshape(sRect.getWidth(), sRect.getHeight()); + mAccordionCtrl->setMaxWidth(sRect.getWidth()); + mAccordionCtrl->reshape(sRect.getWidth(), sRect.getHeight()); - mAccordionPanel->setRect(sRect); + mAccordionCtrl->setRect(sRect); } @@ -231,7 +231,7 @@ void LLSideTrayTab::draw() void LLSideTrayTab::onOpen (const LLSD& key) { - mAccordionPanel->onOpen(key); + mAccordionCtrl->onOpen(key); } LLSideTrayTab* LLSideTrayTab::createInstance () -- cgit v1.2.3 From 8f7ec64899c54dcee6caa0307510cc4003ba7bdd Mon Sep 17 00:00:00 2001 From: James Cook Date: Mon, 27 Jul 2009 17:56:26 +0000 Subject: Merged skinning-17 into viewer-2 for bug fixes. Commented out new IM window for now, not complete. Merging revisions 127913-128319 of svn+ssh://svn.lindenlab.com/svn/linden/branches/skinning/skinning-17 into D:\viewer-2.0.0-3, respecting ancestry --- indra/newview/llsidetray.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llsidetray.cpp') diff --git a/indra/newview/llsidetray.cpp b/indra/newview/llsidetray.cpp index 37262b736e..abcff7cfb1 100644 --- a/indra/newview/llsidetray.cpp +++ b/indra/newview/llsidetray.cpp @@ -118,7 +118,7 @@ LLSideTrayTab::LLSideTrayTab(const Params& params):mAccordionCtrl(0) { mImagePath = params.image_path; mTabTitle = params.tab_title; - mDescription = params.tab_description; + mDescription = params.description; } LLSideTrayTab::~LLSideTrayTab() { -- cgit v1.2.3 From e97f7728a90dd66014f6b3f0cd5e8d4c71f48691 Mon Sep 17 00:00:00 2001 From: Steven Bennetts Date: Thu, 30 Jul 2009 23:22:41 +0000 Subject: merge https://svn.aws.productengine.com/secondlife/export-from-ll/viewer-2-0/indra@1170 https://svn.aws.productengine.com/secondlife/pe/stable-1/indra@1187 -> viewer-2.0.0-3 --- indra/newview/llsidetray.cpp | 151 ++++++++++++------------------------------- 1 file changed, 40 insertions(+), 111 deletions(-) (limited to 'indra/newview/llsidetray.cpp') diff --git a/indra/newview/llsidetray.cpp b/indra/newview/llsidetray.cpp index abcff7cfb1..2688399139 100644 --- a/indra/newview/llsidetray.cpp +++ b/indra/newview/llsidetray.cpp @@ -63,24 +63,11 @@ LLSideTray* LLSideTray::sInstance = 0; class LLSideTrayInfoPanel: public LLPanel { -protected: - LLSideTrayInfoPanel(){} + public: - static LLSideTrayInfoPanel* createInstance(const string& image, const string& name,const string& description) - { - LLSideTrayInfoPanel* panel = new LLSideTrayInfoPanel(); - LLUICtrlFactory::getInstance()->buildPanel(panel,"panel_sidetray_tab_info.xml"); - if(panel) - panel->setData(image, name,description); - panel->setBorderVisible(true); - return panel; - - } - void setData(const string& image, const string& name,const string& description) + LLSideTrayInfoPanel():LLPanel() { - getChild("tab_name",false,false)->setValue(name); - getChild("tab_description",false,false)->setValue(description); - getChild("tab_icon",false,false)->setValue(image); + setBorderVisible(true); } BOOL handleHover(S32 x, S32 y, MASK mask) @@ -91,12 +78,19 @@ public: BOOL handleMouseUp(S32 x, S32 y, MASK mask) { + std::string name = getName(); onCommit(); + LLSideTray::getInstance()->selectTabByName(name); return LLPanel::handleMouseUp(x,y,mask); } + void reshape (S32 width, S32 height, BOOL called_from_parent ) + { + return LLPanel::reshape(width, height, called_from_parent); + } }; +static LLRegisterPanelClassWrapper t_people("panel_sidetray_home_info"); LLSideTray* LLSideTray::getInstance() { @@ -113,7 +107,7 @@ bool LLSideTray::instanceCreated () return sInstance!=0; } -LLSideTrayTab::LLSideTrayTab(const Params& params):mAccordionCtrl(0) +LLSideTrayTab::LLSideTrayTab(const Params& params):mMainPanel(0) { mImagePath = params.image_path; @@ -124,30 +118,12 @@ LLSideTrayTab::~LLSideTrayTab() { } -void LLSideTrayTab::addPanel(LLPanel* panel) -{ - //addChild(panel,false); -} - bool LLSideTrayTab::addChild(LLView* view, S32 tab_group) { - if(mAccordionCtrl == 0) - { - mAccordionCtrl = new LLAccordionCtrl(); - mAccordionCtrl->setVisible(TRUE); - LLPanel::addChild(mAccordionCtrl,tab_group); - } - - - bool res = true; - if(TAB_PANEL_CAPTION_NAME != view->getName())//skip our caption panel - { - mAccordionCtrl->addCollapsibleCtrl(view); - } - else - res = LLPanel::addChild(view,tab_group); - - return res; + if(mMainPanel == 0 && TAB_PANEL_CAPTION_NAME != view->getName())//skip our caption panel + mMainPanel = view; + return LLPanel::addChild(view,tab_group); + //return res; } @@ -185,17 +161,18 @@ void LLSideTrayTab::arrange(S32 width, S32 height ) offset = title_panel->getRect().getHeight(); } - LLRect sRect = mAccordionCtrl->getRect(); + LLRect sRect = mMainPanel->getRect(); sRect.setLeftTopAndSize( splitter_margin, height - offset - splitter_margin, width - 2*splitter_margin, height - offset - 2*splitter_margin); - mAccordionCtrl->setRect(sRect); + mMainPanel->reshape(sRect.getWidth(),sRect.getHeight()); + mMainPanel->setRect(sRect); + + - mAccordionCtrl->setMaxWidth(sRect.getWidth()); - mAccordionCtrl->arrange(); } void LLSideTrayTab::reshape (S32 width, S32 height, BOOL called_from_parent ) { - if(!mAccordionCtrl) + if(!mMainPanel) return; S32 offset = 0; @@ -210,12 +187,12 @@ void LLSideTrayTab::reshape (S32 width, S32 height, BOOL called_from_parent ) - LLRect sRect = mAccordionCtrl->getRect(); + LLRect sRect = mMainPanel->getRect(); sRect.setLeftTopAndSize( splitter_margin, height - offset - splitter_margin, width - 2*splitter_margin, height - offset - 2*splitter_margin); - mAccordionCtrl->setMaxWidth(sRect.getWidth()); - mAccordionCtrl->reshape(sRect.getWidth(), sRect.getHeight()); + //mMainPanel->setMaxWidth(sRect.getWidth()); + mMainPanel->reshape(sRect.getWidth(), sRect.getHeight()); - mAccordionCtrl->setRect(sRect); + mMainPanel->setRect(sRect); } @@ -231,7 +208,9 @@ void LLSideTrayTab::draw() void LLSideTrayTab::onOpen (const LLSD& key) { - mAccordionCtrl->onOpen(key); + LLPanel* panel = dynamic_cast(mMainPanel); + if(panel) + panel->onOpen(key); } LLSideTrayTab* LLSideTrayTab::createInstance () @@ -251,7 +230,6 @@ LLSideTray::LLSideTray(Params& params) ,mCollapsed(false) ,mCollapseButton(0) ,mMaxBarWidth(params.rect.width) - ,mHomeTab(0) { mCollapsed=params.collapsed; } @@ -261,10 +239,8 @@ BOOL LLSideTray::postBuild() { createButtons(); - createHomeTab(); - arrange(); - selectTabByName("home_tab"); + selectTabByName("sidebar_home"); if(mCollapsed) collapseSideBar(); @@ -333,8 +309,6 @@ bool LLSideTray::selectTabByIndex(size_t index) bool LLSideTray::selectTabByName (const std::string& name) { LLSideTrayTab* side_bar = getTab(name); - if(side_bar == 0 && name == "home_tab") - side_bar = mHomeTab; if(side_bar == NULL || side_bar == mActiveTab) return false; @@ -416,9 +390,10 @@ void LLSideTray::createButtons () mCollapseButton = createButton(EXPANDED_NAME,"",boost::bind(&LLSideTray::onToggleCollapse, this)); //create buttons for tabs - child_vector_const_iter_t child_it; + child_vector_const_iter_t child_it = mTabs.begin(); + ++child_it; - for ( child_it = mTabs.begin(); child_it != mTabs.end(); ++child_it) + for ( ; child_it != mTabs.end(); ++child_it) { LLSideTrayTab* sidebar_tab = dynamic_cast(*child_it); if(sidebar_tab == NULL) @@ -445,7 +420,7 @@ void LLSideTray::onToggleCollapse() if(mCollapsed) { expandSideBar(); - selectTabByName("home_tab"); + selectTabByName("sidebar_home"); } else collapseSideBar(); @@ -517,10 +492,6 @@ void LLSideTray::arrange () sidebar_tab->setRect(ctrl_rect); sidebar_tab->arrange(mMaxBarWidth,getRect().getHeight()); } - - mHomeTab->setRect(ctrl_rect); - mHomeTab->arrange(mMaxBarWidth,getRect().getHeight()); - } void LLSideTray::collapseSideBar () @@ -619,19 +590,16 @@ void LLSideTray::reshape (S32 width, S32 height, BOOL called_from_parent) sidebar_tab->setRect(ctrl_rect); } - - mHomeTab->reshape(mMaxBarWidth,getRect().getHeight()); - ctrl_rect.setLeftTopAndSize(sidetray_params.default_button_width,getRect().getHeight(),mMaxBarWidth,getRect().getHeight()); - mHomeTab->setRect(ctrl_rect); - - } /** * Activate tab with "panel_name" panel - * if no such tab - return false, otherwise true + * if no such tab - return false, otherwise true. + * TODO* In some cases a pointer to a panel of + * a specific class may be needed so this method + * would need to use templates. */ -bool LLSideTray::showPanel (const std::string& panel_name, const LLSD& params) +LLPanel* LLSideTray::showPanel (const std::string& panel_name, const LLSD& params) { //arrange tabs child_vector_const_iter_t child_it; @@ -644,51 +612,12 @@ bool LLSideTray::showPanel (const std::string& panel_name, const LLSD& params) LLPanel* panel = dynamic_cast(view); if(panel) panel->onOpen(params); - return true; + return panel; } } - return false; + return NULL; } -void LLSideTray::createHomeTab() -{ - mHomeTab = LLSideTrayTab::createInstance(); - child_vector_iter_t child_it; - for ( child_it = mTabs.begin(); child_it != mTabs.end(); ++child_it) - { - LLSideTrayTab* sidebar_tab = dynamic_cast(*child_it); - if(sidebar_tab == NULL) - continue; - - LLPanel* panel = LLSideTrayInfoPanel::createInstance(sidebar_tab->mImagePath,sidebar_tab->getTabTitle(),sidebar_tab->getDescription()); - - panel->setCommitCallback(boost::bind(&LLSideTray::onTabButtonClick, this, sidebar_tab->getName())); - - LLAccordionCtrlTab::Params panel_params; - panel_params.display_children(true); - panel_params.collapsible(false); - panel_params.header_visible(false); - panel_params.can_resize(false); - panel_params.min_height(200); - panel_params.padding_left(10); - panel_params.padding_right(10); - panel_params.padding_top(5); - panel_params.padding_bottom(5); - panel_params.name(sidebar_tab->getTabTitle()); - - LLAccordionCtrlTab* ctrl = LLUICtrlFactory::create(panel_params); - - - ctrl->setPanel(panel); - ctrl->postBuild(); - mHomeTab->addChild(ctrl,0); - } - - mHomeTab->setBackgroundVisible(true); - mHomeTab->postBuild(); - - LLUICtrl::addChild(mHomeTab, 0); -} static const S32 fake_offset = 132; static const S32 fake_top_offset = 78; -- cgit v1.2.3