mirror of
https://github.com/kossLAN/dots.git
synced 2025-11-05 06:59:50 -05:00
basic volume mixer
This commit is contained in:
parent
e33d3d574a
commit
65894a08c9
6 changed files with 97 additions and 91 deletions
|
|
@ -5,19 +5,20 @@ import QtQuick.Layouts
|
|||
import QtQuick.Controls
|
||||
import Quickshell.Widgets
|
||||
import Quickshell.Services.Pipewire
|
||||
import qs
|
||||
import qs.widgets
|
||||
import qs
|
||||
|
||||
Loader {
|
||||
id: root
|
||||
active: node !== null
|
||||
active: node != null
|
||||
|
||||
required property PwNode node
|
||||
property string label: node.nickname
|
||||
|
||||
sourceComponent: WrapperRectangle {
|
||||
id: comp
|
||||
color: ShellSettings.colors.surface_container_translucent
|
||||
radius: 12
|
||||
radius: 12
|
||||
margin: 6
|
||||
|
||||
border {
|
||||
|
|
@ -25,7 +26,6 @@ Loader {
|
|||
color: ShellSettings.colors.active_translucent
|
||||
}
|
||||
|
||||
// property string text
|
||||
// property Component button
|
||||
// property Component icon
|
||||
|
||||
|
|
@ -35,23 +35,48 @@ Loader {
|
|||
}
|
||||
|
||||
RowLayout {
|
||||
Slider {
|
||||
value: root.node.audio.volume ?? 0
|
||||
// text: root.text
|
||||
// icon: root.icon
|
||||
|
||||
onValueChanged: {
|
||||
// only allow changes when the node is ready other wise you will combust
|
||||
if (!root.node.ready)
|
||||
return;
|
||||
|
||||
root.node.audio.volume = value;
|
||||
}
|
||||
|
||||
ColumnLayout {
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
|
||||
Text {
|
||||
text: root.label
|
||||
color: ShellSettings.colors.active
|
||||
elide: Text.ElideRight
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
}
|
||||
|
||||
StyledSlider {
|
||||
value: root.node.audio.volume ?? 0
|
||||
// text: root.text
|
||||
// icon: root.icon
|
||||
|
||||
onValueChanged: {
|
||||
// only allow changes when the node is ready other wise you will combust
|
||||
if (!root.node.ready)
|
||||
return;
|
||||
|
||||
root.node.audio.volume = value;
|
||||
}
|
||||
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
}
|
||||
}
|
||||
|
||||
// StyledMouseArea {
|
||||
// id: rightArrow
|
||||
// Layout.preferredWidth: rightArrow.height
|
||||
// // Layout.fillWidth: true
|
||||
// Layout.fillHeight: true
|
||||
//
|
||||
// IconImage {
|
||||
// source: "root:resources/general/right-arrow.svg"
|
||||
// anchors.fill: parent
|
||||
// }
|
||||
// }
|
||||
|
||||
// Loader {
|
||||
// id: buttonLoader
|
||||
// sourceComponent: root.button
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import Quickshell.Widgets
|
|||
import Quickshell.Services.Pipewire
|
||||
import qs.widgets
|
||||
import qs.bar
|
||||
import qs
|
||||
|
||||
StyledMouseArea {
|
||||
id: root
|
||||
|
|
@ -34,31 +35,66 @@ StyledMouseArea {
|
|||
implicitWidth: 300
|
||||
implicitHeight: container.implicitHeight + (2 * 8)
|
||||
|
||||
// implicitWidth: volumeMenu.implicitWidth
|
||||
// implicitHeight: volumeMenu.implicitHeight
|
||||
|
||||
// VolumeControl {
|
||||
// id: volumeMenu
|
||||
// }
|
||||
property PwNode sink: Pipewire.defaultAudioSink
|
||||
property real entryHeight: 45
|
||||
|
||||
ColumnLayout {
|
||||
id: container
|
||||
spacing: 4
|
||||
|
||||
anchors {
|
||||
fill: parent
|
||||
margins: 8
|
||||
}
|
||||
|
||||
// Default Audio
|
||||
VolumeCard {
|
||||
node: Pipewire.defaultAudioSink
|
||||
node: menu.sink
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: 45
|
||||
Layout.preferredHeight: menu.entryHeight
|
||||
}
|
||||
|
||||
VolumeCard {
|
||||
node: Pipewire.defaultAudioSource
|
||||
Rectangle {
|
||||
color: ShellSettings.colors.active_translucent
|
||||
radius: height / 2
|
||||
Layout.leftMargin: 3
|
||||
Layout.rightMargin: 3
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: 45
|
||||
Layout.preferredHeight: 2
|
||||
}
|
||||
|
||||
// Application Mixer
|
||||
Loader {
|
||||
id: sinkLoader
|
||||
active: menu.sink
|
||||
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: 5 * menu.entryHeight
|
||||
|
||||
PwNodeLinkTracker {
|
||||
id: linkTracker
|
||||
node: menu.sink
|
||||
}
|
||||
|
||||
sourceComponent: ListView {
|
||||
anchors.fill: parent
|
||||
spacing: 6
|
||||
model: linkTracker.linkGroups
|
||||
|
||||
delegate: Loader {
|
||||
id: nodeLoader
|
||||
active: modelData.source != null
|
||||
width: ListView.view.width
|
||||
height: menu.entryHeight
|
||||
|
||||
required property PwLinkGroup modelData
|
||||
|
||||
sourceComponent: VolumeCard {
|
||||
node: nodeLoader.modelData.source
|
||||
label: node.properties["media.name"] ?? ""
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue