diff options
| author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2023-05-24 22:51:02 +0300 | 
|---|---|---|
| committer | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2023-05-25 02:18:50 +0300 | 
| commit | 572e8269bcd5320daa66f4074e927c79869bf7de (patch) | |
| tree | 92c4bdbb5dd9280e3079243826bd952d9fec7cd9 | |
| parent | 505c15cf47c04e45f4a68790b5c63237a7bfcc9b (diff) | |
SL-19604 Creating new folders in combination views does not highlight created item
| -rw-r--r-- | indra/llui/llfolderview.cpp | 15 | ||||
| -rw-r--r-- | indra/newview/llinventorypanel.cpp | 14 | ||||
| -rw-r--r-- | indra/newview/llinventorypanel.h | 2 | ||||
| -rw-r--r-- | indra/newview/llpanelmaininventory.cpp | 22 | ||||
| -rw-r--r-- | indra/newview/llpanelmaininventory.h | 13 | 
5 files changed, 43 insertions, 23 deletions
| diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp index 7831aa92fb..798c00d0ca 100644 --- a/indra/llui/llfolderview.cpp +++ b/indra/llui/llfolderview.cpp @@ -694,11 +694,18 @@ void LLFolderView::draw()  		}  	} -	if (mRenameItem && mRenamer && mRenamer->getVisible() && !getVisibleRect().overlaps(mRenamer->getRect())) +	if (mRenameItem +        && mRenamer +        && mRenamer->getVisible())  	{ -		// renamer is not connected to the item we are renaming in any form so manage it manually -		// TODO: consider stopping on any scroll action instead of when out of visible area -		finishRenamingItem(); +        LLRect renamer_rect; +        localRectToOtherView(mRenamer->getRect(), &renamer_rect, mScrollContainer); +        if (!mScrollContainer->getRect().overlaps(renamer_rect)) +        { +            // renamer is not connected to the item we are renaming in any form so manage it manually +            // TODO: consider stopping on any scroll action instead of when out of visible area +            finishRenamingItem(); +        }  	}  	// skip over LLFolderViewFolder::draw since we don't want the folder icon, label,  diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 604bffb96e..2226384ba2 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -2107,6 +2107,7 @@ static LLDefaultChildRegistry::Register<LLInventorySingleFolderPanel> t_single_f  LLInventorySingleFolderPanel::LLInventorySingleFolderPanel(const Params& params)      : LLInventoryPanel(params) +    , mExternalScroller(NULL)  {      mBuildChildrenViews = false;      getFilter().setSingleFolderMode(true); @@ -2235,7 +2236,18 @@ void LLInventorySingleFolderPanel::updateSingleFolderRoot()              mScroller = LLUICtrlFactory::create<LLFolderViewScrollContainer>(scroller_params);              addChild(mScroller);              mScroller->addChild(mFolderRoot.get()); -            mFolderRoot.get()->setScrollContainer(mScroller); +            if (!mExternalScroller) +            { +                mFolderRoot.get()->setScrollContainer(mScroller); +            } +            else +            { +                // Hack to use exteranl scroll in combination view +                // Todo: find a way to avoid this +                // ideally combination view should be own inventory panel +                // instead of piggy backing on two different ones +                mFolderRoot.get()->setScrollContainer(mExternalScroller); +            }              mFolderRoot.get()->setFollowsAll();              mFolderRoot.get()->addChild(mFolderRoot.get()->mStatusTextBox); diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h index f323a6c6d7..7b54a5bbf2 100644 --- a/indra/newview/llinventorypanel.h +++ b/indra/newview/llinventorypanel.h @@ -421,6 +421,7 @@ public:      std::list<LLUUID> getNavForwardList() { return mForwardFolders; }      void setSelectCallback(const boost::function<void (const std::deque<LLFolderViewItem*>& items, BOOL user_action)>& cb); +    void setScroller(LLScrollContainer* scroller) { mExternalScroller = scroller; }      typedef boost::function<void()> root_changed_callback_t;      boost::signals2::connection setRootChangedCallback(root_changed_callback_t cb); @@ -436,6 +437,7 @@ protected:      LLUUID mFolderID;      std::list<LLUUID> mBackwardFolders;      std::list<LLUUID> mForwardFolders; +    LLScrollContainer* mExternalScroller;      boost::signals2::signal<void()> mRootChangedSignal;  }; diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 5a8565b5aa..998a211795 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -256,7 +256,7 @@ BOOL LLPanelMainInventory::postBuild()      mInventoryGalleryPanel = getChild<LLInventoryGallery>("gallery_view_inv");      mGalleryRootUpdatedConnection = mInventoryGalleryPanel->setRootChangedCallback(boost::bind(&LLPanelMainInventory::updateTitle, this)); -    mCombinationScrollPanel = getChild<LLUICtrl>("combination_view_inventory"); +    mCombinationScrollPanel = getChild<LLScrollContainer>("combination_view_inventory");      mCombinationInventoryPanel = getChild<LLInventorySingleFolderPanel>("comb_single_folder_inv");      LLInventoryFilter& comb_inv_filter = mCombinationInventoryPanel->getFilter(); @@ -264,6 +264,7 @@ BOOL LLPanelMainInventory::postBuild()      comb_inv_filter.markDefault();      mCombinationInventoryPanel->setSelectCallback(boost::bind(&LLPanelMainInventory::onCombinationInventorySelectionChanged, this, _1, _2));      mCombinationInventoryPanel->setRootChangedCallback(boost::bind(&LLPanelMainInventory::onCombinationRootChanged, this, false)); +    mCombinationInventoryPanel->setScroller(mCombinationScrollPanel);      mCombinationGalleryPanel = getChild<LLInventoryGallery>("comb_gallery_view_inv");      LLInventoryFilter& comb_gallery_filter = mCombinationGalleryPanel->getFilter(); @@ -2326,6 +2327,11 @@ void LLPanelMainInventory::updateCombinationVisibility()          {              mCombinationShapeDirty = false;              mCombinationInventoryPanel->reshape(1,1); // HACK: force reduce visible area +            LLFolderView* root_folder = mCombinationInventoryPanel->getRootFolder(); +            if (root_folder) +            { +                root_folder->arrangeAll(); +            }          }          if (!mCombinationGalleryPanel->hasVisibleItems())          { @@ -2335,13 +2341,11 @@ void LLPanelMainInventory::updateCombinationVisibility()          LLRect inv_inner_rect = mCombinationInventoryPanel->getScrollableContainer()->getScrolledViewRect();          LLRect galery_rect = mCombinationGalleryPanel->getRect();          LLRect inner_galery_rect = mCombinationGalleryPanel->getScrollableContainer()->getScrolledViewRect(); -        LLScrollContainer* scroll = static_cast<LLScrollContainer*>(mCombinationScrollPanel); -        LLRect scroller_window_rect = scroll->getContentWindowRect(); +        LLRect scroller_window_rect = mCombinationScrollPanel->getContentWindowRect();          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; +        inv_rect.mRight = inv_rect.mLeft + inv_inner_rect.getWidth();          if (!mCombinationGalleryPanel->hasVisibleItems() || mCombinationInventoryPanel->hasVisibleItems())          {              inv_rect.mTop = inv_rect.mBottom + inv_inner_rect.getHeight() + BORDER_PAD; @@ -2364,7 +2368,7 @@ void LLPanelMainInventory::updateCombinationVisibility()              galery_rect.mTop = galery_rect.mBottom;          } -        mCombinationScroller->reshape(desired_width, inv_rect.getHeight() + galery_rect.getHeight(), true); +        mCombinationScroller->reshape(scroller_window_rect.getWidth(), inv_rect.getHeight() + galery_rect.getHeight(), true);          mCombinationGalleryPanel->setShape(galery_rect, false);          mCombinationInventoryPanel->setShape(inv_rect, false); @@ -2376,12 +2380,6 @@ void LLPanelMainInventory::updateCombinationVisibility()          {              scrollToInvPanelSelection();          } - -        LLFolderView* root_folder = mCombinationInventoryPanel->getRootFolder(); -        if (root_folder) -        { -            root_folder->updateRenamerPosition(); -        }      }  } diff --git a/indra/newview/llpanelmaininventory.h b/indra/newview/llpanelmaininventory.h index bc010ff37f..2c3379996f 100644 --- a/indra/newview/llpanelmaininventory.h +++ b/indra/newview/llpanelmaininventory.h @@ -36,19 +36,20 @@  #include "llfolderview.h"  class LLComboBox; -class LLFolderViewItem;  class LLInventoryPanel;  class LLInventoryGallery; -class LLSaveFolderState;  class LLFilterEditor; -class LLTabContainer; +class LLFloater;  class LLFloaterInventoryFinder; +class LLFloaterSidePanelContainer; +class LLFolderViewItem;  class LLMenuButton;  class LLMenuGL; +class LLSaveFolderState; +class LLScrollContainer;  class LLSidepanelInventory; +class LLTabContainer;  class LLToggleableMenu; -class LLFloater; -class LLFloaterSidePanelContainer;  //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  // Class LLPanelMainInventory @@ -196,7 +197,7 @@ private:      LLInventorySingleFolderPanel* mSingleFolderPanelInventory;      LLInventoryGallery* mInventoryGalleryPanel; -    LLUICtrl* mCombinationScrollPanel; +    LLScrollContainer* mCombinationScrollPanel;      LLInventorySingleFolderPanel* mCombinationInventoryPanel;      LLInventoryGallery* mCombinationGalleryPanel;      LLView* mCombinationScroller; | 
