//-----------------------------------------------------------------------------
// rebuild()
//-----------------------------------------------------------------------------
void LLUICtrlFactory::rebuild()
{
	built_panel_t built_panels = mBuiltPanels;
	mBuiltPanels.clear();
	built_panel_t::iterator built_panel_it;
	for (built_panel_it = built_panels.begin();
		built_panel_it != built_panels.end();
		++built_panel_it)
	{
		std::string filename = built_panel_it->second;
		LLPanel* panelp = built_panel_it->first.get();
		if (!panelp)
		{
			continue;
		}
		llinfos << "Rebuilding UI panel " << panelp->getName() 
			<< " from " << filename
			<< llendl;
		BOOL visible = panelp->getVisible();
		panelp->setVisible(FALSE);
		panelp->setFocus(FALSE);
		panelp->deleteAllChildren();

		buildPanel(panelp, filename.c_str(), &panelp->getFactoryMap());
		panelp->setVisible(visible);
	}

	built_floater_t::iterator built_floater_it;
	for (built_floater_it = mBuiltFloaters.begin();
		built_floater_it != mBuiltFloaters.end();
		++built_floater_it)
	{
		LLFloater* floaterp = built_floater_it->first.get();
		if (!floaterp)
		{
			continue;
		}
		std::string filename = built_floater_it->second;
		llinfos << "Rebuilding UI floater " << floaterp->getName()
			<< " from " << filename
			<< llendl;
		BOOL visible = floaterp->getVisible();
		floaterp->setVisible(FALSE);
		floaterp->setFocus(FALSE);
		floaterp->deleteAllChildren();

		gFloaterView->removeChild(floaterp);
		buildFloater(floaterp, filename, &floaterp->getFactoryMap());
		floaterp->setVisible(visible);
	}
}
Example #2
0
// virtual
void LLInspectToast::onOpen(const LLSD& notification_id)
{
	LLInspect::onOpen(notification_id);
	LLToast* toast = mScreenChannel->getToastByNotificationID(notification_id);
	if (toast == NULL)
	{
		llwarns << "Could not get requested toast  from screen channel." << llendl;
		return;
	}
	mConnection = toast->setOnToastDestroyedCallback(boost::bind(&LLInspectToast::onToastDestroy, this, _1));

	LLPanel * panel = toast->getPanel();
	panel->setVisible(TRUE);
	panel->setMouseOpaque(FALSE);
	if(mPanel != NULL && mPanel->getParent() == this)
	{
		removeChild(mPanel);
	}
	addChild(panel);
	panel->setFocus(TRUE);
	mPanel = panel;


	LLRect panel_rect;
	panel_rect = panel->getRect();
	reshape(panel_rect.getWidth(), panel_rect.getHeight());

	LLUI::positionViewNearMouse(this);
}
// Checked: 2010-02-28 (RLVa-1.4.0a) | Added: RLVa-1.2.0a
void RlvUIEnabler::onToggleShowMinimap()
{
    bool fEnable = !gRlvHandler.hasBehaviour(RLV_BHVR_SHOWMINIMAP);

    // Start or stop filtering showing the mini-map floater
    if (!fEnable)
        addGenericFloaterFilter("mini_map");
    else
        removeGenericFloaterFilter("mini_map");

    // Hide the mini-map floater if it's currently visible (or restore it if it was previously visible)
    static bool fPrevVisibile = false;
    if ( (!fEnable) && ((fPrevVisibile = LLFloaterReg::instanceVisible("mini_map"))) )
        LLFloaterReg::hideInstance("mini_map");
    else if ( (fEnable) && (fPrevVisibile) )
        LLFloaterReg::showInstance("mini_map");

    // Break/reestablish the visibility connection for the nearby people panel embedded minimap instance
    LLPanel* pPeoplePanel = LLFloaterSidePanelContainer::getPanel("people", "panel_people");
    LLPanel* pNetMapPanel = (pPeoplePanel) ? pPeoplePanel->getChild<LLPanel>("minimaplayout", TRUE) : NULL;  //AO: firestorm specific
    RLV_ASSERT( (pPeoplePanel) && (pNetMapPanel) );
    if (pNetMapPanel)
    {
        pNetMapPanel->setMakeVisibleControlVariable( (fEnable) ? gSavedSettings.getControl("ShowRadarMinimap").get() : NULL);
        // Reestablishing the visiblity connection will show the panel if needed so we only need to take care of hiding it when needed
        if ( (!fEnable) && (pNetMapPanel->getVisible()) )
            pNetMapPanel->setVisible(false);
    }

    // Break/reestablish the visibility connection for the radar panel embedded minimap instance
    LLFloater* pRadarFloater = LLFloaterReg::getInstance("fs_radar");
    LLPanel* pRadarNetMapPanel = (pRadarFloater) ? pRadarFloater->getChild<LLPanel>("minimaplayout", TRUE) : NULL;  //AO: firestorm specific
    RLV_ASSERT( (pRadarFloater) && (pRadarNetMapPanel) );
    if (pRadarNetMapPanel)
    {
        pRadarNetMapPanel->setMakeVisibleControlVariable( (fEnable) ? gSavedSettings.getControl("ShowRadarMinimap").get() : NULL);
        // Reestablishing the visiblity connection will show the panel if needed so we only need to take care of hiding it when needed
        if ( (!fEnable) && (pRadarNetMapPanel->getVisible()) )
            pRadarNetMapPanel->setVisible(false);
    }
}
Example #4
0
void LLFlatListViewEx::filterItems()
{
	typedef std::vector <LLPanel*> item_panel_list_t;

	std::string cur_filter = mFilterSubString;
	LLStringUtil::toUpper(cur_filter);

	LLSD action;
	action.with("match_filter", cur_filter);

	item_panel_list_t items;
	getItems(items);

	mHasMatchedItems = false;
	for (item_panel_list_t::iterator
			 iter = items.begin(),
			 iter_end = items.end();
		 iter != iter_end; ++iter)
	{
		LLPanel* pItem = (*iter);
		// 0 signifies that filter is matched,
		// i.e. we don't hide items that don't support 'match_filter' action, separators etc.
		if (0 == pItem->notify(action))
		{
			mHasMatchedItems = true;
			pItem->setVisible(true);
		}
		else
		{
			// TODO: implement (re)storing of current selection.
			if(!mForceShowingUnmatchedItems)
			{
				selectItem(pItem, false);
			}
			pItem->setVisible(mForceShowingUnmatchedItems);
		}
	}

	sort();
	notifyParentItemsRectChanged();
}
bool LLPanelMe::notifyChildren(const LLSD& info)
{
	if (info.has("task-panel-action") && info["task-panel-action"].asString() == "handle-tri-state")
	{
		// Implement task panel tri-state behavior.
		//
		// When the button of an active open task panel is clicked, side tray
		// calls notifyChildren() on the panel, passing task-panel-action=>handle-tri-state as an argument.
		// The task panel is supposed to handle this by reverting to the default view,
		// i.e. closing any dependent panels like "pick info" or "profile edit".

		bool on_default_view = true;

		const LLRect& task_panel_rect = getRect();
		for (LLView* child = getFirstChild(); child; child = findNextSibling(child))
		{
			LLPanel* panel = dynamic_cast<LLPanel*>(child);
			if (!panel)
				continue;

			// *HACK: implement panel stack instead (e.g. me->pick_info->pick_edit).
			if (panel->getRect().getWidth()  == task_panel_rect.getWidth()  &&
				panel->getRect().getHeight() == task_panel_rect.getHeight() &&
				panel->getVisible())
			{
				panel->setVisible(FALSE);
				on_default_view = false;
			}
		}
		
		if (on_default_view)
			LLSideTray::getInstance()->collapseSideBar();

		return true; // this notification is only supposed to be handled by task panels 
	}

	return LLPanel::notifyChildren(info);
}
void LLNavigationBar::showNavigationPanel(BOOL visible)
{
	bool fpVisible = gSavedSettings.getBOOL("ShowNavbarFavoritesPanel");

	LLFavoritesBarCtrl* fb = getChild<LLFavoritesBarCtrl>("favorite");
	LLPanel* navPanel = getChild<LLPanel>("navigation_panel");

	LLRect nbRect(getRect());
	LLRect fbRect(fb->getRect());

	navPanel->setVisible(visible);

	if (visible)
	{
		if (fpVisible)
		{
			// Navigation Panel must be shown. Favorites Panel is visible.

			nbRect.setLeftTopAndSize(nbRect.mLeft, nbRect.mTop, nbRect.getWidth(), mDefaultNbRect.getHeight());
			fbRect.setLeftTopAndSize(fbRect.mLeft, mDefaultFpRect.mTop, fbRect.getWidth(), fbRect.getHeight());

			// this is duplicated in 'else' section because it should be called BEFORE fb->reshape
			reshape(nbRect.getWidth(), nbRect.getHeight());
			setRect(nbRect);
			// propagate size to parent container
			getParent()->reshape(nbRect.getWidth(), nbRect.getHeight());

			fb->reshape(fbRect.getWidth(), fbRect.getHeight());
			fb->setRect(fbRect);
		}
		else
		{
			// Navigation Panel must be shown. Favorites Panel is hidden.

			S32 height = mDefaultNbRect.getHeight() - mDefaultFpRect.getHeight();
			nbRect.setLeftTopAndSize(nbRect.mLeft, nbRect.mTop, nbRect.getWidth(), height);

			reshape(nbRect.getWidth(), nbRect.getHeight());
			setRect(nbRect);
			getParent()->reshape(nbRect.getWidth(), nbRect.getHeight());
		}
	}
	else
	{
		if (fpVisible)
		{
			// Navigation Panel must be hidden. Favorites Panel is visible.

			nbRect.setLeftTopAndSize(nbRect.mLeft, nbRect.mTop, nbRect.getWidth(), fbRect.getHeight());
			fbRect.setLeftTopAndSize(fbRect.mLeft, fbRect.getHeight(), fbRect.getWidth(), fbRect.getHeight());

			// this is duplicated in 'else' section because it should be called BEFORE fb->reshape
			reshape(nbRect.getWidth(), nbRect.getHeight());
			setRect(nbRect);
			getParent()->reshape(nbRect.getWidth(), nbRect.getHeight());

			fb->reshape(fbRect.getWidth(), fbRect.getHeight());
			fb->setRect(fbRect);
		}
		else
		{
			// Navigation Panel must be hidden. Favorites Panel is hidden.

			nbRect.setLeftTopAndSize(nbRect.mLeft, nbRect.mTop, nbRect.getWidth(), 0);

			reshape(nbRect.getWidth(), nbRect.getHeight());
			setRect(nbRect);
			getParent()->reshape(nbRect.getWidth(), nbRect.getHeight());
		}
	}

	childSetVisible("bg_icon", fpVisible);
	childSetVisible("bg_icon_no_fav", !fpVisible);
}