diff options
Diffstat (limited to 'indra/newview/llpanelmaininventory.cpp')
-rw-r--r-- | indra/newview/llpanelmaininventory.cpp | 32 |
1 files changed, 28 insertions, 4 deletions
diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index bc4998dd0c..1920cc2940 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -1,6 +1,6 @@ /** - * @file llsidepanelmaininventory.cpp - * @brief Implementation of llsidepanelmaininventory. + * @file llpanelmaininventory.cpp + * @brief Implementation of llpanelmaininventory. * * $LicenseInfo:firstyear=2001&license=viewerlgpl$ * Second Life Viewer Source Code @@ -95,8 +95,8 @@ private: /// LLPanelMainInventory ///---------------------------------------------------------------------------- -LLPanelMainInventory::LLPanelMainInventory() - : LLPanel(), +LLPanelMainInventory::LLPanelMainInventory(const LLPanel::Params& p) + : LLPanel(p), mActivePanel(NULL), mSavedFolderState(NULL), mFilterText(""), @@ -193,6 +193,9 @@ BOOL LLPanelMainInventory::postBuild() mMenuAdd->getChild<LLMenuItemGL>("Upload Animation")->setLabelArg("[COST]", upload_cost); mMenuAdd->getChild<LLMenuItemGL>("Bulk Upload")->setLabelArg("[COST]", upload_cost); + // Trigger callback for focus received so we can deselect items in inbox/outbox + LLFocusableElement::setFocusReceivedCallback(boost::bind(&LLPanelMainInventory::onFocusReceived, this)); + return TRUE; } @@ -572,6 +575,27 @@ void LLPanelMainInventory::updateItemcountText() getChild<LLUICtrl>("ItemcountText")->setValue(text); } +void LLPanelMainInventory::onFocusReceived() +{ + LLSidepanelInventory * sidepanel_inventory = LLSideTray::getInstance()->getPanel<LLSidepanelInventory>("sidepanel_inventory"); + + LLInventoryPanel * inbox_panel = sidepanel_inventory->findChild<LLInventoryPanel>("inventory_inbox"); + + if (inbox_panel) + { + inbox_panel->clearSelection(); + } + + LLInventoryPanel * outbox_panel = sidepanel_inventory->findChild<LLInventoryPanel>("inventory_outbox"); + + if (outbox_panel) + { + outbox_panel->clearSelection(); + } + + sidepanel_inventory->updateVerbs(); +} + void LLPanelMainInventory::setFilterTextFromFilter() { mFilterText = mActivePanel->getFilter()->getFilterText(); |