summaryrefslogtreecommitdiff
path: root/indra/newview/llinventorypanel.cpp
diff options
context:
space:
mode:
authorMatthew Breindel (Falcon) <falcon@lindenlab.com>2010-09-30 12:00:29 -0700
committerMatthew Breindel (Falcon) <falcon@lindenlab.com>2010-09-30 12:00:29 -0700
commit60f8c8279071b791fbc7179d8bc2bb9ca4880a03 (patch)
tree20a513fdb383dfd36ca0dbe0a99eacd72faad835 /indra/newview/llinventorypanel.cpp
parent569f3f4b06fc2f5a0fa658a49d519428983403f9 (diff)
parentd95b08c4a6830fc8a2319e77242d8f76eb4cbdae (diff)
Merge
Diffstat (limited to 'indra/newview/llinventorypanel.cpp')
-rw-r--r--indra/newview/llinventorypanel.cpp21
1 files changed, 19 insertions, 2 deletions
diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp
index 820520df9e..50adae09c0 100644
--- a/indra/newview/llinventorypanel.cpp
+++ b/indra/newview/llinventorypanel.cpp
@@ -916,6 +916,8 @@ BOOL is_inventorysp_active()
// static
LLInventoryPanel* LLInventoryPanel::getActiveInventoryPanel(BOOL auto_open)
{
+ S32 z_min = S32_MAX;
+ LLInventoryPanel* res = NULL;
// A. If the inventory side panel is open, use that preferably.
if (is_inventorysp_active())
{
@@ -925,11 +927,26 @@ LLInventoryPanel* LLInventoryPanel::getActiveInventoryPanel(BOOL auto_open)
return inventorySP->getActivePanel();
}
}
+ // or if it is in floater undocked from sidetray get it and remember z order of floater to later compare it
+ // with other inventory floaters order.
+ else if (!LLSideTray::getInstance()->isTabAttached("sidebar_inventory"))
+ {
+ LLSidepanelInventory *inventorySP =
+ dynamic_cast<LLSidepanelInventory *>(LLSideTray::getInstance()->getPanel("sidepanel_inventory"));
+ LLFloater* inv_floater = LLFloaterReg::findInstance("side_bar_tab", LLSD("sidebar_inventory"));
+ if (inventorySP && inv_floater)
+ {
+ res = inventorySP->getActivePanel();
+ z_min = gFloaterView->getZOrder(inv_floater);
+ }
+ else
+ {
+ llwarns << "Inventory tab is detached from sidetray, but either panel or floater were not found!" << llendl;
+ }
+ }
// B. Iterate through the inventory floaters and return whichever is on top.
LLFloaterReg::const_instance_list_t& inst_list = LLFloaterReg::getFloaterList("inventory");
- S32 z_min = S32_MAX;
- LLInventoryPanel* res = NULL;
for (LLFloaterReg::const_instance_list_t::const_iterator iter = inst_list.begin(); iter != inst_list.end(); ++iter)
{
LLFloaterInventory* iv = dynamic_cast<LLFloaterInventory*>(*iter);