3 @author: Sudheer K. <scifi1947 at gmail.com>
4 @license: GNU General Public License
6 Based on Nokia Qt Quick Demos with copyright notice below.
8 Source: http://doc.qt.nokia.com/4.7-snapshot/demos-declarative-twitter-twittercore-titlebar-qml.html
11 /****************************************************************************
13 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
14 ** All rights reserved.
15 ** Contact: Nokia Corporation (qt-info@nokia.com)
17 ** This file is part of the QtDeclarative module of the Qt Toolkit.
19 ** $QT_BEGIN_LICENSE:LGPL$
20 ** No Commercial Usage
21 ** This file contains pre-release code and may not be distributed.
22 ** You may use this file in accordance with the terms and conditions
23 ** contained in the Technology Preview License Agreement accompanying
26 ** GNU Lesser General Public License Usage
27 ** Alternatively, this file may be used under the terms of the GNU Lesser
28 ** General Public License version 2.1 as published by the Free Software
29 ** Foundation and appearing in the file LICENSE.LGPL included in the
30 ** packaging of this file. Please review the following information to
31 ** ensure the GNU Lesser General Public License version 2.1 requirements
32 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
34 ** In addition, as a special exception, Nokia gives you certain additional
35 ** rights. These rights are described in the Nokia Qt LGPL Exception
36 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
38 ** If you have questions regarding the use of this file, please contact
39 ** Nokia at qt-info@nokia.com.
50 ****************************************************************************/
56 property string title: "Markets Today"
57 property string buttonType: "Config"
58 property bool displayMenu: false
60 signal settingsClicked
67 BorderImage { source: "images/titlebar.sci"; width: parent.width; height: parent.height + 14; y: -7 }
71 width: parent.width; height: parent.height
74 id: contextMenuComponent
76 onTickersClicked: titleBar.tickersClicked();
77 onOptionsClicked: titleBar.optionsClicked();
84 anchors.top: parent.top
85 anchors.horizontalCenter: parent.horizontalCenter
91 contextMenuLoader.state = "visible"
96 AnchorChanges { target: contextMenuLoader; anchors { bottom: undefined; top: container.top } }
97 PropertyChanges { target: contextMenuLoader; anchors.topMargin: 5 }
100 transitions: Transition {
101 AnchorAnimation { easing.type: Easing.OutQuart; duration: 500 }
108 leftMargin: 5; rightMargin: 10
111 elide: Text.ElideMiddle
113 font.bold: true; color: "White"; style: Text.Raised; styleColor: "Black"
117 id: contextMenuMouseArea
122 contextMenuLoader.sourceComponent = contextMenuComponent;
140 source: "images/config.png"
141 width: 40; height: 40
142 anchors.centerIn: parent
146 id: configButtonMouseArea
149 titleBar.settingsClicked();
154 name: "pressed"; when: configButtonMouseArea.pressed
155 PropertyChanges { target: configButtonArea; color: "#9a9a9a"}
169 source: "images/close.png"
170 width: 32; height: 32
171 anchors.centerIn: parent
175 id: closeButtonMouseArea
177 onClicked: titleBar.closeClicked();
181 name: "pressed"; when: closeButtonMouseArea.pressed
182 PropertyChanges { target: closeButtonArea; color: "#9a9a9a"}
196 source: "images/back.png"
197 width: 32; height: 32
198 anchors.centerIn: parent
201 id: backButtonMouseArea
203 onClicked: titleBar.backClicked();
207 name: "pressed"; when: backButtonMouseArea.pressed
208 PropertyChanges { target: backButtonArea; color: "#9a9a9a"}
223 height: parent.height
224 anchors.right: parent.right
225 sourceComponent: buttonType == "Config" ? configButton : (buttonType == "Close"? closeButton: (buttonType == "Back"? backButton:blankComponent))