OxygenClient: remove use of QWeakPointer for the glowAnimation_ as it is unnecessary: the object is never used outside of the class
and is a child of the client, deleted in the client destructor, by Qt. Client, Button: removed useless acessor to the glowAnimation pointer. svn path=/trunk/KDE/kdebase/workspace/; revision=1170327
This commit is contained in:
parent
1a1d2b964b
commit
6309ac1928
4 changed files with 23 additions and 35 deletions
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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_;
|
||||
|
|
Loading…
Reference in a new issue