/*
-@version: 0.4
+@version: 0.5
@author: Sudheer K. <scifi1947 at gmail.com>
@license: GNU General Public License
*/
id: stockDetailsScreen
property int componentWidth: width
- property int itemHeight: 50
+ property int itemHeight: 75
+ property int newsItemHeight: 50
+ property int fontSizeMed: 24
+ property int fontSizeSmall: 20
property string symbol: "YHOO"
property string stockName: ""
property string lastTradedPrice: ""
id: stockNewsDelegate
Item {
- id: newsWrapper; width: stockDetailsLoader.width; height: itemHeight
+ id: newsWrapper; width: stockDetailsLoader.width; height: newsItemHeight
Item {
anchors.fill: parent
Rectangle { color: "black"; opacity: index % 2 ? 0.2 : 0.4; height: newsWrapper.height - 2; width: newsWrapper.width; y: 1 }
Text {
anchors {verticalCenter: parent.verticalCenter;left: parent.left;leftMargin: 10;right: parent.right}
- text: title; font.pixelSize: 14
+ text: title; font.pixelSize: stockDetailsScreen.fontSizeSmall
font.bold: false;
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignLeft
id: stockNameLabel
anchors.top: parent.top
width: parent.width
+ z: 5
anchors.horizontalCenter: parent.horizontalCenter
- height: 30
+ height: stockDetailsScreen.fontSizeMed + 15
horizontalAlignment: Text.AlignHCenter; verticalAlignment: Text.AlignVCenter
- font.pixelSize: 18; font.bold: true; elide: Text.ElideMiddle; color: "#B8B8B8"; style: Text.Raised; styleColor: "black"
+ font.pixelSize: stockDetailsScreen.fontSizeMed; font.bold: true; elide: Text.ElideMiddle; color: "#B8B8B8"; style: Text.Raised; styleColor: "black"
text: (stockName != "")? (stockName +" ("+symbol+")"):symbol
}
border.color: "#BFBFBF"
color:"#2E2E2E"
anchors {top: stockNameLabel.bottom;left: parent.left;right: parent.right}
- height: 125
+ z: 5
+ height: (stockDetailsScreen.width > stockDetailsScreen.height)? 105:155
radius: 15
Column{
id: stockDetailsColumn
- anchors {top: parent.top; left: parent.left; leftMargin: 10}
- width: parent.width
+ anchors {top: parent.top; left: parent.left; leftMargin: 10; right: parent.right; rightMargin: 10}
+ //spacing: 10
+ //width: parent.width
StockDetailsRow{
label1: "Last Traded"
value1: lastTradedPrice
cell1Width: stockDetailsColumn.width/2
+ multilineLabel1: false
+ landscape: (stockDetailsScreen.width > stockDetailsScreen.height)
label2: "Day's Range"
value2: daysRange
cell2Width: stockDetailsColumn.width/2
+ multilineLabel2: true
}
StockDetailsRow{
label1: "Last Trade Time"
value1: lastTradedDateTime
cell1Width: stockDetailsColumn.width/2
+ multilineLabel1: true
+ landscape: (stockDetailsScreen.width > stockDetailsScreen.height)
label2: "52w Range"
value2: yearRange
cell2Width: stockDetailsColumn.width/2
+ multilineLabel2: true
}
StockDetailsRow{
label1: "Change"
value1: ((change != "" && changePercentage != "")? change + " ("+changePercentage+")":"")
cell1Width: stockDetailsColumn.width/2
+ landscape: (stockDetailsScreen.width > stockDetailsScreen.height)
label2: "Volume"
value2: marketVolume
label1: "Prev. Close"
value1: prevClose
cell1Width: stockDetailsColumn.width/2
+ landscape: (stockDetailsScreen.width > stockDetailsScreen.height)
label2: "Market Cap"
value2: marketCap
border.color: "#BFBFBF"
color:"#2E2E2E"
width: parent.width
- anchors {top: stockDetailsSection.bottom;topMargin: 5;
+ anchors {top: stockDetailsSection.bottom;topMargin: 10;
bottom: parent.bottom;
left: parent.left;
right: parent.right}
width: 130
spacing: 20
anchors {top: parent.top; topMargin: 40; bottom: parent.bottom;
- right: chartAreaLand.right;rightMargin: 10}
+ right: chartAreaLand.right;rightMargin: 60}
Row {
height: 40
Library.Button {
text: "1d"
anchors { verticalCenter: parent.verticalCenter}
- width: 50; height: 32
+ width: 75; height: 40
onClicked: loadChart("1d");
}
Library.Button {
text: "5d"
anchors { verticalCenter: parent.verticalCenter}
- width: 50; height: 32
+ width: 75; height: 40
onClicked: loadChart("5d");
}
}
Library.Button {
text: "3m"
anchors { verticalCenter: parent.verticalCenter}
- width: 50; height: 32
+ width: 75; height: 40
onClicked: loadChart("3m");
}
Library.Button {
text: "6m"
anchors { verticalCenter: parent.verticalCenter}
- width: 50; height: 32
+ width: 75; height: 40
onClicked: loadChart("6m");
}
}
Library.Button {
text: "1y"
anchors { verticalCenter: parent.verticalCenter}
- width: 50; height: 32
+ width: 75; height: 40
onClicked: loadChart("1y");
}
Library.Button {
text: "2y"
anchors { verticalCenter: parent.verticalCenter}
- width: 50; height: 32
+ width: 75; height: 40
onClicked: loadChart("2y");
}
}
Library.Button {
text: "5y"
anchors { verticalCenter: parent.verticalCenter}
- width: 50; height: 32
+ width: 75; height: 40
onClicked: loadChart("5y");
}
Library.Button {
text: "max"
anchors { verticalCenter: parent.verticalCenter}
- width: 50; height: 32
+ width: 75; height: 40
onClicked: loadChart("my");
}
}
Column {
width: 280
spacing: 20
- anchors {verticalCenter: parent.verticalCenter;verticalCenterOffset: 80; horizontalCenter: parent.horizontalCenter}
+ anchors {verticalCenter: parent.verticalCenter;verticalCenterOffset: 100; horizontalCenter: parent.horizontalCenter}
Row {
height: 40
Library.Button {
text: "1d"
anchors { verticalCenter: parent.verticalCenter}
- width: 50; height: 32
+ width: 75; height: 40
onClicked: loadChart("1d");
}
Library.Button {
text: "5d"
anchors { verticalCenter: parent.verticalCenter}
- width: 50; height: 32
+ width: 75; height: 40
onClicked: loadChart("5d");
}
Library.Button {
text: "3m"
anchors { verticalCenter: parent.verticalCenter}
- width: 50; height: 32
+ width: 75; height: 40
onClicked: loadChart("3m");
}
Library.Button {
text: "6m"
anchors { verticalCenter: parent.verticalCenter}
- width: 50; height: 32
+ width: 75; height: 40
onClicked: loadChart("6m");
}
}
Library.Button {
text: "1y"
anchors { verticalCenter: parent.verticalCenter}
- width: 50; height: 32
+ width: 75; height: 40
onClicked: loadChart("1y");
}
Library.Button {
text: "2y"
anchors { verticalCenter: parent.verticalCenter}
- width: 50; height: 32
+ width: 75; height: 40
onClicked: loadChart("2y");
}
Library.Button {
text: "5y"
anchors { verticalCenter: parent.verticalCenter}
- width: 50; height: 32
+ width: 75; height: 40
onClicked: loadChart("5y");
}
Library.Button {
text: "max"
anchors { verticalCenter: parent.verticalCenter}
- width: 50; height: 32
+ width: 75; height: 40
onClicked: loadChart("my");
}
}