Commit fdc68343 authored by Robert Knight's avatar Robert Knight
Browse files

Use color scheme's transparency to draw item backgrounds in color scheme list...

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
parent 8e72dd41
......@@ -33,6 +33,7 @@
#include <KIconDialog>
#include <KDirSelectDialog>
#include <KUrlCompletion>
#include <KWindowSystem>
// 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 )
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment