Fix various issues with ui elements not updating colors dynamically

master
Rye Mutt 2024-08-04 15:51:21 -04:00
parent c4e921828a
commit 456d013ba8
26 changed files with 71 additions and 71 deletions

View File

@ -1127,12 +1127,12 @@ void LLButton::setImageSelected(LLPointer<LLUIImage> image)
mImageSelected = image;
}
void LLButton::setImageColor(const LLColor4& c)
void LLButton::setImageColor(const LLUIColor& c)
{
mImageColor = c;
}
void LLButton::setColor(const LLColor4& color)
void LLButton::setColor(const LLUIColor& color)
{
setImageColor(color);
}

View File

@ -172,8 +172,8 @@ public:
virtual void onCommit();
void setUnselectedLabelColor( const LLColor4& c ) { mUnselectedLabelColor = c; }
void setSelectedLabelColor( const LLColor4& c ) { mSelectedLabelColor = c; }
void setUnselectedLabelColor( const LLUIColor& c ) { mUnselectedLabelColor = c; }
void setSelectedLabelColor( const LLUIColor& c ) { mSelectedLabelColor = c; }
void setUseEllipses( bool use_ellipses ) { mUseEllipses = use_ellipses; }
void setUseFontColor( bool use_font_color) { mUseFontColor = use_font_color; }
@ -224,14 +224,14 @@ public:
const std::string getLabelSelected() const { return wstring_to_utf8str(mSelectedLabel); }
void setImageColor(const std::string& color_control);
void setImageColor(const LLColor4& c);
/*virtual*/ void setColor(const LLColor4& c);
void setImageColor(const LLUIColor& c);
/*virtual*/ void setColor(const LLUIColor& c);
void setImages(const std::string &image_name, const std::string &selected_name);
void setDisabledImageColor(const LLColor4& c) { mDisabledImageColor = c; }
void setDisabledImageColor(const LLUIColor& c) { mDisabledImageColor = c; }
void setDisabledSelectedLabelColor( const LLColor4& c ) { mDisabledSelectedLabelColor = c; }
void setDisabledSelectedLabelColor( const LLUIColor& c ) { mDisabledSelectedLabelColor = c; }
void setImageOverlay(const std::string& image_name, LLFontGL::HAlign alignment = LLFontGL::HCENTER, const LLColor4& color = LLColor4::white);
void setImageOverlay(const LLUUID& image_id, LLFontGL::HAlign alignment = LLFontGL::HCENTER, const LLColor4& color = LLColor4::white);
@ -246,7 +246,7 @@ public:
virtual bool setLabelArg( const std::string& key, const LLStringExplicit& text );
void setLabelUnselected(const LLStringExplicit& label);
void setLabelSelected(const LLStringExplicit& label);
void setDisabledLabelColor( const LLColor4& c ) { mDisabledLabelColor = c; }
void setDisabledLabelColor( const LLUIColor& c ) { mDisabledLabelColor = c; }
void setFont(const LLFontGL *font)
{ mGLFont = ( font ? font : LLFontGL::getFontSansSerif()); }

View File

@ -172,11 +172,11 @@ void LLCheckBoxCtrl::setEnabled(bool b)
if (b)
{
mLabel->setColor( mTextEnabledColor.get() );
mLabel->setColor( mTextEnabledColor );
}
else
{
mLabel->setColor( mTextDisabledColor.get() );
mLabel->setColor( mTextDisabledColor );
}
}

View File

@ -110,8 +110,8 @@ public:
void setBtnFocus() { mButton->setFocus(true); }
void setEnabledColor( const LLColor4 &color ) { mTextEnabledColor = color; }
void setDisabledColor( const LLColor4 &color ) { mTextDisabledColor = color; }
void setEnabledColor( const LLUIColor&color ) { mTextEnabledColor = color; }
void setDisabledColor( const LLUIColor&color ) { mTextDisabledColor = color; }
void setLabel( const LLStringExplicit& label );
std::string getLabel() const;

View File

