diff options
authorMichail Vourlakos <[email protected]>2018-11-01 21:06:37 +0200
committerMichail Vourlakos <[email protected]>2018-11-01 21:35:45 +0200
commit19348e1ccb32fae42e991aadf658dfb5a31a1a7a (patch)
parent663ef0c694b390fa6dd09f79b1fd7214af1b0afd (diff)
enable animations for standalone created buttons
Summary: --as mentioned at T9899 we are not calling the correct creator when buttons are created in Standalone mode and as such animations are disabled when BreezeButton is created from plasma applets. This patch fixes this and restores the Standalone behavior mode in order to be identical with the default one. Test Plan: -check that window title bars still work -check that breeze window buttons in titlebar editor buttons still work -check that when buttons are used in a plasma applet they are animated Reviewers: #breeze, zzag Reviewed By: zzag Subscribers: plasma-devel Tags: #plasma Differential Revision:
1 files changed, 8 insertions, 5 deletions
diff --git a/kdecoration/breezebutton.cpp b/kdecoration/breezebutton.cpp
index 09cd4b0..ff64dbd 100644
--- a/kdecoration/breezebutton.cpp
+++ b/kdecoration/breezebutton.cpp
@@ -62,11 +62,14 @@ namespace Breeze
Button::Button(QObject *parent, const QVariantList &args)
- : DecorationButton(<DecorationButtonType>(),<Decoration*>(), parent)
- , m_flag(FlagStandalone)
- , m_animation( new QPropertyAnimation( this ) )
- {}
+ : Button(<DecorationButtonType>(),<Decoration*>(), parent)
+ {
+ m_flag = FlagStandalone;
+ //! icon size must return to !valid because it was altered from the default constructor,
+ //! in Standalone mode the button is not using the decoration metrics but its geometry
+ m_iconSize = QSize(-1, -1);
+ }
Button *Button::create(DecorationButtonType type, KDecoration2::Decoration *decoration, QObject *parent)