summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorTodd Stinson <stinson@lindenlab.com>2012-08-02 17:27:51 -0700
committerTodd Stinson <stinson@lindenlab.com>2012-08-02 17:27:51 -0700
commit3e610d3015694281cb2de5e34b9afc520379f35d (patch)
treee972e722bd4e72190df44ffc44e8b05af45c46ea /indra
parentc44aa1c96655bc762f74583f92eedc155cf23a45 (diff)
parent4e7c2c6942b6169812459f19cb13c9f4101dcaf1 (diff)
Pull and merge from ssh://stinson@hg.lindenlab.com/richard/viewer-chui/.
Diffstat (limited to 'indra')
-rw-r--r--indra/llinventory/llinventory.cpp6
-rw-r--r--indra/llui/llfolderview.cpp45
2 files changed, 29 insertions, 22 deletions
diff --git a/indra/llinventory/llinventory.cpp b/indra/llinventory/llinventory.cpp
index 6e54f9d78a..a80ae73dca 100644
--- a/indra/llinventory/llinventory.cpp
+++ b/indra/llinventory/llinventory.cpp
@@ -75,13 +75,15 @@ LLInventoryObject::LLInventoryObject(const LLUUID& uuid,
mUUID(uuid),
mParentUUID(parent_uuid),
mType(type),
- mName(name)
+ mName(name),
+ mCreationDate(0)
{
correctInventoryName(mName);
}
LLInventoryObject::LLInventoryObject() :
- mType(LLAssetType::AT_NONE)
+ mType(LLAssetType::AT_NONE),
+ mCreationDate(0)
{
}
diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp
index 5d98dc9663..5c421976b5 100644
--- a/indra/llui/llfolderview.cpp
+++ b/indra/llui/llfolderview.cpp
@@ -1701,9 +1701,6 @@ void LLFolderView::scrollToShowItem(LLFolderViewItem* item, const LLRect& constr
if(item)
{
LLRect local_rect = item->getLocalRect();
- LLRect item_scrolled_rect; // item position relative to display area of scroller
- LLRect visible_doc_rect = mScrollContainer->getVisibleContentRect();
-
S32 icon_height = mIcon.isNull() ? 0 : mIcon->getHeight();
S32 label_height = getLabelFontForStyle(mLabelStyle)->getLineHeight();
// when navigating with keyboard, only move top of opened folder on screen, otherwise show whole folder
@@ -1812,6 +1809,20 @@ void LLFolderView::update()
mNeedsAutoSelect = FALSE;
}
+ BOOL is_visible = isInVisibleChain();
+
+ //Puts folders/items in proper positions
+ if ( is_visible )
+ {
+ sanitizeSelection();
+ if( needsArrange() )
+ {
+ S32 height = 0;
+ S32 width = 0;
+ S32 total_height = arrange( &width, &height );
+ notifyParent(LLSD().with("action", "size_changes").with("height", total_height));
+ }
+ }
// during filtering process, try to pin selected item's location on screen
// this will happen when searching your inventory and when new items arrive
@@ -1823,18 +1834,26 @@ void LLFolderView::update()
// lets pin it!
mPinningSelectedItem = TRUE;
- LLRect visible_content_rect = (mScrollContainer ? mScrollContainer->getVisibleContentRect() : LLRect());
+ //Computes visible area
+ const LLRect visible_content_rect = (mScrollContainer ? mScrollContainer->getVisibleContentRect() : LLRect());
LLFolderViewItem* selected_item = mSelectedItems.back();
+ //Computes location of selected content, content outside visible area will be scrolled to using below code
LLRect item_rect;
selected_item->localRectToOtherView(selected_item->getLocalRect(), &item_rect, this);
- // if item is visible in scrolled region
- if (visible_content_rect.overlaps(item_rect))
+
+ //Computes intersected region of the selected content and visible area
+ LLRect overlap_rect(item_rect);
+ overlap_rect.intersectWith(visible_content_rect);
+
+ //Don't scroll when the selected content exists within the visible area
+ if (overlap_rect.getHeight() >= selected_item->getItemHeight())
{
// then attempt to keep it in same place on screen
mScrollConstraintRect = item_rect;
mScrollConstraintRect.translate(-visible_content_rect.mLeft, -visible_content_rect.mBottom);
}
+ //Scroll because the selected content is outside the visible area
else
{
// otherwise we just want it onscreen somewhere
@@ -1865,20 +1884,6 @@ void LLFolderView::update()
constraint_rect.setOriginAndSize(0, 0, content_rect.getWidth(), content_rect.getHeight());
}
- BOOL is_visible = isInVisibleChain();
-
- if ( is_visible )
- {
- sanitizeSelection();
- if( needsArrange() )
- {
- S32 height = 0;
- S32 width = 0;
- S32 total_height = arrange( &width, &height );
- notifyParent(LLSD().with("action", "size_changes").with("height", total_height));
- }
- }
-
if (mSelectedItems.size() && mNeedsScroll)
{
scrollToShowItem(mSelectedItems.back(), constraint_rect);