shift-shell/components/mobileshell/qml/statusbar/indicators/VolumeIndicator.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

27 lines
770 B
QML

/*
SPDX-FileCopyrightText: 2021 Devin Lin <eespidev@gmail.com>
SPDX-FileCopyrightText: 2019 Aditya Mehra <Aix.m@outlook.com>
SPDX-FileCopyrightText: 2014-2015 Harald Sitter <sitter@kde.org>
SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
*/
import QtQuick 2.2
import QtQuick.Layouts 1.4
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.private.volume 0.1
import org.kde.plasma.private.mobileshell 1.0 as MobileShell
PlasmaCore.IconItem {
id: paIcon
readonly property var provider: MobileShell.AudioInfo {}
Layout.fillHeight: true
Layout.preferredWidth: height
source: provider.icon
colorGroup: PlasmaCore.ColorScope.colorGroup
visible: provider.isVisible
}