mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-26 14:23:09 +00:00
Fixes https://invent.kde.org/plasma/plasma-mobile/-/issues/422 This commit simplifies the AudioInfo data provider to fetch the volume directly, rather than relying on a series of complicated connections. It also does some cleanup of AudioInfo, removing unused functions.
26 lines
811 B
QML
26 lines
811 B
QML
// SPDX-FileCopyrightText: 2022 Devin Lin <devin@kde.org>
|
|
// SPDX-License-Identifier: LGPL-2.0-or-later
|
|
|
|
import QtQuick
|
|
|
|
import org.kde.plasma.private.mobileshell as MobileShell
|
|
import org.kde.plasma.private.mobileshell.state as MobileShellState
|
|
import org.kde.plasma.private.mobileshell.quicksettingsplugin as QS
|
|
|
|
QS.QuickSetting {
|
|
text: i18n("Sound")
|
|
icon: MobileShell.AudioInfo.icon
|
|
status: {
|
|
if (!MobileShell.AudioInfo.isVisible) {
|
|
return i18n("No audio devices");
|
|
}
|
|
return i18n("%1%", MobileShell.AudioInfo.volumeValue);
|
|
}
|
|
enabled: false
|
|
settingsCommand: "plasma-open-settings kcm_pulseaudio"
|
|
|
|
function toggle() {
|
|
MobileShellState.ShellDBusClient.closeActionDrawer();
|
|
MobileShellState.ShellDBusClient.showVolumeOSD();
|
|
}
|
|
}
|