From f509762f997bd84ec161c3b43590979f9f5be55d Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sun, 29 Jan 2006 12:41:58 +0000 Subject: Fixes transparency and enabled transparency for disabled buttons. svn-id: r20295 --- gui/ThemeNew.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'gui/ThemeNew.cpp') diff --git a/gui/ThemeNew.cpp b/gui/ThemeNew.cpp index 45beb7625e..3e4496d158 100644 --- a/gui/ThemeNew.cpp +++ b/gui/ThemeNew.cpp @@ -348,8 +348,9 @@ void ThemeNew::drawButton(const Common::Rect &r, const Common::String &str, kSta if (!_initOk) return; + restoreBackground(r); drawRectMasked(r, surface(kWidgetBkgdCorner), surface(kWidgetBkgdTop), surface(kWidgetBkgdLeft), surface(kWidgetBkgd), - 256, _colors[kButtonBackgroundStart], _colors[kButtonBackgroundEnd], 2); + (state == kStateDisabled) ? 128 : 256, _colors[kButtonBackgroundStart], _colors[kButtonBackgroundEnd], 2); const int off = (r.height() - _font->getFontHeight()) / 2; @@ -747,7 +748,7 @@ void ThemeNew::drawSurfaceMasked(const Common::Rect &r, const Graphics::Surface OverlayColor rowColor = calcGradient(start, end, i, r.height(), factor); for (int x = 0; x < drawWidth; ++x) { if (src[x] != transparency && dst >= _screen.pixels) { - dst[x] = getColorAlpha(src[x], dst[x], alpha) & rowColor; + dst[x] = getColorAlpha(src[x] & rowColor, dst[x], alpha); } } dst += _screen.w; @@ -760,7 +761,7 @@ void ThemeNew::drawSurfaceMasked(const Common::Rect &r, const Graphics::Surface OverlayColor rowColor = calcGradient(start, end, i, r.height(), factor); for (int x = 0; x < drawWidth; ++x) { if (src[drawWidth-x-1] != transparency && dst >= _screen.pixels) { - dst[x] = getColorAlpha(src[drawWidth-x-1], dst[x], alpha) & rowColor; + dst[x] = getColorAlpha(src[drawWidth-x-1] & rowColor, dst[x], alpha); } } dst += _screen.w; @@ -773,7 +774,7 @@ void ThemeNew::drawSurfaceMasked(const Common::Rect &r, const Graphics::Surface OverlayColor rowColor = calcGradient(start, end, i, r.height(), factor); for (int x = 0; x < drawWidth; ++x) { if (src[drawWidth-x-1] != transparency && dst >= _screen.pixels) { - dst[x] = getColorAlpha(src[drawWidth-x-1], dst[x], alpha) & rowColor; + dst[x] = getColorAlpha(src[drawWidth-x-1] & rowColor, dst[x], alpha); } } dst += _screen.w; @@ -786,7 +787,7 @@ void ThemeNew::drawSurfaceMasked(const Common::Rect &r, const Graphics::Surface OverlayColor rowColor = calcGradient(start, end, i, r.height(), factor); for (int x = 0; x < drawWidth; ++x) { if (src[x] != transparency && dst >= _screen.pixels) { - dst[x] = getColorAlpha(src[x], dst[x], alpha) & rowColor; + dst[x] = getColorAlpha(src[x] & rowColor, dst[x], alpha); } } dst += _screen.w; -- cgit v1.2.3