From 331f9b6cebca4207392fb24476622f1bf40627b2 Mon Sep 17 00:00:00 2001 From: Hugo Pereira Da Costa Date: Fri, 24 Apr 2015 10:29:54 +0200 Subject: [PATCH] properly update button's animation duration on reconfiguration --- kdecoration/breezebutton.cpp | 13 +++++++++++++ kdecoration/breezebutton.h | 3 +++ 2 files changed, 16 insertions(+) diff --git a/kdecoration/breezebutton.cpp b/kdecoration/breezebutton.cpp index 7a0ffa49..def0b1e0 100644 --- a/kdecoration/breezebutton.cpp +++ b/kdecoration/breezebutton.cpp @@ -47,8 +47,11 @@ namespace Breeze // connections 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 ); + reconfigure(); + } //__________________________________________________________________ @@ -434,6 +437,16 @@ namespace Breeze } + //________________________________________________________________ + void Button::reconfigure() + { + + // animation + auto d = qobject_cast(decoration()); + if( d ) m_animation->setDuration( d->internalSettings()->animationsDuration() ); + + } + //__________________________________________________________________ void Button::updateAnimationState( bool hovered ) { diff --git a/kdecoration/breezebutton.h b/kdecoration/breezebutton.h index 3787e2b4..c3b0b61c 100644 --- a/kdecoration/breezebutton.h +++ b/kdecoration/breezebutton.h @@ -96,6 +96,9 @@ namespace Breeze private Q_SLOTS: + //* apply configuration changes + void reconfigure(); + //* animation state void updateAnimationState(bool);