summaryrefslogtreecommitdiff
path: root/indra/newview/llfloatergesture.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llfloatergesture.cpp')
-rw-r--r--indra/newview/llfloatergesture.cpp17
1 files changed, 10 insertions, 7 deletions
diff --git a/indra/newview/llfloatergesture.cpp b/indra/newview/llfloatergesture.cpp
index 658aa16429..6d39d75663 100644
--- a/indra/newview/llfloatergesture.cpp
+++ b/indra/newview/llfloatergesture.cpp
@@ -200,12 +200,7 @@ void LLFloaterGesture::refreshAll()
}
else
{
- if (list->setCurrentByID(sInstance->mSelectedID))
- {
- LLCtrlScrollInterface *scroll = sInstance->childGetScrollInterface("gesture_list");
- if (scroll) scroll->scrollToShowSelected();
- }
- else
+ if (! list->setCurrentByID(sInstance->mSelectedID))
{
list->selectFirstItem();
}
@@ -219,8 +214,14 @@ void LLFloaterGesture::refreshAll()
void LLFloaterGesture::buildGestureList()
{
LLCtrlListInterface *list = childGetListInterface("gesture_list");
- if (!list) return;
+ LLCtrlScrollInterface *scroll = childGetScrollInterface("gesture_list");
+ if (! (list && scroll)) return;
+
+ // attempt to preserve scroll position through re-builds
+ // since we do re-build any time anything dirties
+ S32 current_scroll_pos = scroll->getScrollPos();
+
list->operateOnAll(LLCtrlListInterface::OP_DELETE);
LLGestureManager::item_map_t::iterator it;
@@ -319,6 +320,8 @@ void LLFloaterGesture::buildGestureList()
}
list->addElement(element, ADD_BOTTOM);
}
+
+ scroll->setScrollPos(current_scroll_pos);
}
// static