From 10dc7efbeb643e32d676393d61b8a11ced8b07ce Mon Sep 17 00:00:00 2001 From: Ivan Frade Date: Fri, 8 Apr 2011 14:50:15 +0300 Subject: [PATCH] QML: Move main screen to its own QML file --- ui/Intro.qml | 25 +++++++++++++++++++++++++ ui/main.qml | 29 ++++++++--------------------- 2 files changed, 33 insertions(+), 21 deletions(-) create mode 100644 ui/Intro.qml diff --git a/ui/Intro.qml b/ui/Intro.qml new file mode 100644 index 0000000..fc1e943 --- /dev/null +++ b/ui/Intro.qml @@ -0,0 +1,25 @@ +import Qt 4.7 + +Row { + id: initPage + + signal selected (string state) + + anchors.horizontalCenter : parent.horizontalCenter + anchors.verticalCenter: parent.verticalCenter + spacing: screen.width / 4 + + FancyButton { + source: "images/button-blue.png" + caption: "Edit metadata" + } + + FancyButton { + source: "images/button-red.png" + caption: "Album art" + onClicked: { + initPage.selected ("in_albumsPage") + screen.state = "in_albumsPage" + } + } +} diff --git a/ui/main.qml b/ui/main.qml index 082d3b6..33e9c1f 100644 --- a/ui/main.qml +++ b/ui/main.qml @@ -5,30 +5,17 @@ Rectangle { width: 800 height: 480 color: "black" - //state: "in_initPage" - state: "in_albumsPage" + state: "in_initPage" + //state: "in_albumsPage" - Row { - id: initPage - - anchors.horizontalCenter : screen.horizontalCenter - anchors.verticalCenter: screen.verticalCenter - spacing: screen.width / 4 - - FancyButton { - source: "images/button-blue.png" - caption: "Edit metadata" - } - - FancyButton { - source: "images/button-red.png" - caption: "Album art" - onClicked: { - screen.state = "in_albumsPage" - } - } + Intro { + id: initPage + onSelected: { + screen.state = state + } } + AlbumList { id: albumsPage model: albumModel -- 1.7.9.5