condition tabbing animations to the 'useAnimation' flag, for consistancy with other animations. begin and final animation states are kept visually unchanged. Only the smooth transition between the two is disabled.

svn path=/trunk/KDE/kdebase/workspace/; revision=1088957
icc-effect-5.14.5
Hugo Pereira Da Costa 2010-02-12 01:14:43 +00:00
parent c896faa443
commit fa03ee04a2
3 changed files with 35 additions and 3 deletions

View File

@ -174,6 +174,7 @@ namespace Oxygen
glowAnimation().data()->setDuration( configuration_.animationsDuration() );
titleAnimationData_.data()->setDuration( configuration_.animationsDuration() );
itemData_.animation().data()->setDuration( configuration_.animationsDuration() );
itemData_.setAnimationsEnabled( configuration_.useAnimations() );
// reset title transitions
titleAnimationData_.data()->reset();

View File

@ -39,6 +39,8 @@ namespace Oxygen
QObject( parent ),
QList<ClientGroupItemData>(),
client_( *parent ),
dirty_( false ),
animationsEnabled_( true ),
animation_( new Animation( 150, this ) ),
animationType_( AnimationNone ),
progress_(0),
@ -157,8 +159,19 @@ namespace Oxygen
targetRect_.setWidth( width );
}
if( animate ) animation().data()->start();
else {
if( animate )
{
if( animationsEnabled() ) animation().data()->start();
else {
// change progress to maximum
progress_ = 1;
updateBoundingRects();
}
} else {
for( int index = 0; index < count(); index++ )
{
@ -236,7 +249,14 @@ namespace Oxygen
}
animation().data()->start();
if( animationsEnabled() ) animation().data()->start();
else {
// change progress to maximum
progress_ = 1;
updateBoundingRects();
}
}

View File

@ -121,6 +121,14 @@ namespace Oxygen
bool isDirty( void ) const
{ return dirty_; }
//! enable animations
void setAnimationsEnabled( bool value )
{ animationsEnabled_ = value; }
//! animations enabled
bool animationsEnabled( void ) const
{ return animationsEnabled_; }
//! true if being animated
bool isAnimated( void ) const
{ return animationType_ != AnimationNone; }
@ -183,6 +191,9 @@ namespace Oxygen
/* used to trigger update at next paintEvent */
bool dirty_;
//! true if animations are enabled
bool animationsEnabled_;
//! animation
Animation::Pointer animation_;