diff options
Diffstat (limited to 'indra/llui/lltextbase.h')
-rw-r--r-- | indra/llui/lltextbase.h | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/indra/llui/lltextbase.h b/indra/llui/lltextbase.h index 4b0eeeb7d6..db010d1cf6 100644 --- a/indra/llui/lltextbase.h +++ b/indra/llui/lltextbase.h @@ -145,10 +145,25 @@ protected: boost::signals2::connection mImageLoadedConnection; }; +// Text segment that changes it's style depending of mouse pointer position ( is it inside or outside segment) +class LLOnHoverChangeableTextSegment : public LLNormalTextSegment +{ +public: + LLOnHoverChangeableTextSegment( LLStyleConstSP style, LLStyleConstSP normal_style, S32 start, S32 end, LLTextBase& editor ); + /*virtual*/ F32 draw(S32 start, S32 end, S32 selection_start, S32 selection_end, const LLRect& draw_rect); + /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask); +protected: + // Style used for text when mouse pointer is over segment + LLStyleConstSP mHoveredStyle; + // Style used for text when mouse pointer is outside segment + LLStyleConstSP mNormalStyle; + +}; + class LLIndexSegment : public LLTextSegment { public: - LLIndexSegment(S32 pos) : LLTextSegment(pos, pos) {} + LLIndexSegment() : LLTextSegment(0, 0) {} }; class LLInlineViewSegment : public LLTextSegment @@ -241,7 +256,9 @@ public: text_readonly_color, bg_readonly_color, bg_writeable_color, - bg_focus_color; + bg_focus_color, + text_selected_color, + bg_selected_color; Optional<bool> bg_visible, border_visible, @@ -251,7 +268,7 @@ public: plain_text, wrap, use_ellipses, - allow_html, + parse_urls, parse_highlights, clip_partial; @@ -441,7 +458,7 @@ protected: S32 insertStringNoUndo(S32 pos, const LLWString &wstr, segment_vec_t* segments = NULL); // returns num of chars actually inserted S32 removeStringNoUndo(S32 pos, S32 length); S32 overwriteCharNoUndo(S32 pos, llwchar wc); - void appendAndHighlightText(const std::string &new_text, S32 highlight_part, const LLStyle::Params& stylep); + void appendAndHighlightText(const std::string &new_text, S32 highlight_part, const LLStyle::Params& stylep, bool underline_on_hover_only = false); // manage segments @@ -484,7 +501,7 @@ protected: void replaceUrlLabel(const std::string &url, const std::string &label); void appendTextImpl(const std::string &new_text, const LLStyle::Params& input_params = LLStyle::Params()); - void appendAndHighlightTextImpl(const std::string &new_text, S32 highlight_part, const LLStyle::Params& style_params); + void appendAndHighlightTextImpl(const std::string &new_text, S32 highlight_part, const LLStyle::Params& style_params, bool underline_on_hover_only = false); protected: @@ -507,6 +524,8 @@ protected: LLUIColor mWriteableBgColor; LLUIColor mReadOnlyBgColor; LLUIColor mFocusBgColor; + LLUIColor mTextSelectedColor; + LLUIColor mSelectedBGColor; // cursor S32 mCursorPos; // I-beam is just after the mCursorPos-th character. |