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/423 We currently listen to when the volume changes, which wouldn't happen if the user reaches 0% or 100% and continues trying to press the volume button. Instead, listen to OSD events for determining when to open the popup.
43 lines
1.1 KiB
QML
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
|
|
|
|
property var osdListener: Connections {
|
|
target: MobileShellState.VolumeOSDListener
|
|
|
|
function onShowOSD(icon, volume, maxVolume) {
|
|
if (!osd.visible) {
|
|
vcp.showOverlay();
|
|
}
|
|
}
|
|
}
|
|
|
|
property var apiListener: Connections {
|
|
target: MobileShellState.ShellDBusClient
|
|
|
|
function onShowVolumeOSDRequested() {
|
|
osd.showOverlay();
|
|
vcp.close();
|
|
}
|
|
}
|
|
|
|
property var osd: VolumeOSD {}
|
|
property var vcp: VolumeChangedPopup {}
|
|
}
|