Replace pause and play buttons with combined pause/play

The separate pause and play buttons necessitated changing between them
to signal that state had changed. Replacing it with a combined
pause/play button sidesteps all the issues in syncing up when which icon
should be shown.
This commit is contained in:
Vasily
2019-01-13 17:57:15 +01:00
parent f5000a0ee0
commit 9aaaf20577
4 changed files with 14 additions and 17 deletions
+2 -15
View File
@@ -26,10 +26,7 @@ GroupBox {
}
RowLayout {
property bool playButtonIsPlay: false
property string playButtonPath: "outline_play_arrow_white_24dp.svg"
property string pauseButtonPath: "outline_pause_white_24dp.svg"
property string playPauseButtonPath: "outline_play_pause_white_24dp.svg"
property string stopButtonPath: "outline_stop_white_24dp.svg"
property string previousButtonPath: "outline_skip_previous_white_24dp.svg"
property string nextButtonPath: "outline_skip_next_white_24dp.svg"
@@ -47,24 +44,14 @@ GroupBox {
imagePath: parent.stopButtonPath
onClicked: {
UtilitiesTabController.sendMediaStopSong()
playPauseSongButton.contentItem.source = parent.playButtonPath
parent.playButtonIsPlay = true
}
}
MediaButton {
id: playPauseSongButton
imagePath: parent.pauseButtonPath
imagePath: parent.playPauseButtonPath
onClicked: {
UtilitiesTabController.sendMediaPausePlay()
if (parent.playButtonIsPlay) {
playPauseSongButton.contentItem.source = parent.pauseButtonPath
parent.playButtonIsPlay = false
} else {
playPauseSongButton.contentItem.source = parent.playButtonPath
parent.playButtonIsPlay = true
}
}
}