From 075157f348eed87471b40b07ac7873de9f4aa2bb Mon Sep 17 00:00:00 2001 From: Ansariel Date: Sun, 1 Mar 2015 00:13:02 +0100 Subject: [PATCH] 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 --- indra/newview/llscriptfloater.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/indra/newview/llscriptfloater.cpp b/indra/newview/llscriptfloater.cpp index 7162306fcf..7e63451924 100755 --- a/indra/newview/llscriptfloater.cpp +++ b/indra/newview/llscriptfloater.cpp @@ -48,6 +48,7 @@ // Dialog Stacking browser #include "dialogstack.h" #include "llbutton.h" +#include "llnavigationbar.h" // ////////////////////////////////////////////////////////////////////////// @@ -790,26 +791,26 @@ LLScriptFloaterManager::LLScriptFloaterManager() S32 LLScriptFloaterManager::getTopPad() { // initialize if needed - if(mNavigationPanelPad==-1) + if (mNavigationPanelPad == -1) { - mNavigationPanelPad=LLUI::getRootView()->getChild("location_search_layout")->getRect().getHeight(); + mNavigationPanelPad = LLNavigationBar::instance().getView()->getChild("location_search_layout")->getRect().getHeight(); } // initialize if needed - if(mFavoritesPanelPad==-1) + if (mFavoritesPanelPad == -1) { - mFavoritesPanelPad=LLUI::getRootView()->getChild("favorite")->getRect().getHeight(); + mFavoritesPanelPad = LLNavigationBar::instance().getView()->getChild("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())