LLFolderViewItem* LLLandmarksPanel::selectItemInAccordionTab(LLPlacesInventoryPanel* inventory_list, const std::string& tab_name, const LLUUID& obj_id, BOOL take_keyboard_focus) const { if (!inventory_list) return NULL; LLFolderView* root = inventory_list->getRootFolder(); LLFolderViewItem* item = inventory_list->getItemByID(obj_id); if (!item) return NULL; LLAccordionCtrlTab* tab = getChild<LLAccordionCtrlTab>(tab_name); if (!tab->isExpanded()) { tab->changeOpenClose(false); } root->setSelection(item, FALSE, take_keyboard_focus); LLAccordionCtrl* accordion = getChild<LLAccordionCtrl>("landmarks_accordion"); LLRect screen_rc; localRectToScreen(item->getRect(), &screen_rc); accordion->notifyParent(LLSD().with("scrollToShowRect", screen_rc.getValue())); return item; }
BOOL LLAccordionCtrlTab::LLAccordionCtrlTabHeader::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void* cargo_data, EAcceptance* accept, std::string& tooltip_msg) { LLAccordionCtrlTab* parent = dynamic_cast<LLAccordionCtrlTab*>(getParent()); if ( parent && !parent->getDisplayChildren() && parent->getCollapsible() && parent->canOpenClose() ) { if (mAutoOpenTimer.getStarted()) { if (mAutoOpenTimer.getElapsedTimeF32() > AUTO_OPEN_TIME) { parent->changeOpenClose(false); mAutoOpenTimer.stop(); return TRUE; } } else mAutoOpenTimer.start(); } return LLUICtrl::handleDragAndDrop(x, y, mask, drop, cargo_type, cargo_data, accept, tooltip_msg); }
// virtual void LLLandmarksPanel::onSearchEdit(const std::string& string) { // give FolderView a chance to be refreshed. So, made all accordions visible for (accordion_tabs_t::const_iterator iter = mAccordionTabs.begin(); iter != mAccordionTabs.end(); ++iter) { LLAccordionCtrlTab* tab = *iter; tab->setVisible(TRUE); // expand accordion to see matched items in each one. See EXT-2014. if (string != "") { tab->changeOpenClose(false); } LLPlacesInventoryPanel* inventory_list = dynamic_cast<LLPlacesInventoryPanel*>(tab->getAccordionView()); if (NULL == inventory_list) continue; filter_list(inventory_list, string); } if (sFilterSubString != string) sFilterSubString = string; // show all folders in Landmarks Accordion for empty filter // only if Landmarks inventory folder is not empty updateShowFolderState(); }
void LLOutfitsList::expand_all_folders() { for (outfits_map_t::iterator iter = mOutfitsMap.begin(); iter != mOutfitsMap.end(); ++iter) { LLAccordionCtrlTab* tab = iter->second; if(tab && !tab->isExpanded()) { tab->changeOpenClose(false); } } }
void LLPanelPeople::showAccordion(const std::string name, bool show) { if(name.empty()) { llwarns << "No name provided" << llendl; return; } LLAccordionCtrlTab* tab = getChild<LLAccordionCtrlTab>(name); tab->setVisible(show); if(show) { // don't expand accordion if it was collapsed by user if(!isAccordionCollapsedByUser(tab)) { // expand accordion tab->changeOpenClose(false); } } }