From ca37311987f038a153030a45da503d2162a18be6 Mon Sep 17 00:00:00 2001 From: Mike Antipov Date: Tue, 2 Mar 2010 16:26:30 +0200 Subject: Fixed major bug EXT-3981 ([BSI] scroll bar resets to near the top of inventory search) - disabled auto scrolling in inventory panels when mouse pointer is over the panel --HG-- branch : product-engine --- indra/newview/llfolderview.cpp | 3 ++- indra/newview/llfolderview.h | 2 ++ indra/newview/llinventorypanel.cpp | 15 +++++++++++++++ indra/newview/llinventorypanel.h | 4 ++++ 4 files changed, 23 insertions(+), 1 deletion(-) diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp index 23f19a38a6..f7fd7bb472 100644 --- a/indra/newview/llfolderview.cpp +++ b/indra/newview/llfolderview.cpp @@ -179,6 +179,7 @@ LLFolderView::LLFolderView(const Params& p) mSourceID(p.task_id), mRenameItem( NULL ), mNeedsScroll( FALSE ), + mEnableScroll( true ), mPinningSelectedItem(FALSE), mNeedsAutoSelect( FALSE ), mAutoSelectOverride(FALSE), @@ -1913,7 +1914,7 @@ void LLFolderView::deleteAllChildren() void LLFolderView::scrollToShowSelection() { - if (mSelectedItems.size()) + if (mEnableScroll && mSelectedItems.size()) { mNeedsScroll = TRUE; } diff --git a/indra/newview/llfolderview.h b/indra/newview/llfolderview.h index faf6a9cf23..38255b3cea 100644 --- a/indra/newview/llfolderview.h +++ b/indra/newview/llfolderview.h @@ -269,6 +269,7 @@ public: void dumpSelectionInformation(); virtual S32 notify(const LLSD& info) ; + void setEnableScroll(bool enable_scroll) { mEnableScroll = enable_scroll; } private: void updateRenamerPosition(); @@ -300,6 +301,7 @@ protected: LLLineEditor* mRenamer; BOOL mNeedsScroll; + bool mEnableScroll; BOOL mPinningSelectedItem; LLRect mScrollConstraintRect; BOOL mNeedsAutoSelect; diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 048ed10886..8097985ade 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -681,6 +681,21 @@ BOOL LLInventoryPanel::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, return handled; } +// virtual +void LLInventoryPanel::onMouseEnter(S32 x, S32 y, MASK mask) +{ + LLPanel::onMouseEnter(x, y, mask); + // don't auto-scroll a list when cursor is over Inventory. See EXT-3981. + mFolders->setEnableScroll(false); +} + +// virtual +void LLInventoryPanel::onMouseLeave(S32 x, S32 y, MASK mask) +{ + LLPanel::onMouseLeave(x, y, mask); + mFolders->setEnableScroll(true); +} + void LLInventoryPanel::onFocusLost() { // inventory no longer handles cut/copy/paste/delete diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h index f312b588b9..37b03dbd7d 100644 --- a/indra/newview/llinventorypanel.h +++ b/indra/newview/llinventorypanel.h @@ -122,6 +122,10 @@ public: void* cargo_data, EAcceptance* accept, std::string& tooltip_msg); + + void onMouseEnter(S32 x, S32 y, MASK mask); + void onMouseLeave(S32 x, S32 y, MASK mask); + // LLUICtrl methods /*virtual*/ void onFocusLost(); /*virtual*/ void onFocusReceived(); -- cgit v1.2.3