From 9aaaf205773d6c2f637efff7b02ccfbb34700e9d Mon Sep 17 00:00:00 2001 From: Vasily Date: Sun, 13 Jan 2019 17:57:15 +0100 Subject: [PATCH] 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. --- src/res/qml/media_keys/MediaControllerKeys.qml | 17 ++--------------- .../qml/media_keys/outline_pause_white_24dp.svg | 1 - .../outline_play_arrow_white_24dp.svg | 1 - .../outline_play_pause_white_24dp.svg | 12 ++++++++++++ 4 files changed, 14 insertions(+), 17 deletions(-) delete mode 100644 src/res/qml/media_keys/outline_pause_white_24dp.svg delete mode 100644 src/res/qml/media_keys/outline_play_arrow_white_24dp.svg create mode 100644 src/res/qml/media_keys/outline_play_pause_white_24dp.svg diff --git a/src/res/qml/media_keys/MediaControllerKeys.qml b/src/res/qml/media_keys/MediaControllerKeys.qml index 3381950..d81da5f 100644 --- a/src/res/qml/media_keys/MediaControllerKeys.qml +++ b/src/res/qml/media_keys/MediaControllerKeys.qml @@ -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 - } - } } diff --git a/src/res/qml/media_keys/outline_pause_white_24dp.svg b/src/res/qml/media_keys/outline_pause_white_24dp.svg deleted file mode 100644 index f59d7c9..0000000 --- a/src/res/qml/media_keys/outline_pause_white_24dp.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/res/qml/media_keys/outline_play_arrow_white_24dp.svg b/src/res/qml/media_keys/outline_play_arrow_white_24dp.svg deleted file mode 100644 index 2b248b9..0000000 --- a/src/res/qml/media_keys/outline_play_arrow_white_24dp.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/res/qml/media_keys/outline_play_pause_white_24dp.svg b/src/res/qml/media_keys/outline_play_pause_white_24dp.svg new file mode 100644 index 0000000..03a3ca1 --- /dev/null +++ b/src/res/qml/media_keys/outline_play_pause_white_24dp.svg @@ -0,0 +1,12 @@ + + + + + + + +