Use the opacity of the window that a taskbar thumbnail is displayed on

when displaying the thumbnail. This allows thumbnails to fade in and out
with the Plasma tooltip for example instead of always being opaque.

svn path=/trunk/KDE/kdebase/workspace/; revision=920573
This commit is contained in:
Lucas Murray 2009-02-03 09:39:48 +00:00
parent d12b115dbe
commit 6763fd5728
2 changed files with 10 additions and 5 deletions

View file

@ -67,18 +67,22 @@ void TaskbarThumbnailEffect::paintWindow( EffectWindow* w, int mask, QRegion reg
effects->paintWindow( w, mask, region, data ); // paint window first
if( thumbnails.contains( w ))
{ // paint thumbnails on it
int mask = PAINT_WINDOW_TRANSFORMED;
if( data.opacity == 1.0 )
mask |= PAINT_WINDOW_OPAQUE;
else
mask |= PAINT_WINDOW_TRANSLUCENT;
foreach( const Data &thumb, thumbnails.values( w ))
{
EffectWindow* thumbw = effects->findWindow( thumb.window );
if( thumbw == NULL )
continue;
WindowPaintData data( thumbw );
WindowPaintData thumbData( thumbw );
thumbData.opacity = data.opacity;
QRect r;
setPositionTransformations( data, r,
setPositionTransformations( thumbData, r,
thumbw, thumb.rect.translated( w->pos()), Qt::KeepAspectRatio );
effects->drawWindow( thumbw,
PAINT_WINDOW_OPAQUE | PAINT_WINDOW_TRANSFORMED,
r, data );
effects->drawWindow( thumbw, mask, r, thumbData );
}
}
}

View file

@ -116,4 +116,5 @@ X-KDE-PluginInfo-Category=Appearance
X-KDE-PluginInfo-Depends=
X-KDE-PluginInfo-License=GPL
X-KDE-PluginInfo-EnabledByDefault=true
X-KDE-Ordering=70
X-KDE-Library=kwin4_effect_builtins