STextButton: backup color as a local variable
This commit is contained in:
parent
be56de72c1
commit
c6f7e81b70
2 changed files with 2 additions and 3 deletions
|
|
@ -435,13 +435,13 @@ void STextButton::setHoverColor (const CColor& color)
|
||||||
|
|
||||||
void STextButton::draw(CDrawContext* context)
|
void STextButton::draw(CDrawContext* context)
|
||||||
{
|
{
|
||||||
backupColor_ = textColor;
|
CColor backupColor = textColor;
|
||||||
if (hovered) {
|
if (hovered) {
|
||||||
textColor = hoverColor_; // textColor is protected
|
textColor = hoverColor_; // textColor is protected
|
||||||
}
|
}
|
||||||
CTextButton::draw(context);
|
CTextButton::draw(context);
|
||||||
if (hovered)
|
if (hovered)
|
||||||
textColor = backupColor_;
|
textColor = backupColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -160,6 +160,5 @@ public:
|
||||||
void draw(CDrawContext* context) override;
|
void draw(CDrawContext* context) override;
|
||||||
private:
|
private:
|
||||||
CColor hoverColor_;
|
CColor hoverColor_;
|
||||||
CColor backupColor_;
|
|
||||||
bool hovered { false };
|
bool hovered { false };
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue