From ba2fa73aaab5415c38fd9f489c590d8cba05e24f Mon Sep 17 00:00:00 2001 From: Paul ProductEngine Date: Tue, 1 Nov 2011 18:54:21 +0200 Subject: EXP-1472 FIXED (More spillover list scrolls up after selecting any content menu item) - Saving last scroll position of menu --- indra/llui/llmenugl.cpp | 5 +++-- indra/llui/llmenugl.h | 4 ++++ indra/newview/llfavoritesbar.cpp | 2 ++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp index 3ef8d8ff35..cb237fca7c 100644 --- a/indra/llui/llmenugl.cpp +++ b/indra/llui/llmenugl.cpp @@ -1686,7 +1686,8 @@ LLMenuGL::LLMenuGL(const LLMenuGL::Params& p) mSpilloverMenu(NULL), mJumpKey(p.jump_key), mCreateJumpKeys(p.create_jump_keys), - mNeedsArrange(FALSE), + mNeedsArrange(FALSE), + mResetScrollPositionOnShow(true), mShortcutPad(p.shortcut_pad) { typedef boost::tokenizer > tokenizer; @@ -3043,7 +3044,7 @@ void LLMenuGL::showPopup(LLView* spawning_view, LLMenuGL* menu, S32 x, S32 y) S32 mouse_x, mouse_y; // Resetting scrolling position - if (menu->isScrollable()) + if (menu->isScrollable() && menu->isScrollPositionOnShowReset()) { menu->mFirstVisibleItem = NULL; } diff --git a/indra/llui/llmenugl.h b/indra/llui/llmenugl.h index 77db588390..bdae899933 100644 --- a/indra/llui/llmenugl.h +++ b/indra/llui/llmenugl.h @@ -516,6 +516,9 @@ public: static class LLMenuHolderGL* sMenuContainer; + void resetScrollPositionOnShow(bool reset_scroll_pos) { mResetScrollPositionOnShow = reset_scroll_pos; } + bool isScrollPositionOnShowReset() { return mResetScrollPositionOnShow; } + protected: void createSpilloverBranch(); void cleanupSpilloverBranch(); @@ -565,6 +568,7 @@ private: KEY mJumpKey; BOOL mCreateJumpKeys; S32 mShortcutPad; + bool mResetScrollPositionOnShow; }; // end class LLMenuGL diff --git a/indra/newview/llfavoritesbar.cpp b/indra/newview/llfavoritesbar.cpp index 6c9058caf1..1f269fb666 100644 --- a/indra/newview/llfavoritesbar.cpp +++ b/indra/newview/llfavoritesbar.cpp @@ -1197,7 +1197,9 @@ void LLFavoritesBarCtrl::doToSelected(const LLSD& userdata) LLToggleableMenu* menu = (LLToggleableMenu*) mOverflowMenuHandle.get(); if (mRestoreOverflowMenu && menu && !menu->getVisible()) { + menu->resetScrollPositionOnShow(false); showDropDownMenu(); + menu->resetScrollPositionOnShow(true); } } -- cgit v1.2.3