Add underline to Media Control Keys

This commit is contained in:
Vasily
2019-01-12 19:42:03 +01:00
parent 566165da39
commit d9d6b0806e
+96 -85
View File
@@ -334,105 +334,116 @@ MyStackViewPage {
border.color: "#ffffff" border.color: "#ffffff"
radius: 8 radius: 8
} }
ColumnLayout {
anchors.fill: parent
RowLayout { Rectangle {
property bool playButtonIsPlay: false color: "#ffffff"
MyPushButton2 { height: 1
id: previousSongButton Layout.fillWidth: true
Layout.preferredHeight: 50 Layout.bottomMargin: 5
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 { RowLayout {
opacity: parent.down ? 1.0 : (parent.activeFocus ? 0.5 : 0.0) property bool playButtonIsPlay: false
color: "#406288" MyPushButton2 {
radius: 4 id: previousSongButton
anchors.fill: parent Layout.preferredHeight: 50
} Layout.preferredWidth: 50
} contentItem: Image {
MyPushButton2 { source: "media_keys/outline_skip_previous_white_24dp.png"
id: playPauseSongButton sourceSize.width: 50
Layout.preferredHeight: 50 sourceSize.height: 50
Layout.preferredWidth: 50 anchors.fill: parent
contentItem: Image { }
// Assume that music is playing when people enter VR. onClicked: {
source: "media_keys/outline_pause_white_24dp.png" UtilitiesTabController.sendMediaPreviousSong()
sourceSize.width: 50 }
sourceSize.height: 50
anchors.fill: parent background: Rectangle {
opacity: parent.down ? 1.0 : (parent.activeFocus ? 0.5 : 0.0)
color: "#406288"
radius: 4
anchors.fill: parent
}
} }
onClicked: { MyPushButton2 {
UtilitiesTabController.sendMediaPausePlay() id: stopSongButton
if (parent.playButtonIsPlay) { Layout.preferredHeight: 50
playPauseSongButton.contentItem.source = "media_keys/outline_pause_white_24dp.png" Layout.preferredWidth: 50
parent.playButtonIsPlay = false
} else { 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" playPauseSongButton.contentItem.source = "media_keys/outline_play_arrow_white_24dp.png"
parent.playButtonIsPlay = true 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
background: Rectangle { anchors.fill: parent
opacity: parent.down ? 1.0 : (parent.activeFocus ? 0.5 : 0.0) }
color: "#406288" onClicked: {
radius: 4 UtilitiesTabController.sendMediaPausePlay()
anchors.fill: parent if (parent.playButtonIsPlay) {
} playPauseSongButton.contentItem.source = "media_keys/outline_pause_white_24dp.png"
} parent.playButtonIsPlay = false
MyPushButton2 { } else {
id: nextSongButton playPauseSongButton.contentItem.source = "media_keys/outline_play_arrow_white_24dp.png"
Layout.preferredHeight: 50 parent.playButtonIsPlay = true
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 { background: Rectangle {
opacity: parent.down ? 1.0 : (parent.activeFocus ? 0.5 : 0.0) opacity: parent.down ? 1.0 : (parent.activeFocus ? 0.5 : 0.0)
color: "#406288" color: "#406288"
radius: 4 radius: 4
anchors.fill: parent 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
}
} }
} }
} }