summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/newview/llfavoritesbar.cpp48
-rw-r--r--indra/newview/llfavoritesbar.h5
2 files changed, 40 insertions, 13 deletions
diff --git a/indra/newview/llfavoritesbar.cpp b/indra/newview/llfavoritesbar.cpp
index cdce6f7156..c1d8828229 100644
--- a/indra/newview/llfavoritesbar.cpp
+++ b/indra/newview/llfavoritesbar.cpp
@@ -320,6 +320,7 @@ public:
if (item)
{
+ LLFavoritesBarCtrl::sWaitingForCallabck = 0.f;
LLFavoritesOrderStorage::instance().setSortIndex(item, mSortField);
item->setComplete(TRUE);
@@ -365,6 +366,9 @@ struct LLFavoritesSort
}
};
+
+F64 LLFavoritesBarCtrl::sWaitingForCallabck = 0.f;
+
LLFavoritesBarCtrl::Params::Params()
: image_drag_indication("image_drag_indication"),
more_button("more_button"),
@@ -381,7 +385,7 @@ LLFavoritesBarCtrl::LLFavoritesBarCtrl(const LLFavoritesBarCtrl::Params& p)
mShowDragMarker(FALSE),
mLandingTab(NULL),
mLastTab(NULL),
- mTabsHighlightEnabled(TRUE),
+ mItemsListDirty(false),
mUpdateDropDownItems(true),
mRestoreOverflowMenu(false),
mGetPrevItems(true),
@@ -618,6 +622,9 @@ void LLFavoritesBarCtrl::handleNewFavoriteDragAndDrop(LLInventoryItem *item, con
int sortField = 0;
LLPointer<LLItemCopiedCallback> cb;
+ const F64 CALLBACK_WAIT_TIME = 30.f;
+ sWaitingForCallabck = LLTimer::getTotalSeconds() + CALLBACK_WAIT_TIME;
+
// current order is saved by setting incremental values (1, 2, 3, ...) for the sort field
for (LLInventoryModel::item_array_t::iterator i = mItems.begin(); i != mItems.end(); ++i)
{
@@ -691,16 +698,22 @@ void LLFavoritesBarCtrl::changed(U32 mask)
LLFavoritesOrderStorage::instance().getSLURL((*i)->getAssetUUID());
}
- updateButtons();
- if (!mItemsChangedTimer.getStarted())
- {
- mItemsChangedTimer.start();
- }
- else
- {
- mItemsChangedTimer.reset();
- }
-
+ if (sWaitingForCallabck < LLTimer::getTotalSeconds())
+ {
+ updateButtons();
+ if (!mItemsChangedTimer.getStarted())
+ {
+ mItemsChangedTimer.start();
+ }
+ else
+ {
+ mItemsChangedTimer.reset();
+ }
+ }
+ else
+ {
+ mItemsListDirty = true;
+ }
}
}
@@ -754,6 +767,18 @@ void LLFavoritesBarCtrl::draw()
mItemsChangedTimer.start();
}
+ if (mItemsListDirty && sWaitingForCallabck < LLTimer::getTotalSeconds())
+ {
+ updateButtons();
+ if (!mItemsChangedTimer.getStarted())
+ {
+ mItemsChangedTimer.start();
+ }
+ else
+ {
+ mItemsChangedTimer.reset();
+ }
+ }
}
const LLButton::Params& LLFavoritesBarCtrl::getButtonParams()
@@ -782,6 +807,7 @@ void LLFavoritesBarCtrl::updateButtons(bool force_update)
return;
}
+ mItemsListDirty = false;
mItems.clear();
if (!collectFavoriteItems(mItems))
diff --git a/indra/newview/llfavoritesbar.h b/indra/newview/llfavoritesbar.h
index 3b439b31fd..68a679e27f 100644
--- a/indra/newview/llfavoritesbar.h
+++ b/indra/newview/llfavoritesbar.h
@@ -53,6 +53,7 @@ public:
protected:
LLFavoritesBarCtrl(const Params&);
friend class LLUICtrlFactory;
+ friend class LLItemCopiedCallback;
public:
virtual ~LLFavoritesBarCtrl();
@@ -84,7 +85,6 @@ protected:
void onButtonRightClick(LLUUID id,LLView* button,S32 x,S32 y,MASK mask);
void onButtonMouseDown(LLUUID id, LLUICtrl* button, S32 x, S32 y, MASK mask);
- void onOverflowMenuItemMouseDown(LLUUID id, LLUICtrl* item, S32 x, S32 y, MASK mask);
void onButtonMouseUp(LLUUID id, LLUICtrl* button, S32 x, S32 y, MASK mask);
void onEndDrag();
@@ -164,7 +164,8 @@ private:
BOOL mStartDrag;
LLInventoryModel::item_array_t mItems;
- BOOL mTabsHighlightEnabled;
+ static F64 sWaitingForCallabck;
+ bool mItemsListDirty;
S32 mMouseX;
S32 mMouseY;