[app/mpris] Use property binding

This commit is contained in:
Nicolas Fella 2020-07-17 01:48:20 +02:00
parent cefe6eec14
commit 6cbaaa1a80

View file

@ -56,7 +56,6 @@ Kirigami.Page
{
muted = !muted
root.pluginInterface.volume = muted ? 0 : volumeUnmuted
muteButton.icon.name = muted ? "audio-volume-muted" : soundState(root.pluginInterface.volume)
}
function msToTime(currentTime, totalTime)
@ -163,7 +162,7 @@ Kirigami.Page
Layout.fillWidth: true
Button {
id: muteButton
icon.name: soundState(root.pluginInterface.volume)
icon.name: muted ? "audio-volume-muted" : soundState(root.pluginInterface.volume)
onClicked: toggleMute()
}
Slider {
@ -175,7 +174,6 @@ Kirigami.Page
onValueChanged: {
volumeUnmuted = value
root.pluginInterface.volume = value
muteButton.icon.name = soundState(root.pluginInterface.volume)
}
}
}