diff options
| author | Timotej Lazar <timotej.lazar@araneo.si> | 2021-06-14 19:09:53 +0200 |
|---|---|---|
| committer | Timotej Lazar <timotej.lazar@araneo.si> | 2021-06-14 19:13:14 +0200 |
| commit | 8d57bfb1aef3b71557bc408154ee028751fd688e (patch) | |
| tree | 22ee6eaa22a3cfc7dfd4f938be16a6e28d7eaf1f /Volume.qml | |
First commit
There was history before but now there is no more.
Diffstat (limited to 'Volume.qml')
| -rw-r--r-- | Volume.qml | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/Volume.qml b/Volume.qml new file mode 100644 index 0000000..cbf41e9 --- /dev/null +++ b/Volume.qml @@ -0,0 +1,30 @@ +// SPDX-License-Identifier: Unlicense + +import QtQuick.Controls 2.13 + +Button { + property bool muted + property alias value: volume.value + + implicitWidth: implicitHeight + icon.name: 'audio-volume-' + + (muted ? 'muted' : + (value < 0.33 ? 'low' : + (value < 0.66 ? 'medium' : 'high'))) + + checkable: true + checked: popup.opened + + onClicked: popup.opened ? popup.close() : popup.open() + Popup { + id: popup + y: -height + height: 100 + closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutsideParent + Slider { + id: volume + anchors.fill: parent + orientation: Qt.Vertical + } + } +} |
