summaryrefslogtreecommitdiff
path: root/indra/newview/llhints.cpp
diff options
context:
space:
mode:
authorKelly Washington <kelly@lindenlab.com>2011-03-31 14:07:54 -0700
committerKelly Washington <kelly@lindenlab.com>2011-03-31 14:07:54 -0700
commit0080ed8e2914fba475b224344d8e4233e8fa48e2 (patch)
treec316dd991d5b54a19594639686215230a89736b4 /indra/newview/llhints.cpp
parent0b44850c6f1057cd095ed9fe68f9285e546c662e (diff)
parent5c3ae68299f79f3a705fa4b3e9cd262b56695318 (diff)
Merge
Diffstat (limited to 'indra/newview/llhints.cpp')
-rw-r--r--indra/newview/llhints.cpp31
1 files changed, 28 insertions, 3 deletions
diff --git a/indra/newview/llhints.cpp b/indra/newview/llhints.cpp
index d837ed8205..c4dcaf11f9 100644
--- a/indra/newview/llhints.cpp
+++ b/indra/newview/llhints.cpp
@@ -33,6 +33,7 @@
#include "lltextbox.h"
#include "llviewerwindow.h"
#include "llviewercontrol.h"
+#include "lliconctrl.h"
#include "llsdparam.h"
class LLHintPopup : public LLPanel
@@ -80,7 +81,8 @@ public:
up_arrow,
right_arrow,
down_arrow,
- lower_left_arrow;
+ lower_left_arrow,
+ hint_image;
Optional<S32> left_arrow_offset,
up_arrow_offset,
@@ -96,6 +98,7 @@ public:
right_arrow("right_arrow"),
down_arrow("down_arrow"),
lower_left_arrow("lower_left_arrow"),
+ hint_image("hint_image"),
left_arrow_offset("left_arrow_offset"),
up_arrow_offset("up_arrow_offset"),
right_arrow_offset("right_arrow_offset"),
@@ -109,7 +112,14 @@ public:
/*virtual*/ BOOL postBuild();
- void onClickClose() { hide(); LLNotifications::instance().cancel(mNotification); }
+ void onClickClose()
+ {
+ if (!mHidden)
+ {
+ hide();
+ LLNotifications::instance().cancel(mNotification);
+ }
+ }
void draw();
void hide() { if(!mHidden) {mHidden = true; mFadeTimer.reset();} }
@@ -159,7 +169,15 @@ LLHintPopup::LLHintPopup(const LLHintPopup::Params& p)
mDirection = p.target_params.direction;
mTarget = p.target_params.target;
}
- buildFromFile( "panel_hint.xml", NULL, p);
+ if (p.hint_image.isProvided())
+ {
+ buildFromFile("panel_hint_image.xml", NULL, p);
+ getChild<LLIconCtrl>("hint_image")->setImage(p.hint_image());
+ }
+ else
+ {
+ buildFromFile( "panel_hint.xml", NULL, p);
+ }
}
BOOL LLHintPopup::postBuild()
@@ -211,9 +229,16 @@ void LLHintPopup::draw()
else if (!targetp->isInVisibleChain())
{
// if target is invisible, don't draw, but keep alive in case widget comes back
+ // but do make it so that it allows mouse events to pass through
+ setEnabled(false);
+ setMouseOpaque(false);
}
else
{
+ // revert back enabled and mouse opaque state in case we disabled it before
+ setEnabled(true);
+ setMouseOpaque(true);
+
LLRect target_rect;
targetp->localRectToOtherView(targetp->getLocalRect(), &target_rect, getParent());