signal clicked
property alias text: txt.text
property bool buttonEnabled: false
- radius: 5
width: Math.max(64, txt.width + 16)
height: 32
- color: buttonEnabled ? "steelblue" : "gray"
+ color: buttonEnabled ? "#76644A" : "transparent"
+ border.color: "#76644A"
+ border.width: 1
MouseArea {
anchors.fill: parent
onClicked: button.clicked()
id: button
property alias text: txt.text
property bool buttonEnabled: true
- width: txt.width + 30
+ width: 140
height: 25
spacing: 5
x: 5
- Text {
- id: txt
- text: "Close "
- color: "#76644A"
- font.pixelSize: 18
+ MouseArea {
+ id: mouse
+ anchors.fill: parent
+ onClicked: {
+ if (buttonEnabled)
+ buttonEnabled = false;
+ else
+ buttonEnabled = true;
+ }
}
Rectangle {
- width: 25
- height: 25
- radius: 5
- color: buttonEnabled ? "steelblue" : "gray"
- MouseArea {
+ id: checkbox
+ width: 23
+ height: 23
+ anchors.left: parent.left
+ border.color: "#76644A"
+ border.width: 1
+ antialiasing: true
+ radius: 2
+ color: "transparent"
+ Rectangle {
anchors.fill: parent
- onClicked: {
- if (buttonEnabled)
- buttonEnabled = false;
- else
- buttonEnabled = true;
- }
+ anchors.margins: 4
+ antialiasing: true
+ radius: 1
+ color: mouse.pressed || buttonEnabled ? "#76644A" : "transparent"
+ }
+ Text {
+ id: txt
+ anchors.left: checkbox.right
+ anchors.leftMargin: 4
+ anchors.verticalCenter: parent.verticalCenter
+ text: "Close "
+ color: "#ecc089"
+ font.pixelSize: 18
}
}
}
id: root
color: "transparent"
width: 300
- height: 45
+ height: 40
property var _monthNames: [ "JAN", "FEB", "MAR", "APR", "MAY", "JUN","JUL", "AUG", "SEP", "OCT", "NOV", "DEC" ];
property var date: new Date()
year.text = date.getFullYear();
}
Row {
- spacing: 20
+ spacing: 4
anchors.fill: parent
Rectangle {
height: root.height
width: root.width/3 - 20
color: "#272822"
- radius: 5
+ border.color: "#76644A"
+ border.width: 1
+ radius: 2
+ antialiasing: true
TextInput {
id: month
height: root.height
width: root.width/3 - 20
color: "#272822"
- radius: 5
+ border.color: "#76644A"
+ border.width: 1
+ radius: 2
+ antialiasing: true
TextInput {
id: day
height: root.height
width: root.width/3 - 20
color: "#272822"
- radius: 5
+ border.color: "#76644A"
+ border.width: 1
+ radius: 2
+ antialiasing: true
TextInput {
id: year
anchors.top: toDate.bottom
anchors.bottom: parent.bottom
renderTarget: Canvas.FramebufferObject
+ antialiasing: true
property int frames: first
property int mouseX: 0
property int mouseY: 0
property int first: 0
property int last: 0
+ property int pixelSkip: 1
+
function drawBackground(ctx) {
ctx.save();
ctx.fillStyle = "#272822";
var w = canvas.width/points.length;
var end = points.length;
- for (var i = 0; i < end; i++) {
+ for (var i = 0; i < end; i+=pixelSkip) {
var x = points[i].x;
var y = points[i][price];
y = canvas.height * y/highest;
ctx.globalAlpha = 0.4;
ctx.lineWidth = 2;
var end = points.length;
- for (var i = 0; i < end; i++) {
+ for (var i = 0; i < end; i+=pixelSkip) {
var x = points[i].x;
var open = canvas.height * points[i].open/highest - canvas.movedY;
var close = canvas.height * points[i].close/highest - canvas.movedY;
ctx.lineWidth = 1;
var end = points.length;
- for (var i = 0; i < end; i++) {
+ for (var i = 0; i < end; i+=pixelSkip) {
var x = points[i].x;
var y = points[i][price];
y = canvas.height * (1 - y/highest);
var highestVolume = stockModel.highestVolume;
console.log("highest price:" + highestPrice + ", highest volume:" + highestVolume)
var points = [];
- for (var i = 0; i <= last - first; i++) {
+ for (var i = 0; i <= last - first; i+=pixelSkip) {
var price = stockModel.get(i + first);
points.push({
x: i*canvas.width/(last-first+1),
}
}
- highlight: Image {
- height:30
- width:parent.width
- source:"images/stock-selected.png"
+ highlight: Rectangle {
+ width: parent.width
+ color: "#662"
}
}
}
anchors.left: parent.left
anchors.leftMargin: 30
anchors.top: startDateText.bottom
- anchors.topMargin: 15
+ anchors.topMargin: 8
date: new Date(1995, 3, 25)
}
anchors.left: parent.left
anchors.leftMargin: 30
anchors.top: endDateText.bottom
- anchors.topMargin: 15
+ anchors.topMargin: 8
}
Text {
Column {
id: drawOptions
anchors.top: drawOptionsText.bottom
- anchors.topMargin: 20
+ anchors.topMargin: 8
anchors.left: parent.left
anchors.leftMargin: 30
spacing: 2
CheckBox {
id: highButton
- text: "High "
+ text: "High"
buttonEnabled: false
}
CheckBox {
id: lowButton
- text: "Low "
+ text: "Low"
buttonEnabled: false
}
+ }
+ Row {
+ spacing: 10
CheckBox {
id: openButton
- text: "Open "
+ text: "Open"
buttonEnabled: false
}
- }
- Row {
- spacing: 10
CheckBox {
- text: "Close "
+ text: "Close"
id: closeButton
buttonEnabled: true
}
+
+ }
+ Row {
+ spacing: 10
CheckBox {
id: volumeButton
text: "Volume"
anchors.left: parent.left
anchors.leftMargin: 20
anchors.top: chartTypeText.bottom
- anchors.topMargin: 20
- spacing: 10
+ anchors.topMargin: 8
+ spacing: -1
Button {
id: yearView
text: "YEAR"
<file>content/images/icon-items.png</file>
<file>content/images/icon-settings.png</file>
<file>content/images/logo.png</file>
- <file>content/images/stock-selected.png</file>
<file>content/images/wheel-touch.png</file>
<file>content/images/wheel.png</file>
</qresource>