From 47857bb9f3984c25f9d0c53537cefec500f6649a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Wed, 9 Oct 2013 09:52:30 +0200 Subject: [PATCH] [oxygen] Use new update mechanism of KDecoration in the Button This allows to have the button animations working in the preview. Needs to change the reference to Client to non-const. --- clients/oxygen/oxygenbutton.cpp | 3 ++- clients/oxygen/oxygenbutton.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/clients/oxygen/oxygenbutton.cpp b/clients/oxygen/oxygenbutton.cpp index ed08f707f5..d99c62541f 100644 --- a/clients/oxygen/oxygenbutton.cpp +++ b/clients/oxygen/oxygenbutton.cpp @@ -325,7 +325,8 @@ namespace Oxygen void Button::parentUpdate( void ) { - if( _client.compositingActive() && parentWidget() ) parentWidget()->update( geometry().adjusted( -1, -1, 1, 1 ) ); + if( _client.compositingActive() || _client.isPreview() ) _client.update( geometry().adjusted( -1, -1, 1, 1 ) ); + else if( parentWidget() ) parentWidget()->update( geometry().adjusted( -1, -1, 1, 1 ) ); else this->update(); } diff --git a/clients/oxygen/oxygenbutton.h b/clients/oxygen/oxygenbutton.h index 1302f52a61..a47ba934b3 100644 --- a/clients/oxygen/oxygenbutton.h +++ b/clients/oxygen/oxygenbutton.h @@ -174,7 +174,7 @@ namespace Oxygen private: //! parent client - const Client &_client; + Client &_client; //! helper DecoHelper &_helper;