diff --git a/applet/contents/ui/ListItemBase.qml b/applet/contents/ui/ListItemBase.qml --- a/applet/contents/ui/ListItemBase.qml +++ b/applet/contents/ui/ListItemBase.qml @@ -131,11 +131,12 @@ // changes trigger volume changes trigger value changes. property int volume: Volume property bool ignoreValueChange: true + property bool raiseMaxVolume: false Layout.fillWidth: true minimumValue: PulseAudio.MinimalVolume - maximumValue: maxVolumeValue - stepSize: maximumValue / maxVolumePercent + maximumValue: raiseMaxVolume ? PulseAudio.MaximalVolume : maxVolumeValue + stepSize: maximumValue / (maximumValue / PulseAudio.NormalVolume * 100.0) visible: HasVolume enabled: VolumeWritable opacity: Muted ? 0.5 : 1 @@ -268,6 +269,16 @@ contextMenu.addMenuItem(menuItem); } + // Raise max volume + menuItem = newMenuItem(); + menuItem.text = i18n("Raise maximum volume"); + menuItem.checkable = true; + menuItem.checked = slider.raiseMaxVolume; + menuItem.clicked.connect(function() { + slider.raiseMaxVolume = !slider.raiseMaxVolume; + }); + contextMenu.addMenuItem(menuItem); + // Ports if (PulseObject.ports && PulseObject.ports.length > 0) { contextMenu.addMenuItem(newSeperator()); diff --git a/applet/contents/ui/main.qml b/applet/contents/ui/main.qml --- a/applet/contents/ui/main.qml +++ b/applet/contents/ui/main.qml @@ -34,8 +34,7 @@ id: main property bool volumeFeedback: Plasmoid.configuration.volumeFeedback - property int maxVolumePercent: Plasmoid.configuration.maximumVolume - property int maxVolumeValue: Math.round(maxVolumePercent * PulseAudio.NormalVolume / 100.0) + property int maxVolumeValue: Math.round(Plasmoid.configuration.maximumVolume * PulseAudio.NormalVolume / 100.0) property int volumeStep: Math.round(Plasmoid.configuration.volumeStep * PulseAudio.NormalVolume / 100.0) property string displayName: i18n("Audio Volume") property QtObject draggedStream: null