From b5377e58347f84d552bc9689264c1fc8240523b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Sat, 7 Aug 2010 11:41:01 +0000 Subject: [PATCH] Sliding Popups effect can read the fade in and out duration from the property. Added for the usecase of Yakuake. svn path=/trunk/KDE/kdebase/workspace/; revision=1160205 --- effects/slidingpopups/slidingpopups.cpp | 17 +++++++++++++++-- effects/slidingpopups/slidingpopups.h | 2 ++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/effects/slidingpopups/slidingpopups.cpp b/effects/slidingpopups/slidingpopups.cpp index 629299205b..8bc8d831e3 100644 --- a/effects/slidingpopups/slidingpopups.cpp +++ b/effects/slidingpopups/slidingpopups.cpp @@ -145,7 +145,7 @@ void SlidingPopupsEffect::windowAdded( EffectWindow* w ) propertyNotify( w, mAtom ); if( w->isOnCurrentDesktop() && mWindowsData.contains( w ) ) { - mAppearingWindows[ w ].setDuration( animationTime( mFadeInTime ) ); + mAppearingWindows[ w ].setDuration( mWindowsData[ w ].fadeInDuration ); mAppearingWindows[ w ].setProgress( 0.0 ); mAppearingWindows[ w ].setCurveShape( TimeLine::EaseOutCurve ); @@ -163,7 +163,7 @@ void SlidingPopupsEffect::windowClosed( EffectWindow* w ) { w->refWindow(); mAppearingWindows.remove( w ); - mDisappearingWindows[ w ].setDuration( animationTime( mFadeOutTime )); + mDisappearingWindows[ w ].setDuration( mWindowsData[ w ].fadeOutDuration ); mDisappearingWindows[ w ].setProgress( 0.0 ); mDisappearingWindows[ w ].setCurveShape( TimeLine::EaseOutCurve ); @@ -196,6 +196,19 @@ void SlidingPopupsEffect::propertyNotify( EffectWindow* w, long a ) Data animData; animData.start = d[ 0 ]; animData.from = (Position)d[ 1 ]; + if( data.length() >= (int)(sizeof( long ) * 3) ) + { + animData.fadeInDuration = d[2]; + if( data.length() >= (int)(sizeof( long ) * 4) ) + animData.fadeOutDuration = d[3]; + else + animData.fadeOutDuration = d[2]; + } + else + { + animData.fadeInDuration = animationTime( mFadeInTime ); + animData.fadeOutDuration = animationTime( mFadeOutTime ); + } mWindowsData[ w ] = animData; } } // namespace diff --git a/effects/slidingpopups/slidingpopups.h b/effects/slidingpopups/slidingpopups.h index f29698915c..6cbbb69e6d 100644 --- a/effects/slidingpopups/slidingpopups.h +++ b/effects/slidingpopups/slidingpopups.h @@ -55,6 +55,8 @@ class SlidingPopupsEffect int start; //point in screen coordinates where the window starts //to animate, from decides if this point is an x or an y Position from; + int fadeInDuration; + int fadeOutDuration; }; long mAtom; QHash< const EffectWindow*, TimeLine > mAppearingWindows;