@ -784,7 +784,7 @@ void LLFolderViewItem::drawHighlight(const bool showContent, const bool hasKeybo
const S32 FOCUS_LEFT = 1;
// Determine which background color to use for highlighting
LLUIColor bgColor = (isFlashing() ? flashColor : selectColor);
const LLUIColor& bgColor = (isFlashing() ? flashColor : selectColor);
//--------------------------------------------------------------------------------//
// Draw highlight for selected items
@ -999,7 +999,7 @@ void LLFolderViewItem::draw()
//
if (!mLabelSuffix.empty())
{
suffix_font->render( mLabelSuffix, 0, right_x, y, isFadeItem() ? color : (LLColor4)sSuffixColor,
suffix_font->render( mLabelSuffix, 0, right_x, y, isFadeItem() ? color : sSuffixColor.get(),
LLFontGL::LEFT, LLFontGL::BOTTOM, LLFontGL::NORMAL, LLFontGL::NO_SHADOW,
S32_MAX, S32_MAX, &right_x);
}

View File

@ -79,7 +79,7 @@ public:
std::string getImageName() const;
void setColor(const LLColor4& color) { mColor = color; }
void setColor(const LLUIColor& color) { mColor = color; }
void setImage(LLPointer<LLUIImage> image) { mImagep = image; }
const LLPointer<LLUIImage> getImage() { return mImagep; }

View File

@ -85,7 +85,7 @@ LLKeywords::~LLKeywords()
// Add the token as described
void LLKeywords::addToken(LLKeywordToken::ETokenType type,
const std::string& key_in,
const LLColor4& color,
const LLUIColor& color,
const std::string& tool_tip_in,
const std::string& delimiter_in)
{
@ -170,7 +170,7 @@ std::string LLKeywords::getAttribute(std::string_view key)
return (it != mAttributes.end()) ? it->second : "";
}
LLColor4 LLKeywords::getColorGroup(std::string_view key_in)
LLUIColor LLKeywords::getColorGroup(std::string_view key_in)
{
std::string color_group = "ScriptText";
if (key_in == "functions")
@ -263,10 +263,10 @@ void LLKeywords::processTokens()
void LLKeywords::processTokensGroup(const LLSD& tokens, std::string_view group)
{
LLColor4 color;
LLColor4 color_group;
LLColor4 color_deprecated = getColorGroup("deprecated");
LLColor4 color_god_mode = getColorGroup("god-mode");
LLUIColor color;
LLUIColor color_group;
LLUIColor color_deprecated = getColorGroup("deprecated");
LLUIColor color_god_mode = getColorGroup("god-mode");
LLKeywordToken::ETokenType token_type = LLKeywordToken::TT_UNKNOWN;
// If a new token type is added here, it must also be added to the 'addToken' method
@ -725,7 +725,7 @@ void LLKeywords::insertSegments(const LLWString& wtext, std::vector<LLTextSegmen
insertSegment( seg_list, text_segment, text_len, style, editor);
}
void LLKeywords::insertSegment(std::vector<LLTextSegmentPtr>& seg_list, LLTextSegmentPtr new_segment, S32 text_len, const LLColor4 &defaultColor, LLTextEditor& editor )
void LLKeywords::insertSegment(std::vector<LLTextSegmentPtr>& seg_list, LLTextSegmentPtr new_segment, S32 text_len, const LLUIColor& defaultColor, LLTextEditor& editor )
{
LLTextSegmentPtr last = seg_list.back();
S32 new_seg_end = new_segment->getEnd();

View File

@ -72,7 +72,7 @@ public:
TT_TYPE // WORD
} ETokenType;
LLKeywordToken( ETokenType type, const LLColor4& color, const LLWString& token, const LLWString& tool_tip, const LLWString& delimiter )
LLKeywordToken( ETokenType type, const LLUIColor& color, const LLWString& token, const LLWString& tool_tip, const LLWString& delimiter )
:
mType( type ),
mToken( token ),
@ -87,7 +87,7 @@ public:
bool isHead(const llwchar* s) const;
bool isTail(const llwchar* s) const;
const LLWString& getToken() const { return mToken; }
const LLColor4& getColor() const { return mColor; }
const LLUIColor& getColor() const { return mColor; }
ETokenType getType() const { return mType; }
const LLWString& getToolTip() const { return mToolTip; }
const LLWString& getDelimiter() const { return mDelimiter; }
@ -99,7 +99,7 @@ public:
private:
ETokenType mType;
LLWString mToken;
LLColor4 mColor;
LLUIColor mColor;
LLWString mToolTip;
LLWString mDelimiter;
};
@ -111,7 +111,7 @@ public:
~LLKeywords();
void clearLoaded() { mLoaded = false; }
LLColor4 getColorGroup(std::string_view key_in);
LLUIColor getColorGroup(std::string_view key_in);
bool isLoaded() const { return mLoaded; }
void findSegments(std::vector<LLTextSegmentPtr> *seg_list,
@ -124,7 +124,7 @@ public:
// Add the token as described
void addToken(LLKeywordToken::ETokenType type,
const std::string& key,
const LLColor4& color,
const LLUIColor& color,
const std::string& tool_tip = LLStringUtil::null,
const std::string& delimiter = LLStringUtil::null);
@ -153,7 +153,7 @@ public:
bool mOwner;
LLColor4 mColor;
LLUIColor mColor;
};
typedef std::map<WStringMapIndex, LLKeywordToken*> word_token_map_t;
@ -161,7 +161,7 @@ public:
keyword_iterator_t begin() const { return mWordTokenMap.begin(); }
keyword_iterator_t end() const { return mWordTokenMap.end(); }
typedef std::map<WStringMapIndex, LLColor4> group_color_map_t;
typedef std::map<WStringMapIndex, LLUIColor> group_color_map_t;
typedef group_color_map_t::const_iterator color_iterator_t;
group_color_map_t mColorGroupMap;
@ -174,7 +174,7 @@ protected:
void insertSegment(std::vector<LLTextSegmentPtr>& seg_list,
LLTextSegmentPtr new_segment,
S32 text_len,
const LLColor4 &defaultColor,
const LLUIColor &defaultColor,
class LLTextEditor& editor);
void insertSegments(const LLWString& wtext,
std::vector<LLTextSegmentPtr>& seg_list,

View File

@ -224,12 +224,12 @@ public:
void setRevertOnEsc( bool b ) { mRevertOnEsc = b; }
void setKeystrokeOnEsc(bool b) { mKeystrokeOnEsc = b; }
void setCursorColor(const LLColor4& c) { mCursorColor = c; }
void setCursorColor(const LLUIColor& c) { mCursorColor = c; }
const LLColor4& getCursorColor() const { return mCursorColor.get(); }
void setFgColor( const LLColor4& c ) { mFgColor = c; }
void setReadOnlyFgColor( const LLColor4& c ) { mReadOnlyFgColor = c; }
void setTentativeFgColor(const LLColor4& c) { mTentativeFgColor = c; }
void setFgColor( const LLUIColor& c ) { mFgColor = c; }
void setReadOnlyFgColor( const LLUIColor& c ) { mReadOnlyFgColor = c; }
void setTentativeFgColor(const LLUIColor& c) { mTentativeFgColor = c; }
const LLColor4& getFgColor() const { return mFgColor.get(); }
const LLColor4& getReadOnlyFgColor() const { return mReadOnlyFgColor.get(); }

View File

@ -440,7 +440,7 @@ void LLMultiSliderCtrl::setEnabled(bool b)
if( mLabelBox )
{
mLabelBox->setColor( b ? mTextEnabledColor.get() : mTextDisabledColor.get() );
mLabelBox->setColor( b ? mTextEnabledColor : mTextDisabledColor );
}
mMultiSlider->setEnabled( b );
@ -452,7 +452,7 @@ void LLMultiSliderCtrl::setEnabled(bool b)
if( mTextBox )
{
mTextBox->setColor( b ? mTextEnabledColor.get() : mTextDisabledColor.get() );
mTextBox->setColor( b ? mTextEnabledColor : mTextDisabledColor );
}
}

View File

@ -130,8 +130,8 @@ public:
bool canAddSliders() { return mMultiSlider->canAddSliders(); }
void setLabel(const std::string& label) { if (mLabelBox) mLabelBox->setText(label); }
void setLabelColor(const LLColor4& c) { mTextEnabledColor = c; }
void setDisabledLabelColor(const LLColor4& c) { mTextDisabledColor = c; }
void setLabelColor(const LLUIColor& c) { mTextEnabledColor = c; }
void setDisabledLabelColor(const LLUIColor& c) { mTextDisabledColor = c; }
boost::signals2::connection setSliderMouseDownCallback( const commit_signal_t::slot_type& cb );
boost::signals2::connection setSliderMouseUpCallback( const commit_signal_t::slot_type& cb );

View File

@ -490,8 +490,8 @@ void LLPanel::initFromParams(const LLPanel::Params& p)
setBackgroundVisible(p.background_visible);
setBackgroundOpaque(p.background_opaque);
setBackgroundColor(p.bg_opaque_color().get());
setTransparentColor(p.bg_alpha_color().get());
setBackgroundColor(p.bg_opaque_color);
setTransparentColor(p.bg_alpha_color);
mBgOpaqueImage = p.bg_opaque_image();
mBgAlphaImage = p.bg_alpha_image();
mBgOpaqueImageOverlay = p.bg_opaque_image_overlay;
@ -693,7 +693,7 @@ void LLPanel::childSetCommitCallback(std::string_view id, boost::function<void (
}
}
void LLPanel::childSetColor(std::string_view id, const LLColor4& color)
void LLPanel::childSetColor(std::string_view id, const LLUIColor& color)
{
LLUICtrl* child = findChild<LLUICtrl>(id);
if (child)

View File

@ -134,16 +134,16 @@ public:
bool hasBorder() const { return mBorder != NULL; }
void setBorderVisible( bool b );
void setBackgroundColor( const LLColor4& color ) { mBgOpaqueColor = color; }
void setBackgroundColor( const LLUIColor& color ) { mBgOpaqueColor = color; }
const LLColor4& getBackgroundColor() const { return mBgOpaqueColor; }
void setTransparentColor(const LLColor4& color) { mBgAlphaColor = color; }
void setTransparentColor(const LLUIColor& color) { mBgAlphaColor = color; }
const LLColor4& getTransparentColor() const { return mBgAlphaColor; }
void setBackgroundImage(LLUIImage* image) { mBgOpaqueImage = image; }
void setTransparentImage(LLUIImage* image) { mBgAlphaImage = image; }
LLPointer<LLUIImage> getBackgroundImage() const { return mBgOpaqueImage; }
LLPointer<LLUIImage> getTransparentImage() const { return mBgAlphaImage; }
LLColor4 getBackgroundImageOverlay() { return mBgOpaqueImageOverlay; }
LLColor4 getTransparentImageOverlay() { return mBgAlphaImageOverlay; }
const LLColor4& getBackgroundImageOverlay() { return mBgOpaqueImageOverlay; }
const LLColor4& getTransparentImageOverlay() { return mBgAlphaImageOverlay; }
void setBackgroundVisible( bool b ) { mBgVisible = b; }
bool isBackgroundVisible() const { return mBgVisible; }
void setBackgroundOpaque(bool b) { mBgOpaque = b; }
@ -192,7 +192,7 @@ public:
// which takes a generic slot. Or use mCommitCallbackRegistrar.add() with
// a named callback and reference it in XML.
void childSetCommitCallback(std::string_view id, boost::function<void (LLUICtrl*,void*)> cb, void* data);
void childSetColor(std::string_view id, const LLColor4& color);
void childSetColor(std::string_view id, const LLUIColor& color);
LLCtrlSelectionInterface* childGetSelectionInterface(std::string_view id) const;
LLCtrlListInterface* childGetListInterface(std::string_view id) const;

View File

@ -465,7 +465,7 @@ LLScrollListCheck::LLScrollListCheck(const LLScrollListCell::Params& p)
setWidth(rect.getWidth()); //check_box->getWidth();
}
mCheckBox->setColor(p.color);
mCheckBox->setColor(p.color());
}

View File

@ -393,7 +393,7 @@ void LLSliderCtrl::setEnabled(bool b)
if( mLabelBox )
{
mLabelBox->setColor( b ? mTextEnabledColor.get() : mTextDisabledColor.get() );
mLabelBox->setColor( b ? mTextEnabledColor : mTextDisabledColor );
}
mSlider->setEnabled( b );
@ -405,7 +405,7 @@ void LLSliderCtrl::setEnabled(bool b)
if( mTextBox )
{
mTextBox->setColor( b ? mTextEnabledColor.get() : mTextDisabledColor.get() );
mTextBox->setColor( b ? mTextEnabledColor : mTextDisabledColor );
}
}

View File

@ -107,8 +107,8 @@ public:
F32 getMaxValue() const { return mSlider->getMaxValue(); }
void setLabel(const LLStringExplicit& label) { if (mLabelBox) mLabelBox->setText(label); }
void setLabelColor(const LLColor4& c) { mTextEnabledColor = c; }
void setDisabledLabelColor(const LLColor4& c) { mTextDisabledColor = c; }
void setLabelColor(const LLUIColor& c) { mTextEnabledColor = c; }
void setDisabledLabelColor(const LLUIColor& c) { mTextDisabledColor = c; }
boost::signals2::connection setSliderMouseDownCallback( const commit_signal_t::slot_type& cb );
boost::signals2::connection setSliderMouseUpCallback( const commit_signal_t::slot_type& cb );

View File

@ -310,7 +310,7 @@ void LLSpinCtrl::updateLabelColor()
{
if( mLabelBox )
{
mLabelBox->setColor( getEnabled() ? mTextEnabledColor.get() : mTextDisabledColor.get() );
mLabelBox->setColor( getEnabled() ? mTextEnabledColor : mTextDisabledColor );
}
}

View File

@ -77,8 +77,8 @@ public:
virtual void setPrecision(S32 precision);
void setLabel(const LLStringExplicit& label);
void setLabelColor(const LLColor4& c) { mTextEnabledColor = c; updateLabelColor(); }
void setDisabledLabelColor(const LLColor4& c) { mTextDisabledColor = c; updateLabelColor();}
void setLabelColor(const LLUIColor& c) { mTextEnabledColor = c; updateLabelColor(); }
void setDisabledLabelColor(const LLUIColor& c) { mTextDisabledColor = c; updateLabelColor();}
void setAllowEdit(bool allow_edit);
virtual void onTabInto();

View File

@ -1411,14 +1411,14 @@ void LLTextBase::draw()
//virtual
void LLTextBase::setColor( const LLColor4& c )
void LLTextBase::setColor( const LLUIColor& c )
{
mFgColor = c;
mStyleDirty = true;
}
//virtual
void LLTextBase::setReadOnlyColor(const LLColor4 &c)
void LLTextBase::setReadOnlyColor(const LLUIColor &c)
{
mReadOnlyFgColor = c;
mStyleDirty = true;

View File

@ -372,8 +372,8 @@ public:
// LLUICtrl interface
/*virtual*/ bool acceptsTextInput() const override { return !mReadOnly; }
/*virtual*/ void setColor(const LLColor4& c) override;
virtual void setReadOnlyColor(const LLColor4 &c);
/*virtual*/ void setColor(const LLUIColor& c) override;
virtual void setReadOnlyColor(const LLUIColor& c);
/*virtual*/ void onVisibilityChange(bool new_visibility) override;
/*virtual*/ void setValue(const LLSD& value) override;

View File

@ -1023,7 +1023,7 @@ bool LLUICtrl::getTentative() const
}
// virtual
void LLUICtrl::setColor(const LLColor4& color)
void LLUICtrl::setColor(const LLUIColor& color)
{ }
F32 LLUICtrl::getCurrentTransparency()

View File

@ -216,7 +216,7 @@ public:
// selected radio button, etc.). Defaults to no-op.
virtual void clear();
virtual void setColor(const LLColor4& color);
virtual void setColor(const LLUIColor& color);
// Ansariel: Changed to virtual. We might want to change the transparency ourself!
virtual F32 getCurrentTransparency();

View File

@ -73,14 +73,14 @@ LLViewBorder::LLViewBorder(const LLViewBorder::Params& p)
mStyle(p.render_style)
{}
void LLViewBorder::setColors( const LLColor4& shadow_dark, const LLColor4& highlight_light )
void LLViewBorder::setColors( const LLUIColor& shadow_dark, const LLUIColor& highlight_light )
{
mShadowDark = shadow_dark;
mHighlightLight = highlight_light;
}
void LLViewBorder::setColorsExtended( const LLColor4& shadow_light, const LLColor4& shadow_dark,
const LLColor4& highlight_light, const LLColor4& highlight_dark )
void LLViewBorder::setColorsExtended( const LLUIColor& shadow_light, const LLUIColor& shadow_dark,
const LLUIColor& highlight_light, const LLUIColor& highlight_dark )
{
mShadowDark = shadow_dark;
mShadowLight = shadow_light;

View File

@ -77,9 +77,9 @@ public:
S32 getBorderWidth() const { return mBorderWidth; }
void setBevel(EBevel bevel) { mBevel = bevel; }
EBevel getBevel() const { return mBevel; }
void setColors( const LLColor4& shadow_dark, const LLColor4& highlight_light );
void setColorsExtended( const LLColor4& shadow_light, const LLColor4& shadow_dark,
const LLColor4& highlight_light, const LLColor4& highlight_dark );
void setColors( const LLUIColor& shadow_dark, const LLUIColor& highlight_light );
void setColorsExtended( const LLUIColor& shadow_light, const LLUIColor& shadow_dark,
const LLUIColor& highlight_light, const LLUIColor& highlight_dark );
void setTexture( const class LLUUID &image_id );
LLColor4 getHighlightLight() {return mHighlightLight.get();}

View File

@ -1020,8 +1020,8 @@ void LLOutfitGalleryItem::setOutfitWorn(bool value)
LLStringUtil::format_map_t worn_string_args;
std::string worn_string = getString("worn_string", worn_string_args);
LLUIColor text_color = LLUIColorTable::instance().getColor("White", LLColor4::white);
mOutfitWornText->setReadOnlyColor(text_color.get());
mOutfitNameText->setReadOnlyColor(text_color.get());
mOutfitWornText->setReadOnlyColor(text_color);
mOutfitNameText->setReadOnlyColor(text_color);
mOutfitWornText->setFont(value ? LLFontGL::getFontSansSerifBold() : LLFontGL::getFontSansSerifSmall());
mOutfitNameText->setFont(value ? LLFontGL::getFontSansSerifBold() : LLFontGL::getFontSansSerifSmall());
mOutfitWornText->setValue(value ? worn_string : "");

View File

@ -2190,7 +2190,7 @@ void LLViewerWindow::initWorldUI()
gStatusBar->setFollows(FOLLOWS_LEFT | FOLLOWS_TOP | FOLLOWS_RIGHT);
gStatusBar->setShape(status_bar_container->getLocalRect());
// sync bg color with menu bar
gStatusBar->setBackgroundColor(gMenuBarView->getBackgroundColor().get());
gStatusBar->setBackgroundColor(gMenuBarView->getBackgroundColor());
// add InBack so that gStatusBar won't be drawn over menu
status_bar_container->addChildInBack(gStatusBar, 2/*tab order, after menu*/);
status_bar_container->setVisible(true);
@ -2199,7 +2199,7 @@ void LLViewerWindow::initWorldUI()
LLView* nav_bar_container = getRootView()->getChild<LLView>("nav_bar_container");
navbar->setShape(nav_bar_container->getLocalRect());
navbar->setBackgroundColor(gMenuBarView->getBackgroundColor().get());
navbar->setBackgroundColor(gMenuBarView->getBackgroundColor());
nav_bar_container->addChild(navbar);
nav_bar_container->setVisible(true);
}