diff options
Diffstat (limited to 'modules/bar/popouts')
| -rw-r--r-- | modules/bar/popouts/Audio.qml | 57 | ||||
| -rw-r--r-- | modules/bar/popouts/Content.qml | 7 |
2 files changed, 64 insertions, 0 deletions
diff --git a/modules/bar/popouts/Audio.qml b/modules/bar/popouts/Audio.qml new file mode 100644 index 0000000..28667ec --- /dev/null +++ b/modules/bar/popouts/Audio.qml @@ -0,0 +1,57 @@ +import qs.widgets +import qs.services +import qs.config +import QtQuick.Layouts +import Quickshell + +ColumnLayout { + id: root + + required property var wrapper + + spacing: Appearance.spacing.normal + + VerticalSlider { + id: volumeSlider + + icon: { + if (Audio.muted) + return "no_sound"; + if (value >= 0.5) + return "volume_up"; + if (value > 0) + return "volume_down"; + return "volume_mute"; + } + + value: Audio.volume + onMoved: Audio.setVolume(value) + + implicitWidth: Config.osd.sizes.sliderWidth + implicitHeight: Config.osd.sizes.sliderHeight + } + + StyledRect { + id: pavuButton + + implicitWidth: implicitHeight + implicitHeight: icon.implicitHeight + Appearance.padding.small * 2 + + radius: Appearance.rounding.normal + color: Colours.palette.m3surfaceContainer + + StateLayer { + function onClicked(): void { + root.wrapper.hasCurrent = false; + Quickshell.execDetached(["pavucontrol"]); + } + } + + MaterialIcon { + id: icon + + anchors.centerIn: parent + text: "settings" + } + } +} diff --git a/modules/bar/popouts/Content.qml b/modules/bar/popouts/Content.qml index 42e138d..5b396a9 100644 --- a/modules/bar/popouts/Content.qml +++ b/modules/bar/popouts/Content.qml @@ -45,6 +45,13 @@ Item { source: "Battery.qml" } + Popout { + name: "audio" + sourceComponent: Audio { + wrapper: root.wrapper + } + } + Repeater { model: ScriptModel { values: [...SystemTray.items.values] |