shift-shell/components/mobileshellstate/qml/Shell.qml
Devin Lin 158af43fd4 audio: Refactor applet and extract singleton to MobileShellState
The eventual goal is to have as few singletons with state as possible in the mobileshell component when it is imported into components such as the lockscreen.

This doesn't fully accomplish it, but moves the audio provider singleton to MobileShellState, which will eventually need to be prevented from importing into non plasmashell processes.

This also disables the sound feedback when changing volume, since it can be a source of lag when showing the applet.
2023-03-16 07:21:01 +00:00

47 lines
1.2 KiB
QML

// SPDX-FileCopyrightText: 2022 Devin Lin <devin@kde.org>
// SPDX-License-Identifier: GPL-2.0-or-later
import QtQuick 2.15
import QtQuick.Window 2.15
pragma Singleton
/**
* Provides access to common functions within the shell. Only available within the plasmashell process.
*/
QtObject {
id: delegate
/**
* Whether the action drawer is currently open.
*/
readonly property bool actionDrawerVisible: TopPanelControls.actionDrawerVisible
/**
* Open the app launch screen with animation parameters.
*/
function openAppLaunchAnimation(splashIcon: string, title: string, x: real, y: real, sourceIconSize: real) {
HomeScreenControls.openAppLaunchAnimation(splashIcon, title, x, y, sourceIconSize);
}
/**
* Close the app launch screen.
*/
function closeAppLaunchAnimation() {
HomeScreenControls.closeAppLaunchAnimation();
}
/**
* Open the action drawer.
*/
function openActionDrawer() {
TopPanelControls.openActionDrawer();
}
/**
* Close the action drawer, if it is open.
*/
function closeActionDrawer() {
TopPanelControls.closeActionDrawer();
}
}