diff --git a/clients/oxygen/oxygenbutton.cpp b/clients/oxygen/oxygenbutton.cpp index 0032fa531e..cd7e32ce21 100644 --- a/clients/oxygen/oxygenbutton.cpp +++ b/clients/oxygen/oxygenbutton.cpp @@ -65,11 +65,11 @@ namespace Oxygen setToolTip(tip); // setup animation - glowAnimation()->setStartValue( 0 ); - glowAnimation()->setEndValue( 1.0 ); - glowAnimation()->setTargetObject( this ); - glowAnimation()->setPropertyName( "glowIntensity" ); - glowAnimation()->setEasingCurve( QEasingCurve::InOutQuad ); + glowAnimation_->setStartValue( 0 ); + glowAnimation_->setEndValue( 1.0 ); + glowAnimation_->setTargetObject( this ); + glowAnimation_->setPropertyName( "glowIntensity" ); + glowAnimation_->setEasingCurve( QEasingCurve::InOutQuad ); // setup connections reset(0); @@ -107,7 +107,7 @@ namespace Oxygen //___________________________________________________ void Button::reset( unsigned long ) - { glowAnimation()->setDuration( client_.configuration().animationsDuration() ); } + { glowAnimation_->setDuration( client_.configuration().animationsDuration() ); } //___________________________________________________ @@ -119,8 +119,8 @@ namespace Oxygen if( animateButtonHover() ) { - glowAnimation()->setDirection( Animation::Forward ); - if( !isAnimated() ) glowAnimation()->start(); + glowAnimation_->setDirection( Animation::Forward ); + if( !isAnimated() ) glowAnimation_->start(); } else update(); @@ -134,8 +134,8 @@ namespace Oxygen if( status_ == Oxygen::Hovered && animateButtonHover() ) { - glowAnimation()->setDirection( Animation::Backward ); - if( !isAnimated() ) glowAnimation()->start(); + glowAnimation_->setDirection( Animation::Backward ); + if( !isAnimated() ) glowAnimation_->start(); } status_ = Oxygen::Normal; diff --git a/clients/oxygen/oxygenbutton.h b/clients/oxygen/oxygenbutton.h index 381cecb2c2..befb51681f 100644 --- a/clients/oxygen/oxygenbutton.h +++ b/clients/oxygen/oxygenbutton.h @@ -94,15 +94,6 @@ namespace Oxygen protected: - //!@name glow animation - //@{ - - //! return animation object - Animation* glowAnimation() const - { return glowAnimation_; } - - //@} - //! press event void mousePressEvent(QMouseEvent* ); @@ -134,7 +125,7 @@ namespace Oxygen //! true if animation is in progress bool isAnimated( void ) const - { return glowAnimation()->isRunning(); } + { return glowAnimation_->isRunning(); } //! true if button is active bool isActive( void ) const; diff --git a/clients/oxygen/oxygenclient.cpp b/clients/oxygen/oxygenclient.cpp index d7e9bea4ed..9b799f4973 100644 --- a/clients/oxygen/oxygenclient.cpp +++ b/clients/oxygen/oxygenclient.cpp @@ -86,12 +86,12 @@ namespace Oxygen widget()->setAcceptDrops( true ); // setup glow animation - glowAnimation().data()->setStartValue( glowBias() ); - glowAnimation().data()->setEndValue( 1.0 ); - glowAnimation().data()->setTargetObject( this ); - glowAnimation().data()->setPropertyName( "glowIntensity" ); - glowAnimation().data()->setEasingCurve( QEasingCurve::InOutQuad ); - connect( glowAnimation().data(), SIGNAL( finished( void ) ), this, SLOT( clearForceActive( void ) ) ); + glowAnimation_->setStartValue( glowBias() ); + glowAnimation_->setEndValue( 1.0 ); + glowAnimation_->setTargetObject( this ); + glowAnimation_->setPropertyName( "glowIntensity" ); + glowAnimation_->setEasingCurve( QEasingCurve::InOutQuad ); + connect( glowAnimation_, SIGNAL( finished( void ) ), this, SLOT( clearForceActive( void ) ) ); // title animation data @@ -138,7 +138,7 @@ namespace Oxygen configuration_ = factory_->configuration( *this ); // animations duration - glowAnimation().data()->setDuration( configuration_.animationsDuration() ); + glowAnimation_->setDuration( configuration_.animationsDuration() ); titleAnimationData_.data()->setDuration( configuration_.animationsDuration() ); itemData_.animation().data()->setDuration( configuration_.animationsDuration() ); itemData_.setAnimationsEnabled( useAnimations() ); @@ -1102,8 +1102,8 @@ namespace Oxygen // reset animation if( animateActiveChange() ) { - glowAnimation().data()->setDirection( isActive() ? Animation::Forward : Animation::Backward ); - if(!glowIsAnimated()) { glowAnimation().data()->start(); } + glowAnimation_->setDirection( isActive() ? Animation::Forward : Animation::Backward ); + if(!glowIsAnimated()) { glowAnimation_->start(); } } // update size grip so that it gets the right color diff --git a/clients/oxygen/oxygenclient.h b/clients/oxygen/oxygenclient.h index 4289754d8a..6fd911c043 100644 --- a/clients/oxygen/oxygenclient.h +++ b/clients/oxygen/oxygenclient.h @@ -84,7 +84,7 @@ namespace Oxygen //! true if glow is animated bool glowIsAnimated( void ) const - { return glowAnimation_.data()->isRunning(); } + { return glowAnimation_->isRunning(); } //! true when decoration is forced active bool isForcedActive( void ) const @@ -118,9 +118,6 @@ namespace Oxygen //!@name glow animation //@{ - virtual const Animation::Pointer& glowAnimation( void ) const - { return glowAnimation_; } - void setGlowIntensity( qreal value ) { if( glowIntensity_ == value ) return; @@ -139,7 +136,7 @@ namespace Oxygen //! true (biased) intensity /*! this is needed to have glow go from either 0.2->1 or 0.8->0 depending on the animation direction */ qreal glowIntensity( void ) const - { return glowAnimation().data()->direction() == Animation::Forward ? glowIntensity_ : glowIntensity_-glowBias(); } + { return glowAnimation_->direction() == Animation::Forward ? glowIntensity_ : glowIntensity_-glowBias(); } //@} @@ -406,7 +403,7 @@ namespace Oxygen Configuration configuration_; //! glow animation - Animation::Pointer glowAnimation_; + Animation* glowAnimation_; //! title animation data TitleAnimationData::Pointer titleAnimationData_;