properly update button's animation duration on reconfiguration

wilder-pre-rebase
Hugo Pereira Da Costa 11 years ago
parent c29e760a5e
commit 331f9b6ceb
  1. 13
      kdecoration/breezebutton.cpp
  2. 3
      kdecoration/breezebutton.h

@ -47,8 +47,11 @@ namespace Breeze
// connections // connections
connect(decoration->client().data(), SIGNAL(iconChanged(QIcon)), this, SLOT(update())); connect(decoration->client().data(), SIGNAL(iconChanged(QIcon)), this, SLOT(update()));
connect(decoration->settings().data(), &KDecoration2::DecorationSettings::reconfigured, this, &Button::reconfigure);
connect( this, &KDecoration2::DecorationButton::hoveredChanged, this, &Button::updateAnimationState ); connect( this, &KDecoration2::DecorationButton::hoveredChanged, this, &Button::updateAnimationState );
reconfigure();
} }
//__________________________________________________________________ //__________________________________________________________________
@ -434,6 +437,16 @@ namespace Breeze
} }
//________________________________________________________________
void Button::reconfigure()
{
// animation
auto d = qobject_cast<Decoration*>(decoration());
if( d ) m_animation->setDuration( d->internalSettings()->animationsDuration() );
}
//__________________________________________________________________ //__________________________________________________________________
void Button::updateAnimationState( bool hovered ) void Button::updateAnimationState( bool hovered )
{ {

@ -96,6 +96,9 @@ namespace Breeze
private Q_SLOTS: private Q_SLOTS:
//* apply configuration changes
void reconfigure();
//* animation state //* animation state
void updateAnimationState(bool); void updateAnimationState(bool);

Loading…
Cancel
Save