FIRE-11428: Another attempt in removing the viewer freezing for a couple of second the first time a script dialog opens

Cause of the issue: The viewer has to parse the main view twice for two children
residing in another, referenced XML file which has to be loaded and parsed from
the file system twice. Since the widgets view are looking for are in the
navigation bar panel, we can use LLNavigationBar singleton instance to get access
to the children we are looking for without having to load the XML file again - hopefully
Ansariel 2015-03-01 00:13:02 +01:00
parent e283db1f01
commit 075157f348
1 changed files with 9 additions and 8 deletions

View File

@ -48,6 +48,7 @@
// <FS:Zi> Dialog Stacking browser
#include "dialogstack.h"
#include "llbutton.h"
#include "llnavigationbar.h"
// </FS:Zi>
//////////////////////////////////////////////////////////////////////////
@ -790,26 +791,26 @@ LLScriptFloaterManager::LLScriptFloaterManager()
S32 LLScriptFloaterManager::getTopPad()
{
// initialize if needed
if(mNavigationPanelPad==-1)
if (mNavigationPanelPad == -1)
{
mNavigationPanelPad=LLUI::getRootView()->getChild<LLView>("location_search_layout")->getRect().getHeight();
mNavigationPanelPad = LLNavigationBar::instance().getView()->getChild<LLView>("location_search_layout")->getRect().getHeight();
}
// initialize if needed
if(mFavoritesPanelPad==-1)
if (mFavoritesPanelPad == -1)
{
mFavoritesPanelPad=LLUI::getRootView()->getChild<LLView>("favorite")->getRect().getHeight();
mFavoritesPanelPad = LLNavigationBar::instance().getView()->getChild<LLView>("favorite")->getRect().getHeight();
}
S32 pad=0;
S32 pad = 0;
if (gSavedSettings.getBOOL("ShowNavbarNavigationPanel"))
{
pad=mNavigationPanelPad;
pad = mNavigationPanelPad;
}
if (gSavedSettings.getBOOL("ShowNavbarFavoritesPanel"))
{
pad+=mFavoritesPanelPad;
pad += mFavoritesPanelPad;
}
return pad;
@ -911,7 +912,7 @@ LLScriptFloater* LLScriptFloater::show(const LLUUID& notification_id)
floater->setDocked(false, true);
}
S32 topPad=LLScriptFloaterManager::instance().getTopPad();
S32 topPad = LLScriptFloaterManager::instance().getTopPad();
S32 bottomPad = 0;
if (gToolBarView->getToolbar(LLToolBarEnums::TOOLBAR_BOTTOM)->hasButtons())