diff --git a/clients/oxygen/oxygenbutton.cpp b/clients/oxygen/oxygenbutton.cpp index 9d8c030e3f..213176baf3 100644 --- a/clients/oxygen/oxygenbutton.cpp +++ b/clients/oxygen/oxygenbutton.cpp @@ -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(); diff --git a/clients/oxygen/oxygenbutton.h b/clients/oxygen/oxygenbutton.h index 86760196c2..26c33280be 100644 --- a/clients/oxygen/oxygenbutton.h +++ b/clients/oxygen/oxygenbutton.h @@ -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