mirror of
https://github.com/FirestormViewer/phoenix-firestorm.git
synced 2026-08-14 08:53:53 +00:00
FIRE-35598 cont. Update labels on non-named tabs only on filter focus blur to save few CPU cycles; Properly refresh Received Items filter while switching between tabs and Items are shown as a separate panel
Signed-off-by: PanteraPolnocy <panterapolnocy@gmail.com>
This commit is contained in:
@@ -196,6 +196,14 @@ bool FSInventoryCustomTabs::handleMouseDown(S32 x, S32 y)
|
||||
|
||||
void FSInventoryCustomTabs::onFilterFocusLost()
|
||||
{
|
||||
if (mParent)
|
||||
{
|
||||
auto* active = dynamic_cast<LLInventoryPanel*>(mParent->getActivePanel());
|
||||
if (active && isCustomTab(active) && !mExplicitlyNamed.count(active))
|
||||
{
|
||||
updateAutoLabel(active);
|
||||
}
|
||||
}
|
||||
save();
|
||||
}
|
||||
|
||||
@@ -246,6 +254,10 @@ void FSInventoryCustomTabs::noteActivePanel(LLInventoryPanel* panel)
|
||||
{
|
||||
if (mLastActivePanel && mLastActivePanel != panel && isCustomTab(mLastActivePanel))
|
||||
{
|
||||
if (!mExplicitlyNamed.count(mLastActivePanel))
|
||||
{
|
||||
updateAutoLabel(mLastActivePanel);
|
||||
}
|
||||
save();
|
||||
}
|
||||
if (panel && panel != mAddTabPanel && mTabs && mTabs->getIndexForPanel(panel) >= 0)
|
||||
@@ -264,15 +276,6 @@ void FSInventoryCustomTabs::onClosePressed(LLInventoryPanel* panel)
|
||||
onCloseClicked();
|
||||
}
|
||||
|
||||
void FSInventoryCustomTabs::onActiveFilterChanged(LLPanel* active_panel)
|
||||
{
|
||||
auto* inv_panel = dynamic_cast<LLInventoryPanel*>(active_panel);
|
||||
if (inv_panel && mPanels.count(inv_panel) && !mExplicitlyNamed.count(inv_panel))
|
||||
{
|
||||
updateAutoLabel(inv_panel);
|
||||
}
|
||||
}
|
||||
|
||||
void FSInventoryCustomTabs::notifyActiveFilterStateChanged()
|
||||
{
|
||||
if (!mParent || !isCustomTab(mParent->getActivePanel()))
|
||||
@@ -336,14 +339,6 @@ void FSInventoryCustomTabs::noteActivePanel(LLPanelMainInventory* parent, LLInve
|
||||
}
|
||||
}
|
||||
|
||||
void FSInventoryCustomTabs::onActiveFilterChanged(LLPanelMainInventory* parent, LLPanel* active)
|
||||
{
|
||||
if (auto* self = instanceFor(parent))
|
||||
{
|
||||
self->onActiveFilterChanged(active);
|
||||
}
|
||||
}
|
||||
|
||||
S32 FSInventoryCustomTabs::captureFilterGeneration(const LLPanelMainInventory* parent)
|
||||
{
|
||||
if (!parent)
|
||||
|
||||
@@ -53,7 +53,6 @@ public:
|
||||
bool handleMouseDown(S32 x, S32 y);
|
||||
|
||||
void noteActivePanel(LLInventoryPanel* panel);
|
||||
void onActiveFilterChanged(LLPanel* active_panel);
|
||||
void notifyActiveFilterStateChanged();
|
||||
|
||||
static void registerCommitCallbacks(LLPanelMainInventory* parent);
|
||||
@@ -74,7 +73,6 @@ public:
|
||||
static bool activePanelIsCustom(const LLPanelMainInventory* parent);
|
||||
static bool maybeHandleAddTabSelected(LLPanelMainInventory* parent);
|
||||
static void noteActivePanel(LLPanelMainInventory* parent, LLInventoryPanel* panel);
|
||||
static void onActiveFilterChanged(LLPanelMainInventory* parent, LLPanel* active);
|
||||
static S32 captureFilterGeneration(const LLPanelMainInventory* parent);
|
||||
static void notifyIfFilterChanged(LLPanelMainInventory* parent, S32 prev_generation);
|
||||
static bool handleRightMouseDown(LLPanelMainInventory* parent, S32 x, S32 y);
|
||||
|
||||
@@ -1114,7 +1114,10 @@ void LLPanelMainInventory::onFilterEdit(const std::string& search_string )
|
||||
|
||||
if (mInboxPanel)
|
||||
{
|
||||
mInboxPanel->onFilterEdit(search_string);
|
||||
// <FS:PP> FIRE-35598: Custom filters in inventory (feature idea: Catznip)
|
||||
// mInboxPanel->onFilterEdit(search_string);
|
||||
mInboxPanel->onFilterEdit(search_for);
|
||||
// </FS:PP>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1322,6 +1325,12 @@ void LLPanelMainInventory::onFilterSelected()
|
||||
}
|
||||
updateFilterDropdown(&filter); // <FS:Zi> Filter dropdown
|
||||
setFilterTextFromFilter();
|
||||
// <FS:PP> FIRE-35598: Custom filters in inventory (feature idea: Catznip)
|
||||
if (mInboxPanel && mActivePanel)
|
||||
{
|
||||
mInboxPanel->onFilterEdit(mActivePanel->getFilter().getFilterSubStringOrig());
|
||||
}
|
||||
// </FS:PP>
|
||||
}
|
||||
|
||||
const std::string LLPanelMainInventory::getFilterSubString()
|
||||
@@ -1332,7 +1341,6 @@ const std::string LLPanelMainInventory::getFilterSubString()
|
||||
void LLPanelMainInventory::setFilterSubString(const std::string& string)
|
||||
{
|
||||
mActivePanel->setFilterSubString(string);
|
||||
FSInventoryCustomTabs::onActiveFilterChanged(this, mActivePanel); // <FS:PP> FIRE-35598: Custom filters in inventory (feature idea: Catznip)
|
||||
}
|
||||
|
||||
bool LLPanelMainInventory::handleDragAndDrop(S32 x, S32 y, MASK mask, bool drop,
|
||||
|
||||
Reference in New Issue
Block a user