Commit b4e541ef authored by vikram's avatar vikram
Browse files

more improvements

parent 96e97cdb
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 3.1.2, 2014-11-07T08:53:26. -->
<!-- Written by QtCreator 3.1.2, 2014-11-08T13:20:07. -->
<qtcreator>
<data>
<variable>ProjectExplorer.Project.ActiveTarget</variable>
......
......@@ -79,18 +79,19 @@ Item {
id : buttonMouseArea
anchors.fill: parent
onClicked : {
if(droppedObject !== null && droppedObject.state == "inBeaker" ) {
droppedObject.changePosition(droppedObject.x, droppedObject.y+getLiquidBottomToObjectTopHeight(liquidArea.density)-getLiquidBottomToObjectTopHeight(liqDensity))
if(liquidArea.type.toUpperCase() !== liquidText.text.toUpperCase()) {
if(droppedObject !== null && droppedObject.state == "inBeaker" ) {
droppedObject.changePosition(droppedObject.x, droppedObject.y+getLiquidBottomToObjectTopHeight(liquidArea.density)-getLiquidBottomToObjectTopHeight(liqDensity))
liquidArea.density = liqDensity
liquidArea.type = liquidText.text
if(liquidArea.color !== color){
resultsGrid.addRow(droppedObject.imgName, liquidArea.type, liquidArea.density, droppedObject.getSinkStatus(liquidArea.density))
}
}
liquidArea.density = liqDensity
liquidArea.type = liquidText.text
if(liquidArea.color !== color){
resultsGrid.addRow(droppedObject.imgName, liquidArea.type, liquidArea.density, droppedObject.getSinkStatus(liquidArea.density))
}
liquidArea.color = color
}
liquidArea.density = liqDensity
liquidArea.type = liquidText.text
liquidArea.color = color
}
}
}
......@@ -114,7 +115,7 @@ Item {
height : densityWin.liquidLevel
width : densityExperimentArea.width/2
property double density: 1
property string type: "water"
property string type: "Water"
anchors {
left : densityExperimentArea.left
......
......@@ -27,8 +27,9 @@ Item {
width: getTextWidth("Density")
text: "Density "
font.pixelSize: formulaArea.textHeight
font.bold: true
textFormat: TextEdit.AutoText
color: "black"
color: "yellow"
anchors.left: leftEmptyArea.right
anchors.top: topEmptyArea.bottom
}
......@@ -38,8 +39,9 @@ Item {
width: getTextWidth(" = ")
text: " = "
font.pixelSize: formulaArea.textHeight
font.bold: true
textFormat: TextEdit.AutoText
color: "black"
color: "yellow"
anchors {
left : densityText.right
top: topEmptyArea.bottom
......@@ -51,8 +53,9 @@ Item {
width: getTextWidth("Mass ")
text: "Mass "
font.pixelSize: formulaArea.textHeight
font.bold: true
textFormat: TextEdit.AutoText
color: "black"
color: "yellow"
anchors.left: equalText.right
anchors.top: topEmptyArea.bottom
......@@ -63,8 +66,9 @@ Item {
width: getTextWidth(" /")
text: " /"
font.pixelSize: formulaArea.textHeight
font.bold: true
textFormat: TextEdit.AutoText
color: "black"
color: "yellow"
anchors.left: massText.right
anchors.top: topEmptyArea.bottom
}
......@@ -74,8 +78,9 @@ Item {
width: getTextWidth("Volume")
text: "Volume"
font.pixelSize: formulaArea.textHeight
font.bold: true
textFormat: TextEdit.AutoText
color: "black"
color: "yellow"
anchors.left: divideText.right
anchors.top: topEmptyArea.bottom
}
......@@ -111,7 +116,7 @@ Item {
onTextChanged : {
if(densityMatching()) {
showDensityExperiment()
showDensityExperiment(true)
readOnly = true
}
}
......
......@@ -94,6 +94,7 @@ Item {
DensityWin {
id: densityArea
property int cellIndex : -1
height: thirdRowHeight
width: mainWin.width
visible: false
......@@ -181,13 +182,13 @@ Item {
function reset(force) {
if(densityArea.visible == true) {
showDensityExperiment()
showDensityExperiment(force)
}else{
showWeightVolumeExperiment(force)
}
}
function showDensityExperiment() {
function showDensityExperiment(force) {
weightArea.visible = false
volArea.visible = false
densityArea.reset()
......@@ -196,8 +197,10 @@ Item {
nextText.text = "next"
if(activeImageObject !== null) {
reCreateGridObject(activeImageObject.getCellNumber())
densityArea.cellIndex = activeImageObject.getCellNumber()
}
if(force === true)
reCreateGridObject(densityArea.cellIndex)
activeImageObject = null
}
......
......@@ -47,13 +47,19 @@ Item {
onPressed: {
if(objImgId.state == "inGrid") {
parentReset()
parentReset(false)
}
}
onReleased: {
imgText.textVisible = false
imageArea.Drag.drop()
if(imageMouseArea.drag.active == true) {
objImgId.state = "none"
imageArea.Drag.drop()
if(objImgId.state == "none") {
parentReset(true)
}
}
}
}
......@@ -135,9 +141,9 @@ Item {
function getSinkStatus(liquidDensity) {
if(getSubMergedHeight(liquidDensity) < height) {
return "float"
return "Float"
}else{
return "sinks"
return "Sinks"
}
}
function getCellNumber() {
......@@ -169,8 +175,8 @@ Item {
}
function parentReset() {
objImgId.parent.parentReset()
function parentReset(force) {
objImgId.parent.parentReset(force)
}
function reset() {
......
......@@ -15,13 +15,6 @@ Item {
id : objList
}
Rectangle {
border.color : "yellow"
border.width: 3
color : "#49BAB6"
z: 0
}
Grid {
id : objGrid
rows: 1
......@@ -52,8 +45,8 @@ Item {
)
}
}
function parentReset() {
objGrid.parent.parentReset()
function parentReset(force) {
objGrid.parent.parentReset(force)
}
function getNewObject(qmlDynamicObj) {
......@@ -64,7 +57,7 @@ Item {
}
}
function parentReset() {
reset(false)
function parentReset(force) {
reset(force)
}
}
......@@ -87,7 +87,7 @@ Flickable {
DropArea {
id : dropArea
width : cylinderArea.width
width : cylinderArea.width * 0.6
height : cylinderArea.height
anchors {
left : cylinderArea.left
......@@ -130,6 +130,10 @@ Flickable {
}
}
function getActiveObject() {
return droppedObject;
}
function reset() {
volumeText.text = "00.00"
increasePointHt = 0
......
......@@ -71,6 +71,10 @@ Item {
}
function getActiveObject() {
return droppedObject;
}
function reset() {
weightText.text = "00.00"
droppedObject = null
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment