added component for player buttons
This commit is contained in:
parent
056bdb8298
commit
78aec2acf8
3 changed files with 68 additions and 56 deletions
|
|
@ -57,66 +57,15 @@ Item{
|
|||
model: musicModel
|
||||
}
|
||||
|
||||
Item{
|
||||
PlayerButtons{
|
||||
id: buttons
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.top: progress.bottom
|
||||
anchors.bottom: parent.bottom
|
||||
Row{
|
||||
id: buttons
|
||||
spacing: 20
|
||||
anchors.centerIn: parent
|
||||
|
||||
RoundButton{
|
||||
id: previous
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
|
||||
width: 60
|
||||
imageSource: "qrc:/icon_previous"
|
||||
|
||||
enabled: musicModel.pHasPrevious
|
||||
|
||||
onClicked:{
|
||||
musicModel.playPrevious();
|
||||
}
|
||||
}
|
||||
RoundButton{
|
||||
id: playPause
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
width: 80
|
||||
imageSource: musicModel.pIsPlaying ? "qrc:/icon_pause" : "qrc:/icon_play"
|
||||
|
||||
onClicked:{
|
||||
musicModel.playPause();
|
||||
}
|
||||
}
|
||||
RoundButton{
|
||||
id: stop
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
|
||||
width: 60
|
||||
imageSource: "qrc:/icon_stop"
|
||||
|
||||
enabled: musicModel.pIsPlaying
|
||||
|
||||
onClicked:{
|
||||
musicModel.stopMusic();
|
||||
}
|
||||
}
|
||||
RoundButton{
|
||||
id: next
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
|
||||
width: 60
|
||||
imageSource: "qrc:/icon_next"
|
||||
|
||||
enabled: musicModel.pHasNext
|
||||
|
||||
onClicked:{
|
||||
musicModel.playNext();
|
||||
}
|
||||
}
|
||||
} //Row
|
||||
}// Item
|
||||
model: musicModel
|
||||
spacing: 20
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
62
LenaPi/PlayerButtons.qml
Normal file
62
LenaPi/PlayerButtons.qml
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
import QtQuick 2.0
|
||||
|
||||
Item {
|
||||
id: container
|
||||
property var model
|
||||
property var spacing: 20
|
||||
Row{
|
||||
id: buttons
|
||||
anchors.centerIn: parent
|
||||
spacing: container.spacing
|
||||
|
||||
RoundButton{
|
||||
id: previous
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
|
||||
width: 60
|
||||
imageSource: "qrc:/icon_previous"
|
||||
|
||||
enabled: model.pHasPrevious
|
||||
|
||||
onClicked:{
|
||||
model.playPrevious();
|
||||
}
|
||||
}
|
||||
RoundButton{
|
||||
id: playPause
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
width: 80
|
||||
imageSource: model.pIsPlaying ? "qrc:/icon_pause" : "qrc:/icon_play"
|
||||
|
||||
onClicked:{
|
||||
model.playPause();
|
||||
}
|
||||
}
|
||||
RoundButton{
|
||||
id: stop
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
|
||||
width: 60
|
||||
imageSource: "qrc:/icon_stop"
|
||||
|
||||
enabled: model.pIsPlaying
|
||||
|
||||
onClicked:{
|
||||
model.stopMusic();
|
||||
}
|
||||
}
|
||||
RoundButton{
|
||||
id: next
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
|
||||
width: 60
|
||||
imageSource: "qrc:/icon_next"
|
||||
|
||||
enabled: model.pHasNext
|
||||
|
||||
onClicked:{
|
||||
model.playNext();
|
||||
}
|
||||
}
|
||||
} //Row
|
||||
}
|
||||
|
|
@ -8,5 +8,6 @@
|
|||
<file>Navigation.qml</file>
|
||||
<file>MusicPlayer.qml</file>
|
||||
<file>MediaProgress.qml</file>
|
||||
<file>PlayerButtons.qml</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue