diff --git a/advancedSettings.pro b/advancedSettings.pro index 17c0b17..00dbaec 100644 --- a/advancedSettings.pro +++ b/advancedSettings.pro @@ -139,4 +139,5 @@ DISTFILES += \ src/res/qml/SettingsPage.qml \ src/res/qml/StatisticsPage.qml \ src/res/qml/SteamVRPage.qml \ - src/res/qml/UtilitiesPage.qml + src/res/qml/UtilitiesPage.qml \ + src/res/qml/media_keys/* diff --git a/src/res/qml/UtilitiesPage.qml b/src/res/qml/UtilitiesPage.qml index 76841cf..70aa9a8 100644 --- a/src/res/qml/UtilitiesPage.qml +++ b/src/res/qml/UtilitiesPage.qml @@ -320,6 +320,124 @@ MyStackViewPage { } } + GroupBox { + id: mediaKeysGroupBox + Layout.fillWidth: true + + label: MyText { + leftPadding: 10 + text: "Media Control Keys" + bottomPadding: -10 + } + background: Rectangle { + color: "transparent" + border.color: "#ffffff" + radius: 8 + } + + RowLayout { + property bool playButtonIsPlay: false + MyPushButton2 { + id: previousSongButton + Layout.preferredHeight: 50 + Layout.preferredWidth: 50 + contentItem: Image { + source: "media_keys/outline_skip_previous_white_24dp.png" + sourceSize.width: 50 + sourceSize.height: 50 + anchors.fill: parent + } + onClicked: { + UtilitiesTabController.sendMediaPreviousSong() + } + + background: Rectangle { + opacity: parent.down ? 1.0 : (parent.activeFocus ? 0.5 : 0.0) + color: "#406288" + radius: 4 + anchors.fill: parent + } + } + MyPushButton2 { + id: stopSongButton + Layout.preferredHeight: 50 + Layout.preferredWidth: 50 + + contentItem: Image { + source: "media_keys/outline_stop_white_24dp.png" + sourceSize.width: 50 + sourceSize.height: 50 + anchors.fill: parent + } + onClicked: { + UtilitiesTabController.sendMediaStopSong() + playPauseSongButton.contentItem.source = "media_keys/outline_play_arrow_white_24dp.png" + parent.playButtonIsPlay = true + } + + background: Rectangle { + opacity: parent.down ? 1.0 : (parent.activeFocus ? 0.5 : 0.0) + color: "#406288" + radius: 4 + anchors.fill: parent + } + } + MyPushButton2 { + id: playPauseSongButton + Layout.preferredHeight: 50 + Layout.preferredWidth: 50 + contentItem: Image { + // Assume that music is playing when people enter VR. + source: "media_keys/outline_pause_white_24dp.png" + sourceSize.width: 50 + sourceSize.height: 50 + + anchors.fill: parent + } + onClicked: { + UtilitiesTabController.sendMediaPausePlay() + if (parent.playButtonIsPlay) { + playPauseSongButton.contentItem.source = "media_keys/outline_pause_white_24dp.png" + parent.playButtonIsPlay = false + } else { + playPauseSongButton.contentItem.source = "media_keys/outline_play_arrow_white_24dp.png" + parent.playButtonIsPlay = true + } + + } + + background: Rectangle { + opacity: parent.down ? 1.0 : (parent.activeFocus ? 0.5 : 0.0) + color: "#406288" + radius: 4 + anchors.fill: parent + } + } + MyPushButton2 { + id: nextSongButton + Layout.preferredHeight: 50 + Layout.preferredWidth: 50 + + contentItem: Image { + source: "media_keys/outline_skip_next_white_24dp.png" + sourceSize.width: 50 + sourceSize.height: 50 + anchors.fill: parent + } + onClicked: { + UtilitiesTabController.sendMediaNextSong() + } + + background: Rectangle { + opacity: parent.down ? 1.0 : (parent.activeFocus ? 0.5 : 0.0) + color: "#406288" + radius: 4 + anchors.fill: parent + } + } + } + } + Item { Layout.fillHeight: true } diff --git a/src/res/qml/media_keys/outline_pause_white_24dp.png b/src/res/qml/media_keys/outline_pause_white_24dp.png new file mode 100644 index 0000000..f49aed7 Binary files /dev/null and b/src/res/qml/media_keys/outline_pause_white_24dp.png differ diff --git a/src/res/qml/media_keys/outline_play_arrow_white_24dp.png b/src/res/qml/media_keys/outline_play_arrow_white_24dp.png new file mode 100644 index 0000000..1f724a2 Binary files /dev/null and b/src/res/qml/media_keys/outline_play_arrow_white_24dp.png differ diff --git a/src/res/qml/media_keys/outline_skip_next_white_24dp.png b/src/res/qml/media_keys/outline_skip_next_white_24dp.png new file mode 100644 index 0000000..e153299 Binary files /dev/null and b/src/res/qml/media_keys/outline_skip_next_white_24dp.png differ diff --git a/src/res/qml/media_keys/outline_skip_previous_white_24dp.png b/src/res/qml/media_keys/outline_skip_previous_white_24dp.png new file mode 100644 index 0000000..377e6dc Binary files /dev/null and b/src/res/qml/media_keys/outline_skip_previous_white_24dp.png differ diff --git a/src/res/qml/media_keys/outline_stop_white_24dp.png b/src/res/qml/media_keys/outline_stop_white_24dp.png new file mode 100644 index 0000000..c70e332 Binary files /dev/null and b/src/res/qml/media_keys/outline_stop_white_24dp.png differ