shift-shell/components/mobileshell/qml/volumeosd/VolumeOSDProvider.qml
Micah Stanley 681d1683f5 VolumeOSD: Improve design, and prevent touch events from being taken from outside the osd
Fixes: https://invent.kde.org/plasma/plasma-mobile/-/issues/274

Any feedback on these changes would be much appreciated.

![Screenshot_20241024_093458-1](/uploads/7b4f89ace1a53c559737d1c05d591329/Screenshot_20241024_093458-1.png)
![Screenshot_20241023_070919](/uploads/c7b9a8de7c9bba2de01d734408e02b2b/Screenshot_20241023_070919.png)

Change Log:
- NanoShell FullScreenOverlay was changed to a LayerShellQt Window to keep it on the top layer and to prevent the popup from obsorbing all touch inputs.
- New animations were added to the volume popup.
- User can now change the volume by touching and dragging on the popup
- The mute button on the popup was fixed
- Mute buttons were added next to the volume sliders in the AudioApplet page
- Volume icons now dynamically update to the volume level
- Visual design adjustments
2024-10-25 15:52:49 +00:00

43 lines
1.1 KiB
QML

/*
SPDX-FileCopyrightText: 2021 Devin Lin <devin@kde.org>
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
import QtQuick.Layouts
import org.kde.plasma.private.volume 0.1 as VolumeLib
import org.kde.plasma.private.mobileshell.state as MobileShellState
import org.kde.plasma.private.mobileshell as MobileShell
/**
* This imports the volume OSD and also sets up keyboard/hardware button bindings.
*/
QtObject {
id: component
function showVolumeOverlay() {
if (!osd.visible) {
vcp.showOverlay();
}
}
Component.onCompleted: {
MobileShell.AudioInfo.volumeChanged.connect(showVolumeOverlay);
}
property var apiListener: Connections {
target: MobileShellState.ShellDBusClient
function onShowVolumeOSDRequested() {
osd.showOverlay();
vcp.close();
}
}
property var osd: VolumeOSD {}
property var vcp: VolumeChangedPopup {}
}