summaryrefslogtreecommitdiff
path: root/indra/newview/llhints.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llhints.cpp')
-rw-r--r--indra/newview/llhints.cpp40
1 files changed, 27 insertions, 13 deletions
diff --git a/indra/newview/llhints.cpp b/indra/newview/llhints.cpp
index a8c3183301..2f3504efed 100644
--- a/indra/newview/llhints.cpp
+++ b/indra/newview/llhints.cpp
@@ -149,7 +149,7 @@ void LLHintPopup::draw()
targetp->localRectToOtherView(targetp->getLocalRect(), &target_rect, getParent());
LLRect my_local_rect = getLocalRect();
- LLRect my_rect = getRect();
+ LLRect my_rect;
LLRect arrow_rect;
LLUIImagePtr arrow_imagep;
@@ -158,10 +158,10 @@ void LLHintPopup::draw()
switch(mDirection)
{
case LEFT:
- my_rect.setCenterAndSize( target_rect.mLeft - (my_rect.getWidth() / 2 + mDistance),
+ my_rect.setCenterAndSize( target_rect.mLeft - (my_local_rect.getWidth() / 2 + mDistance),
target_rect.getCenterY(),
- my_rect.getWidth(),
- my_rect.getHeight());
+ my_local_rect.getWidth(),
+ my_local_rect.getHeight());
arrow_rect.setCenterAndSize(my_local_rect.mRight + mArrowRight->getWidth() / 2 - OVERLAP,
my_local_rect.getCenterY(),
mArrowRight->getWidth(),
@@ -170,9 +170,9 @@ void LLHintPopup::draw()
break;
case TOP:
my_rect.setCenterAndSize( target_rect.getCenterX(),
- target_rect.mTop + (my_rect.getHeight() / 2 + mDistance),
- my_rect.getWidth(),
- my_rect.getHeight());
+ target_rect.mTop + (my_local_rect.getHeight() / 2 + mDistance),
+ my_local_rect.getWidth(),
+ my_local_rect.getHeight());
arrow_rect.setCenterAndSize(my_local_rect.getCenterX(),
my_local_rect.mBottom - mArrowDown->getHeight() / 2 + OVERLAP,
mArrowDown->getWidth(),
@@ -181,9 +181,9 @@ void LLHintPopup::draw()
break;
case RIGHT:
my_rect.setCenterAndSize( target_rect.getCenterX(),
- target_rect.mTop - (my_rect.getHeight() / 2 + mDistance),
- my_rect.getWidth(),
- my_rect.getHeight());
+ target_rect.mTop - (my_local_rect.getHeight() / 2 + mDistance),
+ my_local_rect.getWidth(),
+ my_local_rect.getHeight());
arrow_rect.setCenterAndSize(my_local_rect.mLeft - mArrowLeft->getWidth() / 2 + OVERLAP,
my_local_rect.getCenterY(),
mArrowLeft->getWidth(),
@@ -191,10 +191,10 @@ void LLHintPopup::draw()
arrow_imagep = mArrowLeft;
break;
case BOTTOM:
- my_rect.setCenterAndSize( target_rect.mLeft + (my_rect.getWidth() / 2 + mDistance),
+ my_rect.setCenterAndSize( target_rect.mLeft + (my_local_rect.getWidth() / 2 + mDistance),
target_rect.getCenterY(),
- my_rect.getWidth(),
- my_rect.getHeight());
+ my_local_rect.getWidth(),
+ my_local_rect.getHeight());
arrow_rect.setCenterAndSize(my_local_rect.getCenterX(),
my_local_rect.mTop + mArrowUp->getHeight() / 2 - OVERLAP,
mArrowUp->getWidth(),
@@ -211,6 +211,7 @@ void LLHintPopup::draw()
LLRegistry<std::string, LLHandle<LLView> > LLHints::sTargetRegistry;
+std::map<LLNotificationPtr, class LLHintPopup*> LLHints::sHints;
//static
void LLHints::show(LLNotificationPtr hint)
@@ -221,6 +222,9 @@ void LLHints::show(LLNotificationPtr hint)
p.notification = hint;
LLHintPopup* popup = new LLHintPopup(p);
+
+ sHints[hint] = popup;
+
LLView* hint_holder = gViewerWindow->getHintHolder();
if (hint_holder)
{
@@ -229,6 +233,16 @@ void LLHints::show(LLNotificationPtr hint)
}
}
+void LLHints::hide(LLNotificationPtr hint)
+{
+ hint_map_t::iterator found_it = sHints.find(hint);
+ if (found_it != sHints.end())
+ {
+ found_it->second->hide();
+ sHints.erase(found_it);
+ }
+}
+
//static
void LLHints::registerHintTarget(const std::string& name, LLHandle<LLView> target)
{