extract constants
This commit is contained in:
parent
bc3a85d18d
commit
b969f0824f
22 changed files with 106 additions and 63 deletions
|
|
@ -4,10 +4,8 @@ import "." as M
|
|||
|
||||
M.BarSection {
|
||||
id: root
|
||||
spacing: 4
|
||||
tooltip: (root.sink?.description ?? root.sink?.name ?? "Unknown sink") +
|
||||
"\nVolume: " + Math.round(root.volume * 100) + "%" +
|
||||
(root.muted ? "\nMuted" : "")
|
||||
spacing: M.Theme.moduleSpacing
|
||||
tooltip: (root.sink?.description ?? root.sink?.name ?? "Unknown sink") + "\nVolume: " + Math.round(root.volume * 100) + "%" + (root.muted ? "\nMuted" : "")
|
||||
|
||||
PwObjectTracker {
|
||||
objects: [Pipewire.defaultAudioSink]
|
||||
|
|
@ -27,12 +25,14 @@ M.BarSection {
|
|||
}
|
||||
|
||||
TapHandler {
|
||||
onTapped: if (root.sink?.audio) root.sink.audio.muted = !root.sink.audio.muted
|
||||
onTapped: if (root.sink?.audio)
|
||||
root.sink.audio.muted = !root.sink.audio.muted
|
||||
}
|
||||
|
||||
WheelHandler {
|
||||
onWheel: event => {
|
||||
if (!root.sink?.audio) return;
|
||||
if (!root.sink?.audio)
|
||||
return;
|
||||
root.sink.audio.volume = Math.max(0, root.sink.audio.volume + (event.angleDelta.y > 0 ? 0.05 : -0.05));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue