Add getActiveColor functions to IGUIStaticText and IGUIButton
Returns currently used color - depending on state and if override color is set. Note: Not adding this to editbox for now as it's a bit more tricky there (selection changing color, so it has no single color). git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6165 dfc29bdd-3216-0410-991c-e03cc46cb475
This commit is contained in:
@@ -327,7 +327,7 @@ void CGUIButton::draw()
|
||||
|
||||
if (font)
|
||||
font->draw(Text.c_str(), rect,
|
||||
OverrideColorEnabled ? OverrideColor : skin->getColor(isEnabled() ? EGDC_BUTTON_TEXT : EGDC_GRAY_TEXT),
|
||||
getActiveColor(),
|
||||
true, true, &AbsoluteClippingRect);
|
||||
}
|
||||
|
||||
@@ -466,6 +466,16 @@ video::SColor CGUIButton::getOverrideColor() const
|
||||
return OverrideColor;
|
||||
}
|
||||
|
||||
irr::video::SColor CGUIButton::getActiveColor() const
|
||||
{
|
||||
if ( OverrideColorEnabled )
|
||||
return OverrideColor;
|
||||
IGUISkin* skin = Environment->getSkin();
|
||||
if (skin)
|
||||
return OverrideColorEnabled ? OverrideColor : skin->getColor(isEnabled() ? EGDC_BUTTON_TEXT : EGDC_GRAY_TEXT);
|
||||
return OverrideColor;
|
||||
}
|
||||
|
||||
void CGUIButton::enableOverrideColor(bool enable)
|
||||
{
|
||||
OverrideColorEnabled = enable;
|
||||
|
Reference in New Issue
Block a user