shift-shell/components/mobileshellstate/shelldbusobject.h
Micah Stanley 013d034516 Gesture Navigation: Disable Gestures When Action Drawer, Notification Popup Drawer, or VolumeOSD are Visible
Disables gesture navigation when Action Drawer, Notification Popup Drawer, or VolumeOSD are visible as activating the task switcher in these situation can feel a bit weird.

Note:
~~Draft for in till I can get side loading working again so I can test it on device.~~

Still can't seem to get side loading working quite yet. Though, I did run the test I could from my laptop and it does seems to be working fine, so I will be removing this from draft.
2025-03-19 01:21:46 +00:00

86 lines
2.7 KiB
C++

// SPDX-FileCopyrightText: 2023 Devin Lin <devin@kde.org>
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#include <QObject>
#include <QString>
#include <qqmlregistration.h>
#include "startupfeedbackmodel.h"
class ShellDBusObject : public QObject
{
Q_OBJECT
QML_ELEMENT
QML_SINGLETON
Q_CLASSINFO("D-Bus Interface", "org.kde.plasmashell")
Q_PROPERTY(StartupFeedbackModel *startupFeedbackModel READ startupFeedbackModel CONSTANT)
public:
ShellDBusObject(QObject *parent = nullptr);
// called by QML
Q_INVOKABLE void registerObject();
StartupFeedbackModel *startupFeedbackModel();
Q_SIGNALS:
Q_SCRIPTABLE void doNotDisturbChanged();
Q_SCRIPTABLE void isActionDrawerOpenChanged();
Q_SCRIPTABLE void isVolumeOSDOpenChanged();
Q_SCRIPTABLE void isNotificationPopupDrawerOpenChanged();
Q_SCRIPTABLE void panelStateChanged();
Q_SCRIPTABLE void isTaskSwitcherVisibleChanged();
Q_SCRIPTABLE void openActionDrawerRequested();
Q_SCRIPTABLE void closeActionDrawerRequested();
Q_SCRIPTABLE void appLaunchMaximizePanelAnimationTriggered(int screen, QString color);
Q_SCRIPTABLE void openHomeScreenRequested();
Q_SCRIPTABLE void resetHomeScreenPositionRequested();
Q_SCRIPTABLE void showVolumeOSDRequested();
public Q_SLOTS:
Q_SCRIPTABLE bool doNotDisturb();
Q_SCRIPTABLE void setDoNotDisturb(bool value);
// TODO: Account for multiple action drawers?
Q_SCRIPTABLE bool isActionDrawerOpen();
Q_SCRIPTABLE void setIsActionDrawerOpen(bool value);
Q_SCRIPTABLE bool isVolumeOSDOpen();
Q_SCRIPTABLE void setIsVolumeOSDOpen(bool value);
Q_SCRIPTABLE bool isNotificationPopupDrawerOpen();
Q_SCRIPTABLE void setIsNotificationPopupDrawerOpen(bool value);
Q_SCRIPTABLE QString panelState();
Q_SCRIPTABLE void setPanelState(QString state);
Q_SCRIPTABLE bool isTaskSwitcherVisible();
Q_SCRIPTABLE void setIsTaskSwitcherVisible(bool value);
Q_SCRIPTABLE void openActionDrawer();
Q_SCRIPTABLE void closeActionDrawer();
Q_SCRIPTABLE void
openAppLaunchAnimationWithPosition(int screen, QString splashIcon, QString title, QString storageId, qreal x, qreal y, qreal sourceIconSize);
Q_SCRIPTABLE void triggerAppLaunchMaximizePanelAnimation(int screen, QString color);
Q_SCRIPTABLE void openHomeScreen();
Q_SCRIPTABLE void resetHomeScreenPosition();
Q_SCRIPTABLE void showVolumeOSD();
private:
bool m_initialized{false};
bool m_doNotDisturb{false};
bool m_isActionDrawerOpen{false};
bool m_isVolumeOSDOpen{false};
bool m_isNotificationPopupDrawerOpen{false};
bool m_isTaskSwitcherVisible{false};
QString m_panelState{};
StartupFeedbackModel *m_startupFeedbackModel{nullptr};
};