mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-06-11 16:57:43 +00:00
Track KWin Overview through the activeEffects DBus property and expose the state to Folio QML. Hide the workspace frame, dock overlay, and in-containment favourites scrim while Overview is active so the effect does not show Shift shell chrome in its desktop view. Set the state before invoking the Overview shortcut from Folio so the chrome is already gone when KWin starts composing the effect. The convergence dock invariant now guards both the hide rules and this ordering.
91 lines
3.2 KiB
C++
91 lines
3.2 KiB
C++
// SPDX-FileCopyrightText: 2015 Marco Martin <mart@kde.org>
|
|
// SPDX-FileCopyrightText: 2022 Devin Lin <devin@kde.org>
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
#pragma once
|
|
|
|
#include <Plasma/Containment>
|
|
#include <QSortFilterProxyModel>
|
|
#include <QVariant>
|
|
|
|
#include "applicationlistmodel.h"
|
|
#include "delegatetoucharea.h"
|
|
#include "favouritesmodel.h"
|
|
#include "folioapplication.h"
|
|
#include "folioapplicationfolder.h"
|
|
#include "foliodelegate.h"
|
|
#include "foliosettings.h"
|
|
#include "foliowidget.h"
|
|
#include "homescreenstate.h"
|
|
#include "pagelistmodel.h"
|
|
#include "pagemodel.h"
|
|
#include "widgetcontainer.h"
|
|
#include "widgetsmanager.h"
|
|
|
|
class FolioSettings;
|
|
class PageListModel;
|
|
class WidgetsManager;
|
|
class HomeScreenState;
|
|
class FavouritesModel;
|
|
class ApplicationListModel;
|
|
class ApplicationListSearchModel;
|
|
|
|
class HomeScreen : public Plasma::Containment
|
|
{
|
|
Q_OBJECT
|
|
QML_ELEMENT
|
|
QML_UNCREATABLE("HomeScreen is provided by the folio containment")
|
|
|
|
Q_PROPERTY(FolioSettings *FolioSettings READ folioSettings CONSTANT)
|
|
Q_PROPERTY(HomeScreenState *HomeScreenState READ homeScreenState CONSTANT)
|
|
Q_PROPERTY(WidgetsManager *WidgetsManager READ widgetsManager CONSTANT)
|
|
Q_PROPERTY(ApplicationListModel *ApplicationListModel READ applicationListModel CONSTANT)
|
|
Q_PROPERTY(ApplicationListSearchModel *ApplicationListSearchModel READ applicationListSearchModel CONSTANT)
|
|
Q_PROPERTY(FavouritesModel *FavouritesModel READ favouritesModel CONSTANT)
|
|
Q_PROPERTY(PageListModel *PageListModel READ pageListModel CONSTANT)
|
|
Q_PROPERTY(bool overviewActive READ overviewActive NOTIFY overviewActiveChanged)
|
|
|
|
public:
|
|
HomeScreen(QObject *parent, const KPluginMetaData &data, const QVariantList &args);
|
|
~HomeScreen() override;
|
|
|
|
void configChanged() override;
|
|
|
|
Q_INVOKABLE void triggerOverview();
|
|
Q_INVOKABLE void triggerMinimizeAll() const;
|
|
Q_INVOKABLE void activateVirtualDesktop(const QVariant &desktop) const;
|
|
Q_INVOKABLE void createVirtualDesktop() const;
|
|
Q_INVOKABLE void removeLastVirtualDesktop() const;
|
|
Q_INVOKABLE void emptyTrash() const;
|
|
|
|
FolioSettings *folioSettings();
|
|
HomeScreenState *homeScreenState();
|
|
WidgetsManager *widgetsManager();
|
|
ApplicationListModel *applicationListModel();
|
|
ApplicationListSearchModel *applicationListSearchModel();
|
|
FavouritesModel *favouritesModel();
|
|
PageListModel *pageListModel();
|
|
bool overviewActive() const;
|
|
|
|
Q_SIGNALS:
|
|
void overviewActiveChanged();
|
|
void showingDesktopChanged(bool showingDesktop);
|
|
|
|
private Q_SLOTS:
|
|
void onOverviewEffectsChanged(const QString &interface, const QVariantMap &changed, const QStringList &invalidated);
|
|
void onAppletAdded(Plasma::Applet *applet, const QRectF &geometryHint);
|
|
void onAppletAboutToBeRemoved(Plasma::Applet *applet);
|
|
|
|
private:
|
|
void setOverviewActive(bool overviewActive);
|
|
void updateOverviewActive();
|
|
|
|
FolioSettings *m_folioSettings{nullptr};
|
|
HomeScreenState *m_homeScreenState{nullptr};
|
|
WidgetsManager *m_widgetsManager{nullptr};
|
|
ApplicationListModel *m_applicationListModel{nullptr};
|
|
ApplicationListSearchModel *m_applicationListSearchModel{nullptr};
|
|
FavouritesModel *m_favouritesModel{nullptr};
|
|
PageListModel *m_pageListModel{nullptr};
|
|
bool m_overviewActive{false};
|
|
};
|