aboutsummaryrefslogtreecommitdiff
path: root/source/Irrlicht/CGUIButton.cpp
diff options
context:
space:
mode:
authorcutealien <cutealien@dfc29bdd-3216-0410-991c-e03cc46cb475>2020-12-19 15:03:11 +0000
committercutealien <cutealien@dfc29bdd-3216-0410-991c-e03cc46cb475>2020-12-19 15:03:11 +0000
commitfa0b1cb5092bb1c2109ff870587a32b771179705 (patch)
tree5f5f85e537b2d5d92ff2a2b2e621549a2cc9c062 /source/Irrlicht/CGUIButton.cpp
parent01920bf808be378363ebcdc81e78b251d9189f60 (diff)
downloadirrlicht-fa0b1cb5092bb1c2109ff870587a32b771179705.tar.xz
Merging r6145 through r6171 from trunk to ogl-es branch
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/branches/ogl-es@6172 dfc29bdd-3216-0410-991c-e03cc46cb475
Diffstat (limited to 'source/Irrlicht/CGUIButton.cpp')
-rw-r--r--source/Irrlicht/CGUIButton.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/source/Irrlicht/CGUIButton.cpp b/source/Irrlicht/CGUIButton.cpp
index 895e31a..95d2b37 100644
--- a/source/Irrlicht/CGUIButton.cpp
+++ b/source/Irrlicht/CGUIButton.cpp
@@ -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;