From 5a852ac75b9c89ae052fdb9a25fa296885e00bd2 Mon Sep 17 00:00:00 2001 From: Hugo Pereira Da Costa Date: Tue, 2 Feb 2010 21:55:56 +0000 Subject: [PATCH] make sure that the (hidden) useAnimation flag also disables button hover animated glow svn path=/trunk/KDE/kdebase/workspace/; revision=1084320 --- clients/oxygen/oxygenbutton.cpp | 16 +++++++++++++--- clients/oxygen/oxygenbutton.h | 3 +++ 2 files changed, 16 insertions(+), 3 deletions(-) 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