From fdc683432c8dc4c5658d39ba0d1b1eb670d3d67e Mon Sep 17 00:00:00 2001 From: Robert Knight Date: Sat, 19 May 2007 19:32:05 +0000 Subject: [PATCH] Use color scheme's transparency to draw item backgrounds in color scheme list if compositing is available. Untested. svn path=/trunk/KDE/kdebase/apps/konsole/; revision=666405 --- src/EditProfileDialog.cpp | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/src/EditProfileDialog.cpp b/src/EditProfileDialog.cpp index 2eee77924..cf3417145 100644 --- a/src/EditProfileDialog.cpp +++ b/src/EditProfileDialog.cpp @@ -33,6 +33,7 @@ #include #include #include +#include // Konsole #include "ColorScheme.h" @@ -850,10 +851,24 @@ void ColorSchemeViewDelegate::paint(QPainter* painter, const QStyleOptionViewIte Q_ASSERT(scheme); + bool transparencyAvailable = KWindowSystem::compositingActive(); + // draw background - QBrush brush(scheme->backgroundColor()); - painter->fillRect( option.rect , brush ); - + QColor color = scheme->backgroundColor(); + + if ( transparencyAvailable ) + { + painter->save(); + color.setAlphaF(scheme->opacity()); + painter->setCompositionMode( QPainter::CompositionMode_Source ); + painter->fillRect( option.rect , color ); + painter->restore(); + } + else + { + painter->fillRect( option.rect , color ); + } + // draw border on selected items if ( option.state & QStyle::State_Selected ) {