[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.
|
|
|
|
|
|
|
|
Copyright (C) 2018 Vlad Zagorodniy <vladzzag@gmail.com>
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*********************************************************************/
|
|
|
|
|
|
|
|
#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();
|
|
|
|
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)
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|