quickshell: fix volume widget with PwObjectTracker binding
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
1e7427ec0d
commit
b3fdfda1ec
1 changed files with 15 additions and 11 deletions
|
|
@ -734,7 +734,12 @@ in
|
|||
width: volText.width
|
||||
height: 30
|
||||
|
||||
property var sink: Pipewire.defaultAudioSink
|
||||
property PwNode sink: Pipewire.defaultAudioSink
|
||||
|
||||
PwObjectTracker {
|
||||
objects: [volWidget.sink]
|
||||
}
|
||||
|
||||
property int vol: sink && sink.audio ? Math.round(sink.audio.volume * 100) : 0
|
||||
property bool muted: sink && sink.audio ? sink.audio.muted : false
|
||||
property string volIcon: muted ? "\u{f0581}"
|
||||
|
|
@ -1462,12 +1467,12 @@ in
|
|||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
height: 1
|
||||
color: Theme.base02
|
||||
visible: appStreamsRepeater.count > 0
|
||||
visible: appStreamsCol.childrenRect.height > 0
|
||||
}
|
||||
|
||||
// App streams header
|
||||
Text {
|
||||
visible: appStreamsRepeater.count > 0
|
||||
visible: appStreamsCol.childrenRect.height > 0
|
||||
text: "\u{f0641} Applications"
|
||||
color: Theme.base05
|
||||
font.family: "FiraMono Nerd Font"
|
||||
|
|
@ -1477,24 +1482,23 @@ in
|
|||
|
||||
// Per-app streams
|
||||
Column {
|
||||
id: appStreamsCol
|
||||
width: parent.width
|
||||
spacing: 6
|
||||
|
||||
Repeater {
|
||||
id: appStreamsRepeater
|
||||
model: {
|
||||
let streams = [];
|
||||
for (let i = 0; i < Pipewire.nodes.values.length; i++) {
|
||||
let node = Pipewire.nodes.values[i];
|
||||
if (node.isStream && node.audio) streams.push(node);
|
||||
}
|
||||
return streams;
|
||||
}
|
||||
model: Pipewire.nodes
|
||||
|
||||
Column {
|
||||
required property var modelData
|
||||
width: parent.width
|
||||
spacing: 2
|
||||
visible: modelData.isStream && modelData.audio !== null
|
||||
|
||||
PwObjectTracker {
|
||||
objects: [modelData]
|
||||
}
|
||||
|
||||
Text {
|
||||
text: modelData.name || "Unknown"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue