use bias to set window state glow intensity and have emulate faster responding animations
svn path=/trunk/KDE/kdebase/workspace/; revision=1050705
This commit is contained in:
parent
045daadccb
commit
4b6c98b7ac
2 changed files with 15 additions and 4 deletions
|
@ -117,8 +117,8 @@ namespace Oxygen
|
||||||
widget()->setAcceptDrops( true );
|
widget()->setAcceptDrops( true );
|
||||||
|
|
||||||
// setup glow animation
|
// setup glow animation
|
||||||
glowAnimation().data()->setStartValue( 0.1 );
|
glowAnimation().data()->setStartValue( glowBias() );
|
||||||
glowAnimation().data()->setEndValue( 0.9 );
|
glowAnimation().data()->setEndValue( 1.0 );
|
||||||
glowAnimation().data()->setTargetObject( this );
|
glowAnimation().data()->setTargetObject( this );
|
||||||
glowAnimation().data()->setPropertyName( "glowIntensity" );
|
glowAnimation().data()->setPropertyName( "glowIntensity" );
|
||||||
glowAnimation().data()->setCurveShape( Animation::EaseInOutCurve );
|
glowAnimation().data()->setCurveShape( Animation::EaseInOutCurve );
|
||||||
|
|
|
@ -48,7 +48,8 @@ namespace Oxygen
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
//! declare glow intensity property
|
//! declare glow intensity property
|
||||||
Q_PROPERTY( qreal glowIntensity READ glowIntensity WRITE setGlowIntensity )
|
//!Q_PROPERTY( qreal glowIntensity READ glowIntensity WRITE setGlowIntensity )
|
||||||
|
Q_PROPERTY( qreal glowIntensity READ glowIntensityUnbiased WRITE setGlowIntensity )
|
||||||
|
|
||||||
//! declare title opacity
|
//! declare title opacity
|
||||||
Q_PROPERTY( qreal titleOpacity READ titleOpacity WRITE setTitleOpacity )
|
Q_PROPERTY( qreal titleOpacity READ titleOpacity WRITE setTitleOpacity )
|
||||||
|
@ -119,9 +120,19 @@ namespace Oxygen
|
||||||
void setGlowIntensity( qreal value )
|
void setGlowIntensity( qreal value )
|
||||||
{ glowIntensity_ = value; }
|
{ glowIntensity_ = value; }
|
||||||
|
|
||||||
qreal glowIntensity( void ) const
|
//! unbiased glow intensity
|
||||||
|
qreal glowIntensityUnbiased( void ) const
|
||||||
{ return glowIntensity_; }
|
{ return glowIntensity_; }
|
||||||
|
|
||||||
|
//! glow bias
|
||||||
|
static qreal glowBias( void )
|
||||||
|
{ return 0.2; }
|
||||||
|
|
||||||
|
//! 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(); }
|
||||||
|
|
||||||
//@}
|
//@}
|
||||||
|
|
||||||
//! helper class
|
//! helper class
|
||||||
|
|
Loading…
Reference in a new issue