From c05eda634a514b045ac1159421c5559dbc3a77c7 Mon Sep 17 00:00:00 2001 From: Kurt Hindenburg Date: Mon, 10 Feb 2014 21:19:00 -0500 Subject: [PATCH] Add #if for MacOS to ignore opacity - it only adjusts brightness CompositionMode doesn't work on MacOSX - since changing the opacity just altered the brightness, #if def it. --- src/TerminalDisplay.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/TerminalDisplay.cpp b/src/TerminalDisplay.cpp index e637f895..0bfdb3ba 100644 --- a/src/TerminalDisplay.cpp +++ b/src/TerminalDisplay.cpp @@ -618,9 +618,11 @@ void TerminalDisplay::drawBackground(QPainter& painter, const QRect& rect, const if (useOpacitySetting && !_wallpaper->isNull() && _wallpaper->draw(painter, contentsRect, _opacity)) { } else if (qAlpha(_blendColor) < 0xff && useOpacitySetting) { +#if defined(Q_OS_MAC) // TODO - On MacOS, using CompositionMode doesn't work. Altering the - // transparency in the color scheme (appears to) alter the - // brightness(?). I'm not sure #ifdef is worthwhile ATM. + // transparency in the color scheme alters the brightness. + painter.fillRect(contentsRect, backgroundColor); +#else QColor color(backgroundColor); color.setAlpha(qAlpha(_blendColor)); @@ -628,6 +630,7 @@ void TerminalDisplay::drawBackground(QPainter& painter, const QRect& rect, const painter.setCompositionMode(QPainter::CompositionMode_Source); painter.fillRect(contentsRect, color); painter.restore(); +#endif } else { painter.fillRect(contentsRect, backgroundColor); }