[kcmkwin/desktop] Add animation option back
Summary:
The "new" animation option no longer uses hard coded effects, which
means one could install a third party virtual desktop switching animation,
for example from store.kde.org, and it will be displayed in the KCM.
Test Plan: {F6503565}
Reviewers: #kwin, #vdg, ngraham, davidedmundson
Reviewed By: #kwin, #vdg, ngraham, davidedmundson
Subscribers: davidedmundson, hein, ngraham, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D17766
2018-12-22 23:12:51 +00:00
|
|
|
/********************************************************************
|
|
|
|
KWin - the KDE window manager
|
|
|
|
This file is part of the KDE project.
|
|
|
|
|
2020-08-02 22:10:35 +00:00
|
|
|
SPDX-FileCopyrightText: 2018 Vlad Zahorodnii <vlad.zahorodnii@kde.org>
|
[kcmkwin/desktop] Add animation option back
Summary:
The "new" animation option no longer uses hard coded effects, which
means one could install a third party virtual desktop switching animation,
for example from store.kde.org, and it will be displayed in the KCM.
Test Plan: {F6503565}
Reviewers: #kwin, #vdg, ngraham, davidedmundson
Reviewed By: #kwin, #vdg, ngraham, davidedmundson
Subscribers: davidedmundson, hein, ngraham, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D17766
2018-12-22 23:12:51 +00:00
|
|
|
|
2020-08-02 22:10:35 +00:00
|
|
|
SPDX-License-Identifier: GPL-2.0-or-later
|
[kcmkwin/desktop] Add animation option back
Summary:
The "new" animation option no longer uses hard coded effects, which
means one could install a third party virtual desktop switching animation,
for example from store.kde.org, and it will be displayed in the KCM.
Test Plan: {F6503565}
Reviewers: #kwin, #vdg, ngraham, davidedmundson
Reviewed By: #kwin, #vdg, ngraham, davidedmundson
Subscribers: davidedmundson, hein, ngraham, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D17766
2018-12-22 23:12:51 +00:00
|
|
|
*********************************************************************/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2019-02-03 20:04:09 +00:00
|
|
|
#include "effectsmodel.h"
|
[kcmkwin/desktop] Add animation option back
Summary:
The "new" animation option no longer uses hard coded effects, which
means one could install a third party virtual desktop switching animation,
for example from store.kde.org, and it will be displayed in the KCM.
Test Plan: {F6503565}
Reviewers: #kwin, #vdg, ngraham, davidedmundson
Reviewed By: #kwin, #vdg, ngraham, davidedmundson
Subscribers: davidedmundson, hein, ngraham, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D17766
2018-12-22 23:12:51 +00:00
|
|
|
|
|
|
|
namespace KWin
|
|
|
|
{
|
|
|
|
|
2019-02-03 20:04:09 +00:00
|
|
|
class AnimationsModel : public EffectsModel
|
[kcmkwin/desktop] Add animation option back
Summary:
The "new" animation option no longer uses hard coded effects, which
means one could install a third party virtual desktop switching animation,
for example from store.kde.org, and it will be displayed in the KCM.
Test Plan: {F6503565}
Reviewers: #kwin, #vdg, ngraham, davidedmundson
Reviewed By: #kwin, #vdg, ngraham, davidedmundson
Subscribers: davidedmundson, hein, ngraham, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D17766
2018-12-22 23:12:51 +00:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
Q_PROPERTY(bool enabled READ enabled WRITE setEnabled NOTIFY enabledChanged)
|
|
|
|
Q_PROPERTY(int currentIndex READ currentIndex WRITE setCurrentIndex NOTIFY currentIndexChanged)
|
|
|
|
Q_PROPERTY(bool currentConfigurable READ currentConfigurable NOTIFY currentConfigurableChanged)
|
|
|
|
|
|
|
|
public:
|
|
|
|
explicit AnimationsModel(QObject *parent = nullptr);
|
|
|
|
|
|
|
|
bool enabled() const;
|
|
|
|
void setEnabled(bool enabled);
|
|
|
|
|
|
|
|
int currentIndex() const;
|
|
|
|
void setCurrentIndex(int index);
|
|
|
|
|
|
|
|
bool currentConfigurable() const;
|
|
|
|
|
|
|
|
void load();
|
|
|
|
void save();
|
|
|
|
void defaults();
|
2019-12-11 10:14:02 +00:00
|
|
|
bool isDefaults() const;
|
[kcmkwin/desktop] Add animation option back
Summary:
The "new" animation option no longer uses hard coded effects, which
means one could install a third party virtual desktop switching animation,
for example from store.kde.org, and it will be displayed in the KCM.
Test Plan: {F6503565}
Reviewers: #kwin, #vdg, ngraham, davidedmundson
Reviewed By: #kwin, #vdg, ngraham, davidedmundson
Subscribers: davidedmundson, hein, ngraham, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D17766
2018-12-22 23:12:51 +00:00
|
|
|
bool needsSave() const;
|
|
|
|
|
|
|
|
Q_SIGNALS:
|
|
|
|
void enabledChanged();
|
|
|
|
void currentIndexChanged();
|
|
|
|
void currentConfigurableChanged();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
bool shouldStore(const EffectData &data) const override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
Status status(int row) const;
|
|
|
|
bool modelCurrentEnabled() const;
|
|
|
|
int modelCurrentIndex() const;
|
|
|
|
|
|
|
|
bool m_enabled = false;
|
|
|
|
int m_currentIndex = -1;
|
|
|
|
bool m_currentConfigurable = false;
|
|
|
|
|
|
|
|
Q_DISABLE_COPY(AnimationsModel)
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|