mirror of
https://github.com/KDE/konsole.git
synced 2026-05-04 12:44:23 -04:00
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
This commit is contained in:
@@ -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 )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user