summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichail Vourlakos <[email protected]>2018-11-01 21:06:37 +0200
committerMichail Vourlakos <[email protected]>2018-11-01 21:35:45 +0200
commit19348e1ccb32fae42e991aadf658dfb5a31a1a7a (patch)
treeaef7c2e0cd760d59e79fb96cd1e735cab1538b68
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: https://phabricator.kde.org/D16596
-rw-r--r--kdecoration/breezebutton.cpp13
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(args.at(0).value<DecorationButtonType>(), args.at(1).value<Decoration*>(), parent)
- , m_flag(FlagStandalone)
- , m_animation( new QPropertyAnimation( this ) )
- {}
-
+ : Button(args.at(0).value<DecorationButtonType>(), args.at(1).value<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)
{