Initial Release
[marketstoday] / src / qml / StockQuoteDelegate.qml
1 /*
2 @version: 0.1
3 @author: Sudheer K. <scifi1947 at gmail.com>
4 @license: GNU General Public License
5 */
6
7 import Qt 4.7
8
9 Component {
10     Item {
11         id: wrapper; width: wrapper.PathView.view.width; height: 50
12         Rectangle { color: "black"; opacity: index % 2 ? 0.2 : 0.4; height: wrapper.height; width: wrapper.width; y: 1
13             Row {
14                 anchors.verticalCenter: parent.verticalCenter
15                 anchors.left: parent.left
16                 width: wrapper.PathView.view.width - 70;
17                 spacing: 5
18                 Text { text: symbol; width: parent.width * 35/100; font.pixelSize: 18; font.bold: true; elide: Text.ElideRight; color: "white"; style: Text.Raised; styleColor: "black" }
19                 Text { text: lastTradedPrice; width: parent.width * 25/100; font.pixelSize: 18; elide: Text.ElideLeft; color: "#cccccc"; style: Text.Raised; styleColor: "black" }
20                 Text { text: change; width: parent.width * 20/100; font.pixelSize: 18; elide: Text.ElideRight
21                     color: if(change >= 0){"green";} else {"red";}
22                         style: Text.Raised; styleColor: "black" }
23                 Text { text: changePercentage; width: parent.width * 20/100; font.pixelSize: 18; elide: Text.ElideRight;
24                     color: if(change >= 0){"green";} else {"red";}
25                         style: Text.Raised; styleColor: "black" }
26             }
27         }
28     }
29 }