void LLPanelMarketplaceListings::onTabChange() { // Find active panel LLInventoryPanel* panel = (LLInventoryPanel*)getChild<LLTabContainer>("marketplace_filter_tabs")->getCurrentPanel(); if (panel) { // If the panel doesn't allow drop on root, it doesn't allow the creation of new folder on root either LLButton* add_btn = getChild<LLButton>("add_btn"); add_btn->setEnabled(panel->getAllowDropOnRoot()); // Set filter string on active panel panel->setFilterSubString(mFilterSubString); // Show/hide the drop zone and resize the inventory tabs panel accordingly LLPanel* drop_zone = (LLPanel*)getChild<LLPanel>("marketplace_drop_zone"); bool drop_zone_visible = drop_zone->getVisible(); bool allow_drop_on_root = panel->getAllowDropOnRoot() && gSavedSettings.getBOOL("LiruEnableWIPUI"); if (drop_zone_visible != allow_drop_on_root) { LLPanel* tabs = (LLPanel*)getChild<LLPanel>("tab_container_panel"); S32 delta_height = drop_zone->getRect().getHeight(); delta_height = (drop_zone_visible ? delta_height : -delta_height); tabs->reshape(tabs->getRect().getWidth(),tabs->getRect().getHeight() + delta_height); tabs->translate(0,-delta_height); } drop_zone->setVisible(allow_drop_on_root); } }
bool LLPanelMarketplaceListings::allowDropOnRoot() { LLInventoryPanel* panel = (LLInventoryPanel*)getChild<LLTabContainer>("marketplace_filter_tabs")->getCurrentPanel(); return (panel ? panel->getAllowDropOnRoot() : false); }