diff options
author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2023-05-03 18:46:18 +0300 |
---|---|---|
committer | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2023-05-03 18:46:18 +0300 |
commit | b3e02c4264a8a3b9d189b347d0faddf3ac21e87b (patch) | |
tree | ddc885fee38600d114b20c81ff6661d70ae5fc9f /indra | |
parent | 1866368673f06084860c30cbd78446f55f600a1e (diff) |
SL-19583 Scroll fixes
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llinventorypanel.cpp | 7 | ||||
-rw-r--r-- | indra/newview/llinventorypanel.h | 3 | ||||
-rw-r--r-- | indra/newview/llpanelmaininventory.cpp | 20 |
3 files changed, 25 insertions, 5 deletions
diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index c8c9d6c351..6d739c909c 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -2246,6 +2246,13 @@ void LLInventorySingleFolderPanel::doCreate(const LLSD& userdata) /* Asset Pre-Filtered Inventory Panel related class */ /************************************************************************/ +LLAssetFilteredInventoryPanel::LLAssetFilteredInventoryPanel(const Params& p) + : LLInventoryPanel(p) + , mAssetType(LLAssetType::AT_NONE) +{ +} + + void LLAssetFilteredInventoryPanel::initFromParams(const Params& p) { mAssetType = LLAssetType::lookup(p.filter_asset_type.getValue()); diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h index d334d55611..f2eab4a642 100644 --- a/indra/newview/llinventorypanel.h +++ b/indra/newview/llinventorypanel.h @@ -214,6 +214,7 @@ public: LLUUID getRootFolderID(); LLScrollContainer* getScrollableContainer() { return mScroller; } bool getAllowDropOnRoot() { return mParams.allow_drop_on_root; } + bool areViewsInitialized() { return mViewsInitialized == VIEWS_INITIALIZED && !mFolderRoot.get()->needsArrange(); } void onSelectionChange(const std::deque<LLFolderViewItem*> &items, BOOL user_action); @@ -455,7 +456,7 @@ public: void initFromParams(const Params& p); protected: - LLAssetFilteredInventoryPanel(const Params& p) : LLInventoryPanel(p) {} + LLAssetFilteredInventoryPanel(const Params& p); friend class LLUICtrlFactory; public: ~LLAssetFilteredInventoryPanel() {} diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 0a6ac5f92e..3110adff15 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -736,6 +736,8 @@ void LLPanelMainInventory::onClearSearch() inbox_panel->onClearSearch(); } } + + mCombinationShapeDirty = true; } void LLPanelMainInventory::onFilterEdit(const std::string& search_string ) @@ -793,6 +795,8 @@ void LLPanelMainInventory::onFilterEdit(const std::string& search_string ) inbox_panel->onFilterEdit(search_string); } } + + mCombinationShapeDirty = true; } @@ -1681,6 +1685,8 @@ void LLPanelMainInventory::setSingleFolderViewRoot(const LLUUID& folder_id, bool mCombinationInventoryPanel->changeFolderRoot(folder_id); } updateNavButtons(); + + mCombinationShapeDirty = true; } LLUUID LLPanelMainInventory::getSingleFolderViewRoot() @@ -2235,14 +2241,20 @@ void LLPanelMainInventory::onCombinationRootChanged(bool gallery_clicked) //force update scroll container mCombinationShapeDirty = true; + mCombinationInventoryPanel->reshape(1, 1); } void LLPanelMainInventory::updateCombinationVisibility() { - if(mSingleFolderMode && isCombinationViewMode() && mCombinationShapeDirty) + if(mSingleFolderMode + && isCombinationViewMode() + && mCombinationShapeDirty) { - mCombinationShapeDirty = false; - mCombinationInventoryPanel->reshape(1,1); // HACK: force reduce visible area + if (mCombinationInventoryPanel->areViewsInitialized()) + { + mCombinationShapeDirty = false; + mCombinationInventoryPanel->reshape(1,1); // HACK: force reduce visible area + } if (!mCombinationGalleryPanel->hasVisibleItems()) { mCombinationGalleryPanel->handleModifiedFilter(); @@ -2253,8 +2265,8 @@ void LLPanelMainInventory::updateCombinationVisibility() LLRect inner_galery_rect = mCombinationGalleryPanel->getScrollableContainer()->getScrolledViewRect(); LLScrollContainer* scroll = static_cast<LLScrollContainer*>(mCombinationScrollPanel); LLRect scroller_window_rect = scroll->getContentWindowRect(); - S32 desired_width = llmax(inv_inner_rect.getWidth(), scroller_window_rect.getWidth()); const S32 BORDER_PAD = 2; // two sides + S32 desired_width = llmax(inv_inner_rect.getWidth(), scroller_window_rect.getWidth() - BORDER_PAD); inv_rect.mBottom = 0; inv_rect.mRight = inv_rect.mLeft + desired_width; |