effects/{desktopgrid,overview,windowview}: Port to SceneView
This commit is contained in:
parent
0c0fb99919
commit
4bf06466f1
9 changed files with 21 additions and 45 deletions
|
@ -85,14 +85,6 @@ DesktopGridEffect::~DesktopGridEffect()
|
|||
{
|
||||
}
|
||||
|
||||
QVariantMap DesktopGridEffect::initialProperties(EffectScreen *screen)
|
||||
{
|
||||
return QVariantMap{
|
||||
{QStringLiteral("effect"), QVariant::fromValue(this)},
|
||||
{QStringLiteral("targetScreen"), QVariant::fromValue(screen)},
|
||||
};
|
||||
}
|
||||
|
||||
void DesktopGridEffect::reconfigure(ReconfigureFlags)
|
||||
{
|
||||
DesktopGridConfig::self()->read();
|
||||
|
|
|
@ -82,9 +82,6 @@ public Q_SLOTS:
|
|||
void deactivate(int timeout);
|
||||
void toggle();
|
||||
|
||||
protected:
|
||||
QVariantMap initialProperties(EffectScreen *screen) override;
|
||||
|
||||
Q_SIGNALS:
|
||||
void gridRowsChanged();
|
||||
void gridColumnsChanged();
|
||||
|
|
|
@ -18,8 +18,8 @@ import org.kde.plasma.components 3.0 as PC3
|
|||
Rectangle {
|
||||
id: container
|
||||
|
||||
required property QtObject effect
|
||||
required property QtObject targetScreen
|
||||
readonly property QtObject effect: KWinComponents.SceneView.effect
|
||||
readonly property QtObject targetScreen: KWinComponents.SceneView.screen
|
||||
|
||||
property bool animationEnabled: false
|
||||
property bool organized: false
|
||||
|
|
|
@ -80,14 +80,6 @@ OverviewEffect::~OverviewEffect()
|
|||
{
|
||||
}
|
||||
|
||||
QVariantMap OverviewEffect::initialProperties(EffectScreen *screen)
|
||||
{
|
||||
return QVariantMap{
|
||||
{QStringLiteral("effect"), QVariant::fromValue(this)},
|
||||
{QStringLiteral("targetScreen"), QVariant::fromValue(screen)},
|
||||
};
|
||||
}
|
||||
|
||||
void OverviewEffect::reconfigure(ReconfigureFlags)
|
||||
{
|
||||
OverviewConfig::self()->read();
|
||||
|
|
|
@ -69,9 +69,6 @@ public Q_SLOTS:
|
|||
void quickDeactivate();
|
||||
void toggle();
|
||||
|
||||
protected:
|
||||
QVariantMap initialProperties(EffectScreen *screen) override;
|
||||
|
||||
private:
|
||||
void realDeactivate();
|
||||
|
||||
|
|
|
@ -19,8 +19,8 @@ FocusScope {
|
|||
id: container
|
||||
focus: true
|
||||
|
||||
required property QtObject effect
|
||||
required property QtObject targetScreen
|
||||
readonly property QtObject effect: KWinComponents.SceneView.effect
|
||||
readonly property QtObject targetScreen: KWinComponents.SceneView.screen
|
||||
|
||||
readonly property bool lightBackground: Math.max(PlasmaCore.ColorScope.backgroundColor.r,
|
||||
PlasmaCore.ColorScope.backgroundColor.g,
|
||||
|
|
|
@ -17,9 +17,8 @@ import org.kde.KWin.Effect.WindowView 1.0
|
|||
Item {
|
||||
id: container
|
||||
|
||||
required property QtObject effect
|
||||
required property QtObject targetScreen
|
||||
required property var selectedIds
|
||||
readonly property QtObject effect: KWinComponents.SceneView.effect
|
||||
readonly property QtObject targetScreen: KWinComponents.SceneView.screen
|
||||
|
||||
property bool animationEnabled: false
|
||||
property bool organized: false
|
||||
|
@ -176,7 +175,7 @@ Item {
|
|||
case WindowView.ModeWindowClassCurrentDesktop:
|
||||
return "activeClass";
|
||||
default:
|
||||
return selectedIds;
|
||||
return container.effect.selectedIds;
|
||||
}
|
||||
}
|
||||
layout.mode: effect.layout
|
||||
|
|
|
@ -137,15 +137,6 @@ WindowViewEffect::~WindowViewEffect()
|
|||
QDBusConnection::sessionBus().unregisterObject(s_dbusObjectPath);
|
||||
}
|
||||
|
||||
QVariantMap WindowViewEffect::initialProperties(EffectScreen *screen)
|
||||
{
|
||||
return QVariantMap{
|
||||
{QStringLiteral("effect"), QVariant::fromValue(this)},
|
||||
{QStringLiteral("targetScreen"), QVariant::fromValue(screen)},
|
||||
{QStringLiteral("selectedIds"), QVariant::fromValue(m_windowIds)},
|
||||
};
|
||||
}
|
||||
|
||||
int WindowViewEffect::animationDuration() const
|
||||
{
|
||||
return m_animationDuration;
|
||||
|
@ -333,7 +324,7 @@ void WindowViewEffect::activate(const QStringList &windowIds)
|
|||
}
|
||||
}
|
||||
if (!internalIds.isEmpty()) {
|
||||
m_windowIds = internalIds;
|
||||
setSelectedIds(internalIds);
|
||||
m_searchText = QString();
|
||||
setRunning(true);
|
||||
}
|
||||
|
@ -346,7 +337,7 @@ void WindowViewEffect::activate()
|
|||
}
|
||||
|
||||
m_status = Status::Active;
|
||||
m_windowIds.clear();
|
||||
setSelectedIds(QList<QUuid>());
|
||||
|
||||
setGestureInProgress(false);
|
||||
setPartialActivationFactor(0);
|
||||
|
@ -417,7 +408,7 @@ void WindowViewEffect::setMode(WindowViewEffect::PresentWindowsMode mode)
|
|||
}
|
||||
|
||||
if (mode != ModeWindowGroup) {
|
||||
m_windowIds.clear();
|
||||
setSelectedIds(QList<QUuid>());
|
||||
}
|
||||
|
||||
m_mode = mode;
|
||||
|
@ -464,4 +455,12 @@ bool WindowViewEffect::borderActivated(ElectricBorder border)
|
|||
return true;
|
||||
}
|
||||
|
||||
void WindowViewEffect::setSelectedIds(const QList<QUuid> &ids)
|
||||
{
|
||||
if (m_windowIds != ids) {
|
||||
m_windowIds = ids;
|
||||
Q_EMIT selectedIdsChanged();
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace KWin
|
||||
|
|
|
@ -25,6 +25,7 @@ class WindowViewEffect : public QuickSceneEffect
|
|||
Q_PROPERTY(qreal partialActivationFactor READ partialActivationFactor NOTIFY partialActivationFactorChanged)
|
||||
Q_PROPERTY(bool gestureInProgress READ gestureInProgress NOTIFY gestureInProgressChanged)
|
||||
Q_PROPERTY(QString searchText MEMBER m_searchText NOTIFY searchTextChanged)
|
||||
Q_PROPERTY(QList<QUuid> selectedIds MEMBER m_windowIds NOTIFY selectedIdsChanged)
|
||||
|
||||
public:
|
||||
enum PresentWindowsMode {
|
||||
|
@ -87,12 +88,11 @@ Q_SIGNALS:
|
|||
void layoutChanged();
|
||||
void ignoreMinimizedChanged();
|
||||
void searchTextChanged();
|
||||
|
||||
protected:
|
||||
QVariantMap initialProperties(EffectScreen *screen) override;
|
||||
void selectedIdsChanged();
|
||||
|
||||
private:
|
||||
void realDeactivate();
|
||||
void setSelectedIds(const QList<QUuid> &ids);
|
||||
|
||||
QTimer *m_shutdownTimer;
|
||||
QList<QUuid> m_windowIds;
|
||||
|
|
Loading…
Reference in a new issue