volumeosd: Fix qml errors when undefined

Sometimes the HasVolume property apparently is undefined? Handle this
case gracefully so it doesn't spam the console.
This commit is contained in:
Devin Lin 2025-06-25 13:22:20 -04:00
parent 2b51e0c30c
commit 3cc22dd7fb

View file

@ -161,8 +161,9 @@ Controls.Control {
from: PulseAudio.MinimalVolume
to: PulseAudio.NormalVolume
stepSize: to / (to / PulseAudio.NormalVolume * 100.0)
visible: HasVolume
enabled: VolumeWritable
visible: model.HasVolume === true // (may be undefined)
enabled: model.VolumeWritable
opacity: Muted ? 0.5 : 1
Accessible.name: i18nc("Accessibility data on volume slider", "Adjust volume for %1", baseItem.label)