1 /****************************************************************************
3 ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/
6 ** This file is part of the QtQml module of the Qt Toolkit.
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** GNU Lesser General Public License Usage
10 ** This file may be used under the terms of the GNU Lesser General Public
11 ** License version 2.1 as published by the Free Software Foundation and
12 ** appearing in the file LICENSE.LGPL included in the packaging of this
13 ** file. Please review the following information to ensure the GNU Lesser
14 ** General Public License version 2.1 requirements will be met:
15 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
17 ** In addition, as a special exception, Nokia gives you certain additional
18 ** rights. These rights are described in the Nokia Qt LGPL Exception
19 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
21 ** GNU General Public License Usage
22 ** Alternatively, this file may be used under the terms of the GNU General
23 ** Public License version 3.0 as published by the Free Software Foundation
24 ** and appearing in the file LICENSE.GPL included in the packaging of this
25 ** file. Please review the following information to ensure the GNU General
26 ** Public License version 3.0 requirements will be met:
27 ** http://www.gnu.org/copyleft/gpl.html.
30 ** Alternatively, this file may be used in accordance with the terms and
31 ** conditions contained in a signed written agreement between you and Nokia.
40 ****************************************************************************/
43 import QtQuick.XmlListModel 2.0
44 import "TwitterCore" 2.0 as Twitter
47 id: screen; width: 320; height: 480
48 property bool userView : false
49 property variant tmpStr
50 function setUser(str){hack.running = true; tmpStr = str}
51 function reallySetUser(){rssModel.from = tmpStr;rssModel.to = ""; rssModel.phrase = ""}
53 //Workaround for bug 260266
54 Timer{ interval: 1; running: false; repeat: false; onTriggered: screen.reallySetUser(); id:hack }
55 Keys.onEscapePressed: screen.state="searchquery"
56 Keys.onBacktabPressed: screen.state="searchquery"
59 anchors.fill: parent; color: "#343434";
62 Image { source: "TwitterCore/images/stripes.png"; fillMode: Image.Tile; anchors.fill: parent; opacity: 0.3 }
66 onClicked: screen.focus = false;
69 Twitter.RssModel { id: rssModel }
70 Twitter.Loading { anchors.centerIn: parent; visible: rssModel.status==XmlListModel.Loading && state!='unauthed'}
73 text: "Could not access twitter using this screen name and password pair.";
74 color: "#cccccc"; style: Text.Raised; styleColor: "black"; wrapMode: Text.WordWrap
75 visible: rssModel.status==XmlListModel.Error; anchors.centerIn: parent
80 x: 2; width: parent.width - 4
81 y:60 //Below the title bars
82 height: parent.height - 100
86 text: "Search Twitter"
87 anchors.horizontalCenter: parent.horizontalCenter
88 font.pixelSize: 20; font.bold: true; color: "#bbb"; style: Text.Raised; styleColor: "black"
94 anchors.verticalCenter: parent.verticalCenter
95 width: parent.width; height: parent.height-60;
96 x: -(screen.width * 1.5)
99 Twitter.FatDelegate { id: fatDelegate }
101 id: mainView; model: rssModel.model; delegate: fatDelegate;
102 width: parent.width; height: parent.height; x: 0; cacheBuffer: 100;
106 Twitter.MultiTitleBar { id: titleBar; width: parent.width }
107 Twitter.ToolBar { id: toolBar; height: 40;
108 //anchors.bottom: parent.bottom;
109 //TODO: Use anchor changes instead of hard coding
110 y: screen.height - 40
111 width: parent.width; opacity: 0.9
112 button1Label: "New Search"
113 button2Label: "Update"
116 screen.state="searchquery"
118 onButton2Clicked: rssModel.reload();
124 PropertyChanges { target: searchView; x: 0; focus:true}
125 PropertyChanges { target: mainView; x: -(parent.width * 1.5) }
126 PropertyChanges { target: titleBar; y: -80 }
127 PropertyChanges { target: toolBar; y: screen.height }
128 PropertyChanges { target: toolBar }
129 PropertyChanges { target: title; opacity:1}
133 Transition { NumberAnimation { properties: "x,y,opacity"; duration: 500; easing.type: Easing.InOutQuad } }