diff options
Diffstat (limited to 'indra/llui/lltooltip.h')
-rw-r--r-- | indra/llui/lltooltip.h | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/indra/llui/lltooltip.h b/indra/llui/lltooltip.h index 30d251266c..7978b6a583 100644 --- a/indra/llui/lltooltip.h +++ b/indra/llui/lltooltip.h @@ -37,6 +37,7 @@ #include "llsingleton.h" #include "llinitparam.h" #include "llpanel.h" +#include "llstyle.h" // // Classes @@ -65,11 +66,19 @@ public: class LLToolTip : public LLPanel { public: + + struct StyledText : public LLInitParam::Block<StyledText> + { + Mandatory<std::string> text; + Optional<LLStyle::Params> style; + }; + struct Params : public LLInitParam::Block<Params, LLPanel::Params> { typedef boost::function<void(void)> click_callback_t; - Mandatory<std::string> message; + Optional<std::string> message; + Multiple<StyledText> styled_message; Optional<LLCoordGL> pos; Optional<F32> delay_time, @@ -79,14 +88,15 @@ public: Optional<LLRect> sticky_rect; Optional<const LLFontGL*> font; Optional<LLUIImage*> image; + Optional<LLUIColor> text_color; Optional<bool> time_based_media, web_based_media, media_playing; Optional<click_callback_t> click_callback, click_playmedia_callback, click_homepage_callback; - Optional<S32> max_width; - Optional<S32> padding; + Optional<S32> max_width, + padding; Optional<bool> wrap; Params(); @@ -94,7 +104,6 @@ public: /*virtual*/ void draw(); /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask); /*virtual*/ void onMouseLeave(S32 x, S32 y, MASK mask); - /*virtual*/ void setValue(const LLSD& value); /*virtual*/ void setVisible(BOOL visible); bool isFading(); @@ -102,6 +111,7 @@ public: bool hasClickCallback(); LLToolTip(const Params& p); + void initFromParams(const LLToolTip::Params& params); private: class LLTextBox* mTextBox; @@ -111,11 +121,16 @@ private: LLFrameTimer mFadeTimer; LLFrameTimer mVisibleTimer; - S32 mMaxWidth; bool mHasClickCallback; S32 mPadding; // pixels }; +// used for the inspector tooltips which need different background images etc. +class LLInspector : public LLToolTip +{ +public: + struct Params : public LLInitParam::Block<Params, LLToolTip::Params> {}; +}; class LLToolTipMgr : public LLSingleton<LLToolTipMgr> { |