Skip to content
Snippets Groups Projects
Commit c273067c authored by Kitty Barnett's avatar Kitty Barnett
Browse files

- fixed : inventory sidebar tab should be hidden if undocked when @showinv=n restricted

--HG--
branch : RLVa
parent 600d60e4
No related branches found
No related tags found
No related merge requests found
......@@ -540,6 +540,32 @@ bool LLSideTray::isTabAttached(const std::string& name)
return std::find(mTabs.begin(), mTabs.end(), tab) != mTabs.end();
}
// [RLVa:KB] - Checked: 2010-09-07 (RLVa-1.2.1a) | Added: RLVa-1.2.1a
void LLSideTray::toggleTabDocked(const std::string& strTabName)
{
if (!isTabAttached(strTabName))
{
for (child_vector_iter_t itTab = mDetachedTabs.begin(); itTab != mDetachedTabs.end(); ++itTab)
{
LLSideTrayTab* pTab = *itTab;
if (strTabName == pTab->getName())
{
pTab->toggleTabDocked();
return;
}
}
}
else
{
LLSideTrayTab* pTab = getTab(strTabName);
if (pTab)
{
pTab->toggleTabDocked();
}
}
}
// [/RLVa:KB]
bool LLSideTray::hasTabs()
{
// The open/close tab doesn't count.
......
......@@ -176,6 +176,10 @@ class LLSideTray : public LLPanel, private LLDestroyClass<LLSideTray>
bool isTabAttached (const std::string& name);
// [RLVa:KB] - Checked: 2010-09-07 (RLVa-1.2.1a) | Added: RLVa-1.2.1a
void toggleTabDocked(const std::string& strTabName);
// [/RLVa:KB]
protected:
bool hasTabs ();
......
......@@ -170,18 +170,33 @@ void RlvUIEnabler::onToggleSetEnv()
}
}
// Checked: 2010-08-24 (RLVa-1.2.1a) | Modified: RLVa-1.2.1a
// Checked: 2010-09-07 (RLVa-1.2.1a) | Modified: RLVa-1.2.1a
void RlvUIEnabler::onToggleShowInv()
{
bool fEnable = !gRlvHandler.hasBehaviour(RLV_BHVR_SHOWINV);
//
// Enable/disable the "My Inventory" button on the sidebar button panel
// Enable/disable the "My Inventory" sidebar tab
//
LLSideTray* pSideTray = LLSideTray::getInstance();
RLV_ASSERT(pSideTray);
if (pSideTray)
{
// If the inventory sidebar tab is currently undocked we need to redock it first
if ( (!fEnable) && (!pSideTray->isTabAttached("sidebar_inventory")) )
{
// NOTE: redocking will expand the sidebar and select the redocked tab so we need enough information to undo that again
bool fCollapsed = pSideTray->getCollapsed();
const LLPanel* pActiveTab = pSideTray->getActiveTab();
pSideTray->toggleTabDocked("sidebar_inventory");
if (pActiveTab)
pSideTray->selectTabByName(pActiveTab->getName());
if (fCollapsed)
pSideTray->collapseSideBar();
}
LLButton* pInvBtn = pSideTray->getButtonFromName("sidebar_inventory");
RLV_ASSERT(pInvBtn);
if (pInvBtn)
......@@ -209,6 +224,7 @@ void RlvUIEnabler::onToggleShowInv()
// Enable/disable the "My Outfits" panel on the "My Appearance" sidebar tab
//
LLPanelOutfitsInventory* pAppearancePanel = LLPanelOutfitsInventory::findInstance();
RLV_ASSERT(pAppearancePanel);
if (pAppearancePanel)
{
LLTabContainer* pAppearanceTabs = pAppearancePanel->getAppearanceTabs();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment