Page {
id: albumsPage
tools: commonTools
- Label {
- id: label
- anchors.centerIn: parent
- text: "albums page"
- visible: false
- }
- Button{
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.top: label.bottom
- anchors.topMargin: 10
- text: qsTr("Click here!")
- onClicked: label.visible=true
+
+ anchors.fill: parent
+
+ signal rowSelected (int index, variant selectedAlbum)
+
+ GridView {
+ id: albumsView
+ model: albumModel
+ anchors.fill : albumsPage
+ cellWidth: 160
+ cellHeight: 160
+
+ delegate: Component {
+ Rectangle {
+ id: albumPaintArea
+ width: albumsView.cellWidth
+ height: albumsView.cellHeight
+ border.color: "red"
+
+ Image {
+ id: cover
+ source: model.album.album_art // || "images/button-blue.png"
+ //anchors.fill: parent
+ anchors.centerIn: parent
+ }
+
+ Text {
+ id: t
+ text: model.album.title
+ visible: (model.album.album_art != null)
+ }
+
+
+ MouseArea {
+ anchors.fill: albumPaintArea
+ onClicked: { albumsPage.rowSelected (index, model.album) }
+ }
+
+ }
+ }
}
+
}
--- /dev/null
+import QtQuick 1.1
+import com.meego 1.0
+
+Page {
+
+ TabGroup {
+ id: tabGroup
+ currentTab: albumsTab
+ AlbumsPage {id: albumsTab}
+ SongsPage {id: othersTab}
+ }
+
+ tools: ToolBarLayout {
+ id: commonTools
+ visible: true
+ ButtonRow {
+ style: TabButtonStyle { }
+ TabButton {
+ text: "Albums"
+ tab: albumsTab
+ }
+ TabButton {
+ text: "Songs"
+ tab: othersTab
+ }
+ }
+ ToolIcon { platformIconId: "toolbar-view-menu";
+ anchors.right: parent===undefined ? undefined : parent.right
+ onClicked: (myMenu.status == DialogStatus.Closed) ? myMenu.open() : myMenu.close()
+ }
+ }
+
+ Menu {
+ id: myMenu
+ MenuLayout {
+ MenuItem { text: "Download all" }
+ }
+ }
+}
+
PageStackWindow {
id: appWindow
- initialPage: Empty {}
+ platformStyle: PageStackWindowStyle { id: defaultStyle }
- TabGroup {
- id: tabGroup
- currentTab: albumsTab
- AlbumsPage {id: albumsTab}
- SongsPage {id: othersTab}
- }
+ initialPage: Mussorgsky {}
- ToolBarLayout {
- id: commonTools
- visible: true
- ButtonRow {
- style: TabButtonStyle { }
- TabButton {
- text: "Albums"
- tab: albumsTab
- }
- TabButton {
- text: "Songs"
- tab: othersTab
- }
- }
- ToolIcon { platformIconId: "toolbar-view-menu";
- anchors.right: parent===undefined ? undefined : parent.right
- onClicked: (myMenu.status == DialogStatus.Closed) ? myMenu.open() : myMenu.close()
- }
- }
-
- Menu {
- id: myMenu
- MenuLayout {
- MenuItem { text: "Download all" }
- }
- }
}