From 6763fd5728bb8da63dff0dbdde9cec862f0cf3f0 Mon Sep 17 00:00:00 2001 From: Lucas Murray Date: Tue, 3 Feb 2009 09:39:48 +0000 Subject: [PATCH] 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 --- effects/taskbarthumbnail.cpp | 14 +++++++++----- effects/taskbarthumbnail.desktop | 1 + 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/effects/taskbarthumbnail.cpp b/effects/taskbarthumbnail.cpp index 8bcd3adfb1..a16327cbc8 100644 --- a/effects/taskbarthumbnail.cpp +++ b/effects/taskbarthumbnail.cpp @@ -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 ); } } } diff --git a/effects/taskbarthumbnail.desktop b/effects/taskbarthumbnail.desktop index 3b3ff9781c..27f63ef48d 100644 --- a/effects/taskbarthumbnail.desktop +++ b/effects/taskbarthumbnail.desktop @@ -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