diff options
author | Seth ProductEngine <slitovchuk@productengine.com> | 2012-03-16 01:08:20 +0200 |
---|---|---|
committer | Seth ProductEngine <slitovchuk@productengine.com> | 2012-03-16 01:08:20 +0200 |
commit | 34c599858bd64b7fbda767ff9c9f7d8bcd2c2c25 (patch) | |
tree | 98d656e37d7f31d822c168d505d2464615e950e5 /indra/newview | |
parent | b9521a38f11dd9f44f216adb7d02263d25272572 (diff) |
CHUI-53 FIXED vertical scroll bar in inventory floater to appear when horizontal scroll bar hides last item in folder view.
Added a scroll container which provides the information about the height of currently displayed folder view contents. It is used for updating vertical scroll bar visibility in inventory panel.
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llfolderview.cpp | 28 | ||||
-rw-r--r-- | indra/newview/llfolderview.h | 24 | ||||
-rw-r--r-- | indra/newview/llinventorypanel.cpp | 3 | ||||
-rw-r--r-- | indra/newview/llpanelobjectinventory.cpp | 2 |
4 files changed, 54 insertions, 3 deletions
diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp index 4a42bb2c24..6c4b781122 100644 --- a/indra/newview/llfolderview.cpp +++ b/indra/newview/llfolderview.cpp @@ -165,6 +165,33 @@ void LLCloseAllFoldersFunctor::doItem(LLFolderViewItem* item) { } ///---------------------------------------------------------------------------- +/// Class LLFolderViewScrollContainer +///---------------------------------------------------------------------------- + +// virtual +const LLRect LLFolderViewScrollContainer::getScrolledViewRect() const +{ + LLRect rect = LLRect::null; + if (mScrolledView) + { + LLFolderView* folder_view = dynamic_cast<LLFolderView*>(mScrolledView); + if (folder_view) + { + S32 height = folder_view->mRunningHeight; + + rect = mScrolledView->getRect(); + rect.setLeftTopAndSize(rect.mLeft, rect.mTop, rect.getWidth(), height); + } + } + + return rect; +} + +LLFolderViewScrollContainer::LLFolderViewScrollContainer(const LLScrollContainer::Params& p) +: LLScrollContainer(p) +{} + +///---------------------------------------------------------------------------- /// Class LLFolderView ///---------------------------------------------------------------------------- LLFolderView::Params::Params() @@ -535,6 +562,7 @@ void LLFolderView::reshape(S32 width, S32 height, BOOL called_from_parent) { width = scroll_rect.getWidth(); } + LLView::reshape(width, height, called_from_parent); mReshapeSignal(mSelectedItems, FALSE); } diff --git a/indra/newview/llfolderview.h b/indra/newview/llfolderview.h index 1d018b5e6a..5c5a3a894f 100644 --- a/indra/newview/llfolderview.h +++ b/indra/newview/llfolderview.h @@ -44,6 +44,7 @@ #include "lldepthstack.h" #include "lleditmenuhandler.h" #include "llfontgl.h" +#include "llscrollcontainer.h" #include "lltooldraganddrop.h" #include "llviewertexture.h" @@ -54,10 +55,28 @@ class LLInventoryModel; class LLPanel; class LLLineEditor; class LLMenuGL; -class LLScrollContainer; class LLUICtrl; class LLTextBox; +/** + * Class LLFolderViewScrollContainer + * + * A scroll container which provides the information about the height + * of currently displayed folder view contents. + * Used for updating vertical scroll bar visibility in inventory panel. + * See LLScrollContainer::calcVisibleSize(). + */ +class LLFolderViewScrollContainer : public LLScrollContainer +{ +public: + /*virtual*/ ~LLFolderViewScrollContainer() {}; + /*virtual*/ const LLRect getScrolledViewRect() const; + +protected: + LLFolderViewScrollContainer(const LLScrollContainer::Params& p); + friend class LLUICtrlFactory; +}; + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Class LLFolderView // @@ -81,6 +100,9 @@ public: Params(); }; + + friend class LLFolderViewScrollContainer; + LLFolderView(const Params&); virtual ~LLFolderView( void ); diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 01a8ecfb5d..c47b74815f 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -206,10 +206,11 @@ void LLInventoryPanel::initFromParams(const LLInventoryPanel::Params& params) scroller_view_rect.translate(-scroller_view_rect.mLeft, -scroller_view_rect.mBottom); LLScrollContainer::Params scroller_params(params.scroll()); scroller_params.rect(scroller_view_rect); - mScroller = LLUICtrlFactory::create<LLScrollContainer>(scroller_params); + mScroller = LLUICtrlFactory::create<LLFolderViewScrollContainer>(scroller_params); addChild(mScroller); mScroller->addChild(mFolderRoot); mFolderRoot->setScrollContainer(mScroller); + mFolderRoot->setFollowsAll(); mFolderRoot->addChild(mFolderRoot->mStatusTextBox); } diff --git a/indra/newview/llpanelobjectinventory.cpp b/indra/newview/llpanelobjectinventory.cpp index 98ea680504..f3ecba7185 100644 --- a/indra/newview/llpanelobjectinventory.cpp +++ b/indra/newview/llpanelobjectinventory.cpp @@ -1568,7 +1568,7 @@ void LLPanelObjectInventory::reset() scroll_p.rect(scroller_rect); scroll_p.tab_stop(true); scroll_p.follows.flags(FOLLOWS_ALL); - mScroller = LLUICtrlFactory::create<LLScrollContainer>(scroll_p); + mScroller = LLUICtrlFactory::create<LLFolderViewScrollContainer>(scroll_p); addChild(mScroller); mScroller->addChild(mFolders); |