SL-19379 Don't switch focus to other Inventory floater when creating an item in Gallery
parent
77753a31ab
commit
7ccfbd7c28
|
|
@ -90,6 +90,29 @@ void LLFloaterSidePanelContainer::closeFloater(bool app_quitting)
|
|||
}
|
||||
}
|
||||
|
||||
LLFloater* LLFloaterSidePanelContainer::getTopmostInventoryFloater()
|
||||
{
|
||||
LLFloater* topmost_floater = NULL;
|
||||
S32 z_min = S32_MAX;
|
||||
|
||||
LLFloaterReg::const_instance_list_t& inst_list = LLFloaterReg::getFloaterList("inventory");
|
||||
for (LLFloaterReg::const_instance_list_t::const_iterator iter = inst_list.begin(); iter != inst_list.end(); ++iter)
|
||||
{
|
||||
LLFloater* inventory_floater = (*iter);
|
||||
|
||||
if (inventory_floater && inventory_floater->getVisible())
|
||||
{
|
||||
S32 z_order = gFloaterView->getZOrder(inventory_floater);
|
||||
if (z_order < z_min)
|
||||
{
|
||||
z_min = z_order;
|
||||
topmost_floater = inventory_floater;
|
||||
}
|
||||
}
|
||||
}
|
||||
return topmost_floater;
|
||||
}
|
||||
|
||||
LLPanel* LLFloaterSidePanelContainer::openChildPanel(const std::string& panel_name, const LLSD& params)
|
||||
{
|
||||
LLView* view = findChildView(panel_name, true);
|
||||
|
|
|
|||
|
|
@ -57,6 +57,8 @@ public:
|
|||
|
||||
LLPanel* openChildPanel(const std::string& panel_name, const LLSD& params);
|
||||
|
||||
static LLFloater* getTopmostInventoryFloater();
|
||||
|
||||
static void showPanel(const std::string& floater_name, const LLSD& key);
|
||||
|
||||
static void showPanel(const std::string& floater_name, const std::string& panel_name, const LLSD& key);
|
||||
|
|
|
|||
|
|
@ -696,7 +696,7 @@ void LLInventoryGallery::updateAddedItem(LLUUID item_id)
|
|||
LLInventoryGalleryItem* item = buildGalleryItem(name, item_id, obj->getType(), thumbnail_id, inventory_type, misc_flags, obj->getIsLinkType(), is_worn);
|
||||
mItemMap.insert(LLInventoryGallery::gallery_item_map_t::value_type(item_id, item));
|
||||
item->setRightMouseDownCallback(boost::bind(&LLInventoryGallery::showContextMenu, this, _1, _2, _3, item_id));
|
||||
item->setFocusReceivedCallback(boost::bind(&LLInventoryGallery::onChangeItemSelection, this, item_id));
|
||||
item->setFocusReceivedCallback(boost::bind(&LLInventoryGallery::changeItemSelection, this, item_id));
|
||||
if (mGalleryCreated)
|
||||
{
|
||||
addToGallery(item);
|
||||
|
|
@ -789,21 +789,21 @@ void LLInventoryGallery::showContextMenu(LLUICtrl* ctrl, S32 x, S32 y, const LLU
|
|||
}
|
||||
}
|
||||
|
||||
void LLInventoryGallery::onChangeItemSelection(const LLUUID& category_id)
|
||||
void LLInventoryGallery::changeItemSelection(const LLUUID& item_id)
|
||||
{
|
||||
if (mSelectedItemID == category_id)
|
||||
if ((mItemMap.count(item_id) > 0) && (mSelectedItemID == item_id))
|
||||
return;
|
||||
|
||||
if (mItemMap[mSelectedItemID])
|
||||
{
|
||||
mItemMap[mSelectedItemID]->setSelected(FALSE);
|
||||
}
|
||||
if (mItemMap[category_id])
|
||||
if (mItemMap[item_id])
|
||||
{
|
||||
mItemMap[category_id]->setSelected(TRUE);
|
||||
mItemMap[item_id]->setSelected(TRUE);
|
||||
}
|
||||
mSelectedItemID = category_id;
|
||||
signalSelectionItemID(category_id);
|
||||
mSelectedItemID = item_id;
|
||||
signalSelectionItemID(item_id);
|
||||
}
|
||||
|
||||
void LLInventoryGallery::updateMessageVisibility()
|
||||
|
|
|
|||
|
|
@ -110,6 +110,7 @@ public:
|
|||
void computeDifference(const LLInventoryModel::cat_array_t vcats, const LLInventoryModel::item_array_t vitems, uuid_vec_t& vadded, uuid_vec_t& vremoved);
|
||||
|
||||
void deselectItem(const LLUUID& category_id);
|
||||
void changeItemSelection(const LLUUID& item_id);
|
||||
void signalSelectionItemID(const LLUUID& category_id);
|
||||
boost::signals2::connection setSelectionChangeCallback(selection_change_callback_t cb);
|
||||
LLUUID getSelectedItemID() { return mSelectedItemID; }
|
||||
|
|
@ -121,7 +122,6 @@ public:
|
|||
|
||||
protected:
|
||||
|
||||
void onChangeItemSelection(const LLUUID& category_id);
|
||||
void showContextMenu(LLUICtrl* ctrl, S32 x, S32 y, const LLUUID& item_id);
|
||||
|
||||
void applyFilter(LLInventoryGalleryItem* item, const std::string& filter_substring);
|
||||
|
|
|
|||
|
|
@ -1793,6 +1793,20 @@ void LLInventoryPanel::openInventoryPanelAndSetSelection(BOOL auto_open, const L
|
|||
{
|
||||
sidepanel_inventory->selectAllItemsPanel();
|
||||
}
|
||||
|
||||
LLFloater* inventory_floater = LLFloaterSidePanelContainer::getTopmostInventoryFloater();
|
||||
if(!auto_open && inventory_floater && inventory_floater->getVisible())
|
||||
{
|
||||
LLSidepanelInventory *inventory_panel = inventory_floater->findChild<LLSidepanelInventory>("main_panel");
|
||||
LLPanelMainInventory* main_panel = inventory_panel->getMainInventoryPanel();
|
||||
if(main_panel->isSingleFolderMode() && main_panel->isGalleryViewMode())
|
||||
{
|
||||
main_panel->setGallerySelection(obj_id);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
LLInventoryPanel *active_panel = LLInventoryPanel::getActiveInventoryPanel(auto_open);
|
||||
|
||||
if (active_panel)
|
||||
|
|
|
|||
|
|
@ -2180,5 +2180,13 @@ LLInventoryFilter& LLPanelMainInventory::getCurrentFilter()
|
|||
return mActivePanel->getFilter();
|
||||
}
|
||||
}
|
||||
|
||||
void LLPanelMainInventory::setGallerySelection(const LLUUID& item_id)
|
||||
{
|
||||
if(mSingleFolderMode && isGalleryViewMode())
|
||||
{
|
||||
mInventoryGalleryPanel->changeItemSelection(item_id);
|
||||
}
|
||||
}
|
||||
// List Commands //
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
|||
|
|
@ -118,6 +118,7 @@ public:
|
|||
void onBackFolderClicked();
|
||||
void onForwardFolderClicked();
|
||||
void setSingleFolderViewRoot(const LLUUID& folder_id, bool clear_nav_history = true);
|
||||
void setGallerySelection(const LLUUID& item_id);
|
||||
LLUUID getSingleFolderViewRoot();
|
||||
bool isSingleFolderMode() { return mSingleFolderMode; }
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue