mirror of
https://github.com/FirestormViewer/phoenix-firestorm.git
synced 2026-08-14 08:53:53 +00:00
Since arrange is no longer part of LLInventoryItemsList::doIdle(), reduced time limit.
This commit is contained in:
@@ -47,6 +47,8 @@ static constexpr F32 AUTO_SCROLL_RATE_ACCEL = 120.f;
|
||||
|
||||
static LLDefaultChildRegistry::Register<LLAccordionCtrl> t2("accordion");
|
||||
|
||||
std::set<LLAccordionCtrl*> LLAccordionCtrl::sPendingArrange;
|
||||
|
||||
LLAccordionCtrl::LLAccordionCtrl(const Params& params):LLPanel(params)
|
||||
, mFitParent(params.fit_parent)
|
||||
, mNoVisibleTabsOrigString(params.no_visible_tabs_text.initial_value().asString())
|
||||
@@ -163,7 +165,11 @@ bool LLAccordionCtrl::postBuild()
|
||||
//---------------------------------------------------------------------------------
|
||||
LLAccordionCtrl::~LLAccordionCtrl()
|
||||
{
|
||||
mAccordionTabs.clear();
|
||||
if (mArrangePending)
|
||||
{
|
||||
sPendingArrange.erase(this);
|
||||
}
|
||||
mAccordionTabs.clear();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------
|
||||
@@ -184,7 +190,7 @@ void LLAccordionCtrl::reshape(S32 width, S32 height, bool called_from_parent)
|
||||
// necessary text paddings can be set via h_pad and v_pad
|
||||
mNoVisibleTabsHelpText->setRect(getLocalRect());
|
||||
|
||||
arrange();
|
||||
scheduleArrange();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------
|
||||
@@ -328,7 +334,7 @@ void LLAccordionCtrl::addCollapsibleCtrl(LLAccordionCtrlTab* accordion_tab)
|
||||
mAccordionTabs.push_back(accordion_tab);
|
||||
|
||||
accordion_tab->setDropDownStateChangedCallback( boost::bind(&LLAccordionCtrl::onCollapseCtrlCloseOpen, this, (S16)(mAccordionTabs.size() - 1)) );
|
||||
arrange();
|
||||
scheduleArrange();
|
||||
}
|
||||
|
||||
void LLAccordionCtrl::removeCollapsibleCtrl(LLAccordionCtrlTab* accordion_tab)
|
||||
@@ -685,8 +691,9 @@ S32 LLAccordionCtrl::notifyParent(const LLSD& info)
|
||||
std::string str_action = info["action"];
|
||||
if (str_action == "size_changes")
|
||||
{
|
||||
//
|
||||
arrange();
|
||||
// Multiple children can request an arrange,
|
||||
// but only need to do it once so schedule it for later.
|
||||
scheduleArrange();
|
||||
return 1;
|
||||
}
|
||||
if (str_action == "select_next")
|
||||
@@ -928,3 +935,25 @@ void LLAccordionCtrl::collapseAllTabs()
|
||||
arrange();
|
||||
}
|
||||
}
|
||||
|
||||
void LLAccordionCtrl::scheduleArrange()
|
||||
{
|
||||
if (!mArrangePending)
|
||||
{
|
||||
mArrangePending = true;
|
||||
sPendingArrange.insert(this);
|
||||
}
|
||||
}
|
||||
|
||||
void LLAccordionCtrl::updateClass()
|
||||
{
|
||||
for (LLAccordionCtrl* inst : sPendingArrange)
|
||||
{
|
||||
if (inst)
|
||||
{
|
||||
inst->mArrangePending = false;
|
||||
inst->arrange();
|
||||
}
|
||||
}
|
||||
sPendingArrange.clear();
|
||||
}
|
||||
|
||||
@@ -142,6 +142,9 @@ public:
|
||||
|
||||
void setSkipScrollToChild(bool skip) { mSkipScrollToChild = skip; }
|
||||
|
||||
void scheduleArrange();
|
||||
static void updateClass();
|
||||
|
||||
private:
|
||||
void initNoTabsWidget(const LLTextBox::Params& tb_params);
|
||||
void updateNoTabsHelpTextVisibility();
|
||||
@@ -188,12 +191,15 @@ private:
|
||||
LLTextBox* mNoVisibleTabsHelpText = nullptr;
|
||||
|
||||
bool mSkipScrollToChild = false;
|
||||
bool mArrangePending = false;
|
||||
|
||||
std::string mNoMatchedTabsOrigString;
|
||||
std::string mNoVisibleTabsOrigString;
|
||||
|
||||
LLAccordionCtrlTab* mSelectedTab = nullptr;
|
||||
const LLTabComparator* mTabComparator = nullptr;
|
||||
|
||||
static std::set<LLAccordionCtrl*> sPendingArrange;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -145,6 +145,7 @@ void LLInventoryItemsList::updateSelection()
|
||||
bool LLInventoryItemsList::doIdle()
|
||||
{
|
||||
if (mRefreshState == REFRESH_COMPLETE) return true; // done
|
||||
LL_PROFILE_ZONE_SCOPED;
|
||||
|
||||
if (isInVisibleChain() || mForceRefresh || !getFilterSubString().empty())
|
||||
{
|
||||
@@ -166,7 +167,7 @@ void LLInventoryItemsList::idle(void* user_data)
|
||||
|
||||
using namespace std::chrono;
|
||||
auto start = steady_clock::now();
|
||||
const milliseconds time_limit = milliseconds(3);
|
||||
const milliseconds time_limit = milliseconds(2);
|
||||
const auto end_time = start + time_limit;
|
||||
S32 max_update_count = 50;
|
||||
|
||||
|
||||
@@ -69,6 +69,7 @@ LLPanelInventoryListItemBase::Params::Params()
|
||||
|
||||
LLPanelInventoryListItemBase* LLPanelInventoryListItemBase::create(LLViewerInventoryItem* item)
|
||||
{
|
||||
LL_PROFILE_ZONE_SCOPED_CATEGORY_UI;
|
||||
LLPanelInventoryListItemBase* list_item = NULL;
|
||||
if (item)
|
||||
{
|
||||
@@ -189,6 +190,7 @@ void LLPanelInventoryListItemBase::setShowWidget(LLUICtrl* ctrl, bool show)
|
||||
|
||||
bool LLPanelInventoryListItemBase::postBuild()
|
||||
{
|
||||
LL_PROFILE_ZONE_SCOPED_CATEGORY_UI;
|
||||
LLViewerInventoryItem* inv_item = getItem();
|
||||
if (inv_item)
|
||||
{
|
||||
|
||||
@@ -568,6 +568,10 @@ void LLOutfitsList::onRefreshComplete(LLUICtrl* ctrl)
|
||||
if (!ctrl || getFilterSubString().empty())
|
||||
return;
|
||||
|
||||
LL_PROFILE_ZONE_SCOPED;
|
||||
|
||||
// TODO: We are doing it multiple times per frame on init
|
||||
// as multiple lists are refreshing. Needs improvements.
|
||||
for (outfits_map_t::iterator
|
||||
iter = mOutfitsMap.begin(),
|
||||
iter_end = mOutfitsMap.end();
|
||||
|
||||
@@ -86,6 +86,7 @@
|
||||
#include "raytrace.h"
|
||||
|
||||
// newview includes
|
||||
#include "llaccordionctrl.h"
|
||||
#include "llbox.h"
|
||||
#include "llchicletbar.h"
|
||||
#include "llconsole.h"
|
||||
@@ -3440,6 +3441,8 @@ void LLViewerWindow::updateUI()
|
||||
|
||||
LLConsole::updateClass();
|
||||
|
||||
// execute postponed arrange calls
|
||||
LLAccordionCtrl::updateClass();
|
||||
// animate layout stacks so we have up to date rect for world view
|
||||
LLLayoutStack::updateClass();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user