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.cpp35
1 files changed, 33 insertions, 2 deletions
diff --git a/indra/newview/llhints.cpp b/indra/newview/llhints.cpp
index 3f0deb98cd..e15862e2a4 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"),
@@ -166,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()
@@ -180,6 +191,8 @@ BOOL LLHintPopup::postBuild()
LLRect text_bounds = hint_text.getTextBoundingRect();
S32 delta_height = text_bounds.getHeight() - hint_text.getRect().getHeight();
reshape(getRect().getWidth(), getRect().getHeight() + delta_height);
+ hint_text.reshape(hint_text.getRect().getWidth(), hint_text.getRect().getHeight() + delta_height);
+// hint_text.translate(0, -delta_height);
return TRUE;
}
@@ -200,6 +213,24 @@ void LLHintPopup::draw()
alpha = clamp_rescale(mFadeTimer.getElapsedTimeF32(), 0.f, mFadeInTime, 0.f, 1.f);
}
+ LLIconCtrl* hint_icon = findChild<LLIconCtrl>("hint_image");
+
+ if (hint_icon)
+ {
+ LLUIImagePtr hint_image = hint_icon->getImage();
+ S32 image_height = hint_image.isNull() ? 0 : hint_image->getHeight();
+ S32 image_width = hint_image.isNull() ? 0 : hint_image->getWidth();
+
+ LLView* layout_stack = hint_icon->getParent()->getParent();
+ S32 delta_height = image_height - layout_stack->getRect().getHeight();
+ hint_icon->getParent()->reshape(image_width, hint_icon->getParent()->getRect().getHeight());
+ layout_stack->reshape(layout_stack->getRect().getWidth(), image_height);
+ layout_stack->translate(0, -delta_height);
+
+ LLRect hint_rect = getLocalRect();
+ reshape(hint_rect.getWidth(), hint_rect.getHeight() + delta_height);
+ }
+
{ LLViewDrawContext context(alpha);
if (mTarget.empty())