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.
wilder-portage
Kurt Hindenburg 12 years ago
parent 09ca63dbb6
commit c05eda634a
  1. 7
      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);
}

Loading…
Cancel
Save