summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
authorRye Mutt <rye@alchemyviewer.org>2024-08-04 15:55:50 -0400
committerRye Mutt <rye@alchemyviewer.org>2024-08-04 23:11:57 -0400
commit9e777e1109035b40989ac13eb3a73323307ff151 (patch)
tree7e3e96c93d9bc842cd86738b1e78c3b5411ab78c /indra/llui
parent456d013ba80566bd3c142f03b1754de47c940baf (diff)
Fix various issues with text segments not updating UI color
Diffstat (limited to 'indra/llui')
-rw-r--r--indra/llui/lltextbase.cpp14
-rw-r--r--indra/llui/lltextbase.h12
2 files changed, 13 insertions, 13 deletions
diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp
index 9e165026ac..e09fef40df 100644
--- a/indra/llui/lltextbase.cpp
+++ b/indra/llui/lltextbase.cpp
@@ -2202,8 +2202,8 @@ static LLUIImagePtr image_from_icon_name(const std::string& icon_name)
void LLTextBase::appendTextImpl(const std::string &new_text, const LLStyle::Params& input_params)
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_UI;
- LLStyle::Params style_params(input_params);
- style_params.fillFrom(getStyleParams());
+ LLStyle::Params style_params(getStyleParams());
+ style_params.overwriteFrom(input_params);
S32 part = (S32)LLTextParser::WHOLE;
if (mParseHTML && !style_params.is_link) // Don't search for URLs inside a link segment (STORM-358).
@@ -3246,8 +3246,8 @@ F32 LLTextSegment::draw(S32 start, S32 end, S32 selection_start, S32 selection_e
bool LLTextSegment::canEdit() const { return false; }
void LLTextSegment::unlinkFromDocument(LLTextBase*) {}
void LLTextSegment::linkToDocument(LLTextBase*) {}
-const LLColor4& LLTextSegment::getColor() const { return LLColor4::white; }
-//void LLTextSegment::setColor(const LLColor4 &color) {}
+const LLUIColor& LLTextSegment::getColor() const { static const LLUIColor white = LLUIColorTable::instance().getColor("White", LLColor4::white); return white; }
+//void LLTextSegment::setColor(const LLUIColor &color) {}
LLStyleConstSP LLTextSegment::getStyle() const {static LLStyleConstSP sp(new LLStyle()); return sp; }
void LLTextSegment::setStyle(LLStyleConstSP style) {}
void LLTextSegment::setToken( LLKeywordToken* token ) {}
@@ -3293,7 +3293,7 @@ LLNormalTextSegment::LLNormalTextSegment( LLStyleConstSP style, S32 start, S32 e
}
}
-LLNormalTextSegment::LLNormalTextSegment( const LLColor4& color, S32 start, S32 end, LLTextBase& editor, bool is_visible)
+LLNormalTextSegment::LLNormalTextSegment( const LLUIColor& color, S32 start, S32 end, LLTextBase& editor, bool is_visible)
: LLTextSegment(start, end),
mToken(NULL),
mEditor(editor)
@@ -3603,7 +3603,7 @@ LLLabelTextSegment::LLLabelTextSegment( LLStyleConstSP style, S32 start, S32 end
{
}
-LLLabelTextSegment::LLLabelTextSegment( const LLColor4& color, S32 start, S32 end, LLTextBase& editor, bool is_visible)
+LLLabelTextSegment::LLLabelTextSegment( const LLUIColor& color, S32 start, S32 end, LLTextBase& editor, bool is_visible)
: LLNormalTextSegment(color, start, end, editor, is_visible)
{
}
@@ -3627,7 +3627,7 @@ LLEmojiTextSegment::LLEmojiTextSegment(LLStyleConstSP style, S32 start, S32 end,
{
}
-LLEmojiTextSegment::LLEmojiTextSegment(const LLColor4& color, S32 start, S32 end, LLTextBase& editor, bool is_visible)
+LLEmojiTextSegment::LLEmojiTextSegment(const LLUIColor& color, S32 start, S32 end, LLTextBase& editor, bool is_visible)
: LLNormalTextSegment(color, start, end, editor, is_visible)
{
}
diff --git a/indra/llui/lltextbase.h b/indra/llui/lltextbase.h
index 0c8e398fc5..00cf66b134 100644
--- a/indra/llui/lltextbase.h
+++ b/indra/llui/lltextbase.h
@@ -84,8 +84,8 @@ public:
virtual void unlinkFromDocument(class LLTextBase* editor);
virtual void linkToDocument(class LLTextBase* editor);
- virtual const LLColor4& getColor() const;
- //virtual void setColor(const LLColor4 &color);
+ virtual const LLUIColor& getColor() const;
+ //virtual void setColor(const LLUIColor &color);
virtual LLStyleConstSP getStyle() const;
virtual void setStyle(LLStyleConstSP style);
virtual void setToken( LLKeywordToken* token );
@@ -125,7 +125,7 @@ class LLNormalTextSegment : public LLTextSegment
{
public:
LLNormalTextSegment( LLStyleConstSP style, S32 start, S32 end, LLTextBase& editor );
- LLNormalTextSegment( const LLColor4& color, S32 start, S32 end, LLTextBase& editor, bool is_visible = true);
+ LLNormalTextSegment( const LLUIColor& color, S32 start, S32 end, LLTextBase& editor, bool is_visible = true);
virtual ~LLNormalTextSegment();
/*virtual*/ bool getDimensionsF32(S32 first_char, S32 num_chars, F32& width, S32& height) const;
@@ -133,7 +133,7 @@ public:
/*virtual*/ S32 getNumChars(S32 num_pixels, S32 segment_offset, S32 line_offset, S32 max_chars, S32 line_ind) const;
/*virtual*/ F32 draw(S32 start, S32 end, S32 selection_start, S32 selection_end, const LLRectf& draw_rect);
/*virtual*/ bool canEdit() const { return true; }
- /*virtual*/ const LLColor4& getColor() const { return mStyle->getColor(); }
+ /*virtual*/ const LLUIColor& getColor() const { return mStyle->getColor(); }
/*virtual*/ LLStyleConstSP getStyle() const { return mStyle; }
/*virtual*/ void setStyle(LLStyleConstSP style) { mStyle = style; }
/*virtual*/ void setToken( LLKeywordToken* token ) { mToken = token; }
@@ -170,7 +170,7 @@ class LLLabelTextSegment : public LLNormalTextSegment
{
public:
LLLabelTextSegment( LLStyleConstSP style, S32 start, S32 end, LLTextBase& editor );
- LLLabelTextSegment( const LLColor4& color, S32 start, S32 end, LLTextBase& editor, bool is_visible = true);
+ LLLabelTextSegment( const LLUIColor& color, S32 start, S32 end, LLTextBase& editor, bool is_visible = true);
protected:
@@ -184,7 +184,7 @@ class LLEmojiTextSegment : public LLNormalTextSegment
{
public:
LLEmojiTextSegment(LLStyleConstSP style, S32 start, S32 end, LLTextBase& editor);
- LLEmojiTextSegment(const LLColor4& color, S32 start, S32 end, LLTextBase& editor, bool is_visible = true);
+ LLEmojiTextSegment(const LLUIColor& color, S32 start, S32 end, LLTextBase& editor, bool is_visible = true);
bool canEdit() const override { return false; }
bool handleToolTip(S32 x, S32 y, MASK mask) override;