diff --git a/LenaPi/MusicPlayer.qml b/LenaPi/MusicPlayer.qml index 88f776e..30dfc1c 100644 --- a/LenaPi/MusicPlayer.qml +++ b/LenaPi/MusicPlayer.qml @@ -16,6 +16,17 @@ Item{ } } + RoundButton{ + id: closeApp + anchors.right: parent.right + anchors.top: parent.top + anchors.margins: container.margins + imageSource: "qrc:/icon_close" + onClicked: { + Qt.quit(); + } + } + Rectangle{ id: coverBorder anchors.horizontalCenter: parent.horizontalCenter diff --git a/LenaPi/Navigation.qml b/LenaPi/Navigation.qml index 122348d..2f6b0f3 100644 --- a/LenaPi/Navigation.qml +++ b/LenaPi/Navigation.qml @@ -4,18 +4,31 @@ import QtQuick 2.0 * @brief Navigation view containing list view displaying artists or genres and albums */ Item { + id: container + property int margins: 20 RoundButton{ id: back anchors.top: parent.top anchors.left: parent.left - anchors.margins: 20 + anchors.margins: container.margins visible: navigationList.pIsBackVisible onClicked: navigationList.navigateBack(); } // RoundButton: navigate back + RoundButton{ + id: closeApp + anchors.right: parent.right + anchors.top: parent.top + anchors.margins: container.margins + imageSource: "qrc:/icon_close" + onClicked: { + Qt.quit(); + } + } // RoundButton: closeApp + Rectangle{ anchors.left: parent.left anchors.right: parent.right diff --git a/LenaPi/RoundButton.qml b/LenaPi/RoundButton.qml index d6a4a62..1838e68 100644 --- a/LenaPi/RoundButton.qml +++ b/LenaPi/RoundButton.qml @@ -1,41 +1,40 @@ import QtQuick 2.0 +import QtQuick.Controls 2.4 -Rectangle { +/** + * @brief Round button containing an image + */ +Button { id: container property alias imageSource: image.source - signal clicked(); - border.width: 2 - border.color: "grey" + background: Rectangle{ - color: "white" + border.width: 2 + border.color: "grey" - width: 65 - height: width - radius: width/2 + color: "white" - Image{ - id: image - anchors.centerIn: parent - width: 30 - height: width - source: "qrc:/icon_back" - } - Rectangle{ - id: overlay - z: 1 - visible: !container.enabled - anchors.centerIn: parent - width: 30 - height: width - color: "#99ffffff" - } + implicitWidth: 65 + implicitHeight: width + radius: width/2 - MouseArea{ - id: controlObject - anchors.fill: parent - onClicked:{ - container.clicked(); + Image{ + id: image + anchors.centerIn: parent + width: 30 + height: width + source: "qrc:/icon_back" } + Rectangle{ + id: overlay + z: 1 + visible: !container.enabled + anchors.centerIn: parent + width: 30 + height: width + color: "#99ffffff" + } + } } diff --git a/LenaPi/lenapi.qrc b/LenaPi/lenapi.qrc index 421d47d..bba9b5d 100644 --- a/LenaPi/lenapi.qrc +++ b/LenaPi/lenapi.qrc @@ -8,5 +8,6 @@ resources/next.jpg resources/previous.jpg resources/stop.jpg + resources/close.png diff --git a/LenaPi/main.qml b/LenaPi/main.qml index 3bd0b10..7d26c1b 100644 --- a/LenaPi/main.qml +++ b/LenaPi/main.qml @@ -8,6 +8,8 @@ Window { height: 480 title: "LenaPi 1.2" + Component.onCompleted: showMaximized(); + Image{ id: background diff --git a/LenaPi/resources/close.png b/LenaPi/resources/close.png new file mode 100644 index 0000000..082ecc9 Binary files /dev/null and b/LenaPi/resources/close.png differ