added basic usi for music player. No model yet.
This commit is contained in:
parent
bf145a9be9
commit
ef018332b9
9 changed files with 57 additions and 2 deletions
44
LenaPi/MusicPlayer.qml
Normal file
44
LenaPi/MusicPlayer.qml
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
import QtQuick 2.0
|
||||
|
||||
Item{
|
||||
id: container
|
||||
|
||||
Image {
|
||||
id: backgroundImage
|
||||
|
||||
anchors.fill: parent
|
||||
source: "file:///home/ar/source/testLenaPi/benjamin/image.jpg"
|
||||
fillMode: Image.PreserveAspectCrop
|
||||
verticalAlignment: Image.AlignTop
|
||||
}
|
||||
RoundButton{
|
||||
id: backNavigation
|
||||
anchors.left: parent.left
|
||||
anchors.top: parent.top
|
||||
anchors.margins: 20
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
id: controlPannel
|
||||
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.bottom: parent.bottom
|
||||
color: "#99ffffff"
|
||||
height: 120
|
||||
|
||||
RoundButton{
|
||||
id: startPause
|
||||
anchors.centerIn: parent
|
||||
width: 80
|
||||
imageSource: "qrc:/icon_play"
|
||||
|
||||
onClicked:{
|
||||
if(imageSource == "qrc:/icon_play")
|
||||
imageSource = "qrc:/icon_pause"
|
||||
else
|
||||
imageSource = "qrc:/icon_play"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -10,7 +10,7 @@ Rectangle {
|
|||
|
||||
color: "white"
|
||||
|
||||
width: 50
|
||||
width: 65
|
||||
height: width
|
||||
radius: width/2
|
||||
|
||||
|
|
|
|||
|
|
@ -3,5 +3,7 @@
|
|||
<file alias="icon_back">resources/back.png</file>
|
||||
<file alias="default_image">resources/defaultImage.png</file>
|
||||
<file alias="background">resources/sky.jpg</file>
|
||||
<file alias="icon_pause">resources/pause.jpg</file>
|
||||
<file alias="icon_play">resources/play.jpg</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ Window {
|
|||
|
||||
Loader{
|
||||
anchors.fill: parent
|
||||
//source: "MusicPlayer.qml"
|
||||
source: "Navigation.qml"
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -33,6 +33,12 @@ bool NavigationListModel::isBackVisible()
|
|||
return mIsBackVisible;
|
||||
}
|
||||
|
||||
void NavigationListModel::navigateTo(NavigationItemModel *item)
|
||||
{
|
||||
if(!item) return;
|
||||
setModelItems(item->getSiblings());
|
||||
}
|
||||
|
||||
void NavigationListModel::navigateBack()
|
||||
{
|
||||
if(!mIsBackVisible || mItems.isEmpty()) return;
|
||||
|
|
@ -40,5 +46,5 @@ void NavigationListModel::navigateBack()
|
|||
auto item = qobject_cast<NavigationItemModel*>(mItems.at(0));
|
||||
if(!item || item->getParentItem()->isRoot()) return;
|
||||
|
||||
setModelItems(item->getParentItem()->getSiblings());
|
||||
navigateTo(item->getParentItem());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ public:
|
|||
|
||||
bool isBackVisible();
|
||||
|
||||
void navigateTo(NavigationItemModel* item);
|
||||
Q_INVOKABLE void navigateBack();
|
||||
|
||||
private:
|
||||
|
|
|
|||
|
|
@ -6,5 +6,6 @@
|
|||
<file>MyScrollView.qml</file>
|
||||
<file>RoundButton.qml</file>
|
||||
<file>Navigation.qml</file>
|
||||
<file>MusicPlayer.qml</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
|
|
|||
BIN
LenaPi/resources/pause.jpg
Normal file
BIN
LenaPi/resources/pause.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.1 KiB |
BIN
LenaPi/resources/play.jpg
Normal file
BIN
LenaPi/resources/play.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.3 KiB |
Loading…
Add table
Add a link
Reference in a new issue