Skip to content

Commit d81155c

Browse files
committed
Add global streaming control to plasmoid
1 parent 7357d82 commit d81155c

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

plasmoid/contents/ui/main.qml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,15 @@ PlasmoidItem {
4040
readonly property bool isConnecting: root.daemonState === "connecting"
4141
readonly property bool needsPIN: root.daemonState === "pin_required"
4242
readonly property bool isBusy: root.daemonState === "discovering"
43+
readonly property bool hasAnyStreamingTarget: {
44+
var streams = root.streamList || []
45+
for (var i = 0; i < streams.length; i++) {
46+
if (streams[i].state === "streaming") {
47+
return true
48+
}
49+
}
50+
return false
51+
}
4352
readonly property bool hasAnyAudioStream: {
4453
var streams = root.streamList || []
4554
for (var i = 0; i < streams.length; i++) {
@@ -266,6 +275,17 @@ PlasmoidItem {
266275
root.runCtl(["discover"], "discover")
267276
}
268277
}
278+
Controls.ToolButton {
279+
icon.name: "media-playback-stop"
280+
display: Controls.ToolButton.IconOnly
281+
visible: root.hasAnyStreamingTarget
282+
enabled: !root.isBusy
283+
Controls.ToolTip.text: "Stop streaming to all targets"
284+
Controls.ToolTip.visible: hovered
285+
onClicked: {
286+
root.runCtl(["disconnect"], "disconnect")
287+
}
288+
}
269289
Controls.ToolButton {
270290
icon.name: root.allAudioStreamsMuted ? "audio-volume-muted" : "audio-volume-high"
271291
display: Controls.ToolButton.IconOnly

0 commit comments

Comments
 (0)