summaryrefslogtreecommitdiff
path: root/indra/newview/llfolderview.cpp
diff options
context:
space:
mode:
authorJosh Bell <josh@lindenlab.com>2007-12-21 06:44:41 +0000
committerJosh Bell <josh@lindenlab.com>2007-12-21 06:44:41 +0000
commitdf4d167cd13fd89a85e4d30dca94e40c934707d7 (patch)
treecde9373bce657013bf04c83ab60b4a4aa826fc76 /indra/newview/llfolderview.cpp
parent8fde5f0d3241205067e5d7bf5380757e764eff31 (diff)
svn merge -r74200:76302 svn+ssh://svn.lindenlab.com/svn/linden/branches/Branch_1-18-6-Viewer --> release
Wheee, this was fun. Um, let's back-port fixes a little more rapidly next time. Reviewed by CG until alexandria died, did the rest by my lonesome.
Diffstat (limited to 'indra/newview/llfolderview.cpp')
-rw-r--r--indra/newview/llfolderview.cpp31
1 files changed, 30 insertions, 1 deletions
diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp
index deffca3b79..90df2284c5 100644
--- a/indra/newview/llfolderview.cpp
+++ b/indra/newview/llfolderview.cpp
@@ -108,6 +108,7 @@ LLColor4 LLFolderViewItem::sHighlightBgColor;
LLColor4 LLFolderViewItem::sHighlightFgColor;
LLColor4 LLFolderViewItem::sFilterBGColor;
LLColor4 LLFolderViewItem::sFilterTextColor;
+LLColor4 LLFolderViewItem::sLoadingMessageTextColor;
// Default constructor
LLFolderViewItem::LLFolderViewItem( const LLString& name, LLViewerImage* icon,
@@ -132,7 +133,8 @@ LLFolderViewItem::LLFolderViewItem( const LLString& name, LLViewerImage* icon,
mStringMatchOffset(LLString::npos),
mControlLabelRotation(0.f),
mRoot( root ),
- mDragAndDropTarget(FALSE)
+ mDragAndDropTarget(FALSE),
+ mIsLoading(FALSE)
{
setIcon(icon);
if( !LLFolderViewItem::sFont )
@@ -151,6 +153,7 @@ LLFolderViewItem::LLFolderViewItem( const LLString& name, LLViewerImage* icon,
LLFolderViewItem::sHighlightFgColor = gColors.getColor( "MenuItemHighlightFgColor" );
LLFolderViewItem::sFilterBGColor = gColors.getColor( "FilterBackgroundColor" );
LLFolderViewItem::sFilterTextColor = gColors.getColor( "FilterTextColor" );
+ LLFolderViewItem::sLoadingMessageTextColor = gColors.getColor( "FolderViewLoadingMessageTextColor" );
mArrowImage = gImageList.getImage(LLUUID(gViewerArt.getString("folder_arrow.tga")), MIPMAP_FALSE, TRUE);
mBoxImage = gImageList.getImage(LLUUID(gViewerArt.getString("rounded_square.tga")), MIPMAP_FALSE, TRUE);
@@ -933,6 +936,14 @@ void LLFolderViewItem::draw()
text_left = right_x;
}
+
+ if ( mIsLoading && mTimeSinceRequestStart.getElapsedTimeF32() >= gSavedSettings.getF32("FolderLoadingMessageWaitTime") )
+ {
+ sFont->renderUTF8( "Loading... ", 0, text_left, y, sLoadingMessageTextColor,
+ LLFontGL::LEFT, LLFontGL::BOTTOM, mLabelStyle, S32_MAX, S32_MAX, &right_x, FALSE);
+ text_left = right_x;
+ }
+
sFont->renderUTF8( mLabel, 0, text_left, y, color,
LLFontGL::LEFT, LLFontGL::BOTTOM, mLabelStyle,
S32_MAX, S32_MAX, &right_x, FALSE );
@@ -2197,6 +2208,24 @@ void LLFolderViewFolder::draw()
mControlLabelRotation = lerp(mControlLabelRotation, 0.f, LLCriticalDamp::getInterpolant(0.025f));
}
+ bool possibly_has_children = false;
+ bool up_to_date = mListener && mListener->isUpToDate();
+ if(!up_to_date && mListener && mListener->hasChildren()) // we know we have children but haven't fetched them (doesn't obey filter)
+ {
+ possibly_has_children = true;
+ }
+
+
+ BOOL loading = ( mIsOpen && possibly_has_children && !up_to_date );
+
+ if ( loading && !mIsLoading )
+ {
+ // Measure how long we've been in the loading state
+ mTimeSinceRequestStart.reset();
+ }
+
+ mIsLoading = loading;
+
LLFolderViewItem::draw();
// draw children if root folder, or any other folder that is open or animating to closed state