disable previous and next button
if there is no corresponding media; set play/pause symbol via model property instead of via qml.
This commit is contained in:
parent
a29e8d7a64
commit
6eabd3cb75
5 changed files with 75 additions and 8 deletions
|
|
@ -59,7 +59,7 @@ Item{
|
|||
width: 60
|
||||
imageSource: "qrc:/icon_previous"
|
||||
|
||||
// visible: model.pHasPrevious
|
||||
enabled: musicModel.pHasPrevious
|
||||
|
||||
onClicked:{
|
||||
musicModel.playPrevious();
|
||||
|
|
@ -69,14 +69,14 @@ Item{
|
|||
id: playPause
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
width: 80
|
||||
imageSource: "qrc:/icon_play"
|
||||
imageSource: musicModel.pIsPlaying ? "qrc:/icon_pause" : "qrc:/icon_play"
|
||||
|
||||
onClicked:{
|
||||
musicModel.playPause();
|
||||
if(imageSource == "qrc:/icon_play")
|
||||
/* if(imageSource == "qrc:/icon_play")
|
||||
imageSource = "qrc:/icon_pause"
|
||||
else
|
||||
imageSource = "qrc:/icon_play"
|
||||
imageSource = "qrc:/icon_play"*/
|
||||
}
|
||||
}
|
||||
RoundButton{
|
||||
|
|
@ -86,9 +86,11 @@ Item{
|
|||
width: 60
|
||||
imageSource: "qrc:/icon_stop"
|
||||
|
||||
enabled: musicModel.pIsPlaying
|
||||
|
||||
onClicked:{
|
||||
musicModel.stopMusic();
|
||||
playPause.imageSource = "qrc:/icon_play"
|
||||
//playPause.imageSource = "qrc:/icon_play"
|
||||
}
|
||||
}
|
||||
RoundButton{
|
||||
|
|
@ -98,7 +100,7 @@ Item{
|
|||
width: 60
|
||||
imageSource: "qrc:/icon_next"
|
||||
|
||||
// visible: model.pHasNext
|
||||
enabled: musicModel.pHasNext
|
||||
|
||||
onClicked:{
|
||||
musicModel.playNext();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue