mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-26 14:23:09 +00:00
These changes make the navigation and status bar accessible from within fullscreen applications by allowing the user to tap on the top or tap or drag on the bottom of the screen. Also, since the top panel is now over top of all fullscreen applications, this moves the action drawer swipe area back into the status bar. 
126 lines
3 KiB
C++
126 lines
3 KiB
C++
// SPDX-FileCopyrightText: 2023 Devin Lin <devin@kde.org>
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
#include "shelldbusobject.h"
|
|
#include "mobileadaptor.h"
|
|
|
|
#include <QDBusConnection>
|
|
|
|
ShellDBusObject::ShellDBusObject(QObject *parent)
|
|
: QObject{parent}
|
|
, m_startupFeedbackModel{new StartupFeedbackModel{this}}
|
|
{
|
|
}
|
|
|
|
void ShellDBusObject::registerObject()
|
|
{
|
|
if (!m_initialized) {
|
|
new PlasmashellAdaptor{this};
|
|
QDBusConnection::sessionBus().registerObject(QStringLiteral("/Mobile"), this);
|
|
m_initialized = true;
|
|
}
|
|
}
|
|
|
|
StartupFeedbackModel *ShellDBusObject::startupFeedbackModel()
|
|
{
|
|
return m_startupFeedbackModel;
|
|
}
|
|
|
|
bool ShellDBusObject::doNotDisturb()
|
|
{
|
|
return m_doNotDisturb;
|
|
}
|
|
|
|
void ShellDBusObject::setDoNotDisturb(bool value)
|
|
{
|
|
if (value != m_doNotDisturb) {
|
|
m_doNotDisturb = value;
|
|
Q_EMIT doNotDisturbChanged();
|
|
}
|
|
}
|
|
|
|
QString ShellDBusObject::panelState()
|
|
{
|
|
return m_panelState;
|
|
}
|
|
|
|
void ShellDBusObject::setPanelState(QString state)
|
|
{
|
|
if (state != m_panelState) {
|
|
m_panelState = state;
|
|
Q_EMIT panelStateChanged();
|
|
}
|
|
}
|
|
|
|
|
|
bool ShellDBusObject::isActionDrawerOpen()
|
|
{
|
|
return m_isActionDrawerOpen;
|
|
}
|
|
|
|
void ShellDBusObject::setIsActionDrawerOpen(bool value)
|
|
{
|
|
if (value != m_isActionDrawerOpen) {
|
|
m_isActionDrawerOpen = value;
|
|
Q_EMIT isActionDrawerOpenChanged();
|
|
}
|
|
}
|
|
|
|
bool ShellDBusObject::isTaskSwitcherVisible()
|
|
{
|
|
return m_isTaskSwitcherVisible;
|
|
}
|
|
|
|
void ShellDBusObject::setIsTaskSwitcherVisible(bool value)
|
|
{
|
|
if (value != m_isTaskSwitcherVisible) {
|
|
m_isTaskSwitcherVisible = value;
|
|
Q_EMIT isTaskSwitcherVisibleChanged();
|
|
}
|
|
}
|
|
|
|
void ShellDBusObject::openActionDrawer()
|
|
{
|
|
Q_EMIT openActionDrawerRequested();
|
|
}
|
|
|
|
void ShellDBusObject::closeActionDrawer()
|
|
{
|
|
Q_EMIT closeActionDrawerRequested();
|
|
}
|
|
|
|
void ShellDBusObject::openAppLaunchAnimationWithPosition(int screen,
|
|
QString splashIcon,
|
|
QString title,
|
|
QString storageId,
|
|
qreal x,
|
|
qreal y,
|
|
qreal sourceIconSize)
|
|
{
|
|
if (!m_startupFeedbackModel) {
|
|
return;
|
|
}
|
|
|
|
StartupFeedback *feedback = new StartupFeedback{m_startupFeedbackModel, splashIcon, title, storageId, x, y, sourceIconSize, screen};
|
|
m_startupFeedbackModel->addApp(feedback);
|
|
}
|
|
|
|
void ShellDBusObject::triggerAppLaunchMaximizePanelAnimation(int screen, QString color)
|
|
{
|
|
Q_EMIT appLaunchMaximizePanelAnimationTriggered(screen, color);
|
|
}
|
|
|
|
void ShellDBusObject::openHomeScreen()
|
|
{
|
|
Q_EMIT openHomeScreenRequested();
|
|
}
|
|
|
|
void ShellDBusObject::resetHomeScreenPosition()
|
|
{
|
|
Q_EMIT resetHomeScreenPositionRequested();
|
|
}
|
|
|
|
void ShellDBusObject::showVolumeOSD()
|
|
{
|
|
Q_EMIT showVolumeOSDRequested();
|
|
}
|