3 @author: Sudheer K. <scifi1947 at gmail.com>
4 @license: GNU General Public License
11 property bool updatePending: false
12 property bool displayIcons: true
13 property bool displayNavigation: false
14 property string targetContentType: "News"
15 property int componentHeight: toolbar.height
17 signal reloadButtonClicked
18 signal downButtonClicked
19 signal upButtonClicked
20 signal newsButtonClicked
21 signal stocksButtonClicked
23 BorderImage { source: "images/toolbar.sci"; width: parent.width; height: parent.height + 14; y: -7 }
29 anchors.left: parent.left
31 visible: toolbar.displayIcons
35 source: "images/reload.png"
37 anchors.centerIn: parent
40 NumberAnimation on rotation {
41 from: 0; to: 360; running: toolbar.updatePending == true; loops: Animation.Infinite; duration: 900
46 id: reloadButtonMouseArea
49 toolbar.updatePending = true;
50 toolbar.reloadButtonClicked();
55 name: "pressed"; when: reloadButtonMouseArea.pressed
56 PropertyChanges { target: reloadButtonArea; color: "#9a9a9a"}
64 anchors.right: parent.horizontalCenter; anchors.horizontalCenterOffset: -60;
66 visible: toolbar.displayNavigation
70 source: "images/down.png"
72 anchors.verticalCenter: parent.verticalCenter
73 anchors.right: parent.right
74 anchors.rightMargin: 5
78 id: downButtonMouseArea
80 onClicked: toolbar.downButtonClicked()
84 name: "pressed"; when: downButtonMouseArea.pressed
85 PropertyChanges { target: downButtonArea; color: "#9a9a9a"}
94 anchors.left: parent.horizontalCenter; anchors.horizontalCenterOffset: 60;
96 visible: toolbar.displayNavigation
100 source: "images/up.png"
101 width: 32; height: 32
102 anchors.verticalCenter: parent.verticalCenter
103 anchors.left: parent.left
104 anchors.leftMargin: 5
108 id: upButtonMouseArea
110 onClicked: toolbar.upButtonClicked()
114 name: "pressed"; when: upButtonMouseArea.pressed
115 PropertyChanges { target: upButtonArea; color: "#9a9a9a"}
120 id: contentIconLoader
122 height: parent.height
123 anchors.right: parent.right
124 visible: toolbar.displayIcons
125 sourceComponent: targetContentType == "News"? newsButtonComponent:stocksButtonComponent
130 id: newsButtonComponent
139 source: "images/tab_news.png"
140 width: 32; height: 32
141 anchors.centerIn: parent
145 id: newsButtonMouseArea
147 onClicked: toolbar.newsButtonClicked()
151 name: "pressed"; when: newsButtonMouseArea.pressed
152 PropertyChanges { target: newsButtonArea; color: "#9a9a9a"}
158 id: stocksButtonComponent
166 source: "images/tab_stocks.png"
167 width: 32; height: 32
168 anchors.centerIn: parent
172 id: stocksButtonMouseArea
174 onClicked: toolbar.stocksButtonClicked()
178 name: "pressed"; when: stocksButtonMouseArea.pressed
179 PropertyChanges { target: stocksButtonArea; color: "#9a9a9a"}