From kde-commits Tue Jun 28 18:18:47 2016 From: Weng Xuetian Date: Tue, 28 Jun 2016 18:18:47 +0000 To: kde-commits Subject: [plasma-pa] /: Make it possible to adjust volume even if it's muted Message-Id: X-MARC-Message: https://marc.info/?l=kde-commits&m=146713793722987 Git commit 3f4e449de8bfa8d27c7df8df505d7366aea0bf62 by Weng Xuetian. Committed on 28/06/2016 at 18:18. Pushed by xuetianweng into branch 'master'. Make it possible to adjust volume even if it's muted Summary: Do not disable the slider if it's muted. It would be more convinient if it's possible to change muted item volume, just like other mixers. Also unmute the device/stream if it's muted at the same time. Unfortunately, I didn't find a way to pretend to be visually disabled, thus here we use opacity to get the similar visual feedback. Test Plan: test on my desktop Reviewers: drosca Reviewed By: drosca Subscribers: jensreuterberg, plasma-devel Tags: #plasma Differential Revision: https://phabricator.kde.org/D2000 M +3 -1 applet/contents/ui/ListItemBase.qml M +3 -1 src/kcm/package/contents/ui/VolumeSlider.qml http://commits.kde.org/plasma-pa/3f4e449de8bfa8d27c7df8df505d7366aea0bf62 diff --git a/applet/contents/ui/ListItemBase.qml b/applet/contents/ui/ListI= temBase.qml index 49693bf..a0d8d2d 100644 --- a/applet/contents/ui/ListItemBase.qml +++ b/applet/contents/ui/ListItemBase.qml @@ -144,7 +144,8 @@ PlasmaComponents.ListItem { maximumValue: maxVolumeValue stepSize: maximumValue / maxVolumePercent visible: HasVolume - enabled: VolumeWritable && !Muted + enabled: VolumeWritable + opacity: Muted ? 0.5 : 1 = onVolumeChanged: { ignoreValueChange =3D true; @@ -155,6 +156,7 @@ PlasmaComponents.ListItem { onValueChanged: { if (!ignoreValueChange) { Volume =3D value; + Muted =3D false; = if (!pressed) { updateTimer.restart(); diff --git a/src/kcm/package/contents/ui/VolumeSlider.qml b/src/kcm/package= /contents/ui/VolumeSlider.qml index ee33532..19bc498 100644 --- a/src/kcm/package/contents/ui/VolumeSlider.qml +++ b/src/kcm/package/contents/ui/VolumeSlider.qml @@ -41,7 +41,8 @@ RowLayout { minimumValue: PulseAudio.MinimalVolume maximumValue: PulseAudio.MaximalVolume visible: HasVolume - enabled: VolumeWritable && !Muted + enabled: VolumeWritable + opacity: Muted ? 0.5 : 1 = onVolumeChanged: { ignoreValueChange =3D true; @@ -52,6 +53,7 @@ RowLayout { onValueChanged: { if (!ignoreValueChange) { Volume =3D value; + Muted =3D false; = if (!pressed) { updateTimer.restart();