mirror of
https://bitbucket.org/smil3y/kde-workspace.git
synced 2025-02-24 02:42:50 +00:00
plasma: parent the animations to the widget they belong to in launcher applet
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
554f6c0b37
commit
e44a3283c2
1 changed files with 4 additions and 27 deletions
|
@ -162,7 +162,6 @@ class LauncherWidget : public QGraphicsWidget
|
|||
Q_OBJECT
|
||||
public:
|
||||
LauncherWidget(QGraphicsWidget *parent);
|
||||
~LauncherWidget();
|
||||
|
||||
void setup(const QSizeF &iconsize, const QIcon &icon, const QString &text, const QString &subtext);
|
||||
void disableHover();
|
||||
|
@ -269,26 +268,6 @@ LauncherWidget::LauncherWidget(QGraphicsWidget *parent)
|
|||
);
|
||||
}
|
||||
|
||||
LauncherWidget::~LauncherWidget()
|
||||
{
|
||||
if (m_action1animation) {
|
||||
m_action1animation->stop();
|
||||
delete m_action1animation;
|
||||
}
|
||||
if (m_action2animation) {
|
||||
m_action2animation->stop();
|
||||
delete m_action2animation;
|
||||
}
|
||||
if (m_action3animation) {
|
||||
m_action3animation->stop();
|
||||
delete m_action3animation;
|
||||
}
|
||||
if (m_action4animation) {
|
||||
m_action4animation->stop();
|
||||
delete m_action4animation;
|
||||
}
|
||||
}
|
||||
|
||||
void LauncherWidget::setup(const QSizeF &iconsize, const QIcon &icon, const QString &text, const QString &subtext)
|
||||
{
|
||||
m_iconwidget->setMinimumIconSize(iconsize);
|
||||
|
@ -424,9 +403,8 @@ void LauncherWidget::animateFadeIn(Plasma::Animation *animation, Plasma::ToolBut
|
|||
}
|
||||
if (animation) {
|
||||
animation->stop();
|
||||
}
|
||||
if (!animation) {
|
||||
animation = Plasma::Animator::create(Plasma::Animator::FadeAnimation);
|
||||
} else {
|
||||
animation = Plasma::Animator::create(Plasma::Animator::FadeAnimation, this);
|
||||
Q_ASSERT(animation != nullptr);
|
||||
animation->setTargetWidget(toolbutton);
|
||||
}
|
||||
|
@ -442,9 +420,8 @@ void LauncherWidget::animateFadeOut(Plasma::Animation *animation, Plasma::ToolBu
|
|||
}
|
||||
if (animation) {
|
||||
animation->stop();
|
||||
}
|
||||
if (!animation) {
|
||||
animation = Plasma::Animator::create(Plasma::Animator::FadeAnimation);
|
||||
} else {
|
||||
animation = Plasma::Animator::create(Plasma::Animator::FadeAnimation, this);
|
||||
Q_ASSERT(animation != nullptr);
|
||||
animation->setTargetWidget(toolbutton);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue