make sure that the (hidden) useAnimation flag also disables button hover animated glow

svn path=/trunk/KDE/kdebase/workspace/; revision=1084320
This commit is contained in:
Hugo Pereira Da Costa 2010-02-02 21:55:56 +00:00
parent 20650bc139
commit 5a852ac75b
2 changed files with 16 additions and 3 deletions

View file

@ -117,6 +117,10 @@ namespace Oxygen
bool OxygenButton::isActive( void ) const
{ return (!forceInactive_) && client_.isActive(); }
//___________________________________________________
bool OxygenButton::animateButtonHover( void ) const
{ return client_.configuration().useAnimations(); }
//___________________________________________________
QSize OxygenButton::sizeHint() const
{
@ -135,8 +139,14 @@ namespace Oxygen
KCommonDecorationButton::enterEvent(e);
if (status_ != Oxygen::Pressed) status_ = Oxygen::Hovered;
glowAnimation().data()->setDirection( Animation::Forward );
if( !isAnimated() ) glowAnimation().data()->start();
if( animateButtonHover() )
{
glowAnimation().data()->setDirection( Animation::Forward );
if( !isAnimated() ) glowAnimation().data()->start();
} else update();
}
//___________________________________________________
@ -145,7 +155,7 @@ namespace Oxygen
KCommonDecorationButton::leaveEvent(e);
if( status_ == Oxygen::Hovered )
if( status_ == Oxygen::Hovered && animateButtonHover() )
{
glowAnimation().data()->setDirection( Animation::Backward );
if( !isAnimated() ) glowAnimation().data()->start();

View file

@ -126,6 +126,9 @@ namespace Oxygen
//! true if button is active
bool isActive( void ) const;
//! true if buttons hover are animated
bool animateButtonHover( void ) const;
private:
//! parent client