Esempio n. 1
0
void LLFloaterTexturePicker::onFilterEdit(const std::string& search_string )
{
	std::string upper_case_search_string = search_string;
	LLStringUtil::toUpper(upper_case_search_string);

	if (upper_case_search_string.empty())
	{
		if (mInventoryPanel->getFilterSubString().empty())
		{
			// current filter and new filter empty, do nothing
			return;
		}

		mSavedFolderState.setApply(TRUE);
		mInventoryPanel->getRootFolder()->applyFunctorRecursively(mSavedFolderState);
		// add folder with current item to list of previously opened folders
		LLOpenFoldersWithSelection opener;
		mInventoryPanel->getRootFolder()->applyFunctorRecursively(opener);
		mInventoryPanel->getRootFolder()->scrollToShowSelection();

	}
	else if (mInventoryPanel->getFilterSubString().empty())
	{
		// first letter in search term, save existing folder open state
		if (!mInventoryPanel->getRootFolder()->isFilterModified())
		{
			mSavedFolderState.setApply(FALSE);
			mInventoryPanel->getRootFolder()->applyFunctorRecursively(mSavedFolderState);
		}
	}

	mInventoryPanel->setFilterSubString(search_string);
}
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);
	}
}
void LLFloaterTexturePicker::onFilterEdit(const std::string& search_string )
{
	if (!mInventoryPanel)
	{
		return;
	}

	// set new filter string
	// Internally handles saving/restoring folder states.
	mInventoryPanel->setFilterSubString(search_string);
}
void LLPanelMarketplaceListings::onFilterEdit(const std::string& search_string)
{
	// Find active panel
	LLInventoryPanel* panel = (LLInventoryPanel*)getChild<LLTabContainer>("marketplace_filter_tabs")->getCurrentPanel();
	if (panel)
	{
		// Save filter string (needed when switching tabs)
		mFilterSubString = search_string;
		// Set filter string on active panel
		panel->setFilterSubString(mFilterSubString);
	}
}