1 /****************************************************************************
3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
4 ** All rights reserved.
5 ** Contact: Nokia Corporation (qt-info@nokia.com)
7 ** This file is part of the QtDeclarative module of the Qt Toolkit.
9 ** $QT_BEGIN_LICENSE:LGPL$
10 ** GNU Lesser General Public License Usage
11 ** This file may be used under the terms of the GNU Lesser General Public
12 ** License version 2.1 as published by the Free Software Foundation and
13 ** appearing in the file LICENSE.LGPL included in the packaging of this
14 ** file. Please review the following information to ensure the GNU Lesser
15 ** General Public License version 2.1 requirements will be met:
16 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
18 ** In addition, as a special exception, Nokia gives you certain additional
19 ** rights. These rights are described in the Nokia Qt LGPL Exception
20 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
22 ** GNU General Public License Usage
23 ** Alternatively, this file may be used under the terms of the GNU General
24 ** Public License version 3.0 as published by the Free Software Foundation
25 ** and appearing in the file LICENSE.GPL included in the packaging of this
26 ** file. Please review the following information to ensure the GNU General
27 ** Public License version 3.0 requirements will be met:
28 ** http://www.gnu.org/copyleft/gpl.html.
31 ** Alternatively, this file may be used in accordance with the terms and
32 ** conditions contained in a signed written agreement between you and Nokia.
40 ****************************************************************************/
43 import "common" as Common
44 import "mobile" as Mobile
47 id: screen; width: 320; height: 480
48 property bool inListView : false
52 anchors.fill: parent; color: "#343434";
54 Image { source: "mobile/images/stripes.png"; fillMode: Image.Tile; anchors.fill: parent; opacity: 0.3 }
56 Common.RssModel { id: rssModel }
61 anchors.top: titleBar.bottom; anchors.bottom: toolBar.top
64 id: photoGridView; model: rssModel; delegate: Mobile.GridDelegate {}
66 cellWidth: (parent.width-2)/4; cellHeight: cellWidth; width: parent.width; height: parent.height
70 id: photoListView; model: rssModel; delegate: Mobile.ListDelegate { }
71 width: parent.width; height: parent.height; x: -(parent.width * 1.5); cacheBuffer: 100;
75 name: "ListView"; when: screen.inListView == true
76 PropertyChanges { target: photoListView; x: 0 }
77 PropertyChanges { target: photoGridView; x: -(parent.width * 1.5) }
80 transitions: Transition {
81 NumberAnimation { properties: "x"; duration: 500; easing.type: Easing.InOutQuad }
84 Mobile.ImageDetails { id: imageDetails; width: parent.width; anchors.left: views.right; height: parent.height }
86 Item { id: foreground; anchors.fill: parent }
89 Mobile.TitleBar { id: titleBar; width: parent.width; height: 40; opacity: 0.9 }
93 height: 40; anchors.bottom: parent.bottom; width: parent.width; opacity: 0.9
94 button1Label: "Update"; button2Label: "View mode"
95 onButton1Clicked: rssModel.reload()
96 onButton2Clicked: if (screen.inListView == true) screen.inListView = false; else screen.inListView = true
102 if (background.state == "DetailedView") {
103 background.state = '';
104 imageDetails.photoUrl = "";
111 PropertyChanges { target: views; x: -parent.width }
112 PropertyChanges { target: toolBar; button1Label: "View..." }
115 onButton1Clicked: if (imageDetails.state=='') imageDetails.state='Back'; else imageDetails.state=''
117 PropertyChanges { target: toolBar; button2Label: "Back" }
118 PropertyChanges { target: toolBar; onButton2Clicked: imageDetails.closed() }
121 transitions: Transition {
122 NumberAnimation { properties: "x"; duration: 500; easing.type: Easing.InOutQuad }