Commit 578725ee authored by Denis Kuplyakov's avatar Denis Kuplyakov
Browse files

Corrected way of property binding.

Replaced references to parent properties from root of other QML
component to setting properties in parent.
parent cda4da32
......@@ -20,9 +20,9 @@ import "globals.js" as Globals
Item {
id: boardContainer
property bool isShowingLabels: parent.isBoardShowingLabels
property string chipsImagePrefix: parent.chipsImagePrefix
property int chipsAnimationTime: parent.chipsAnimationTime
property bool isShowingLabels: false
property string chipsImagePrefix: "chip_bw"
property int chipsAnimationTime: 25 * 12
signal cellClicked(int row, int column)
......@@ -42,7 +42,6 @@ Item {
cells.itemAt(row * Globals.COLUMN_COUNT + column).isLastMove = value
}
CanvasItem {
id: boardBackground
anchors.fill: parent
......@@ -85,6 +84,9 @@ Item {
height: Globals.GRID_HEIGHT_PERCENT * boardContainer.height
/ Globals.ROW_COUNT
chipImagePrefix: boardContainer.chipsImagePrefix
chipAnimationTime: boardContainer.chipsAnimationTime
onClicked: boardContainer.cellClicked(index / Globals.COLUMN_COUNT,
index % Globals.COLUMN_COUNT)
}
......
......@@ -23,8 +23,8 @@ Item {
property bool isLastMove: false
property bool isLegal: false
property bool isHint: false
property string chipImagePrefix: boardContainer.chipsImagePrefix
property int chipAnimationTime: boardContainer.chipsAnimationTime
property string chipImagePrefix: "chip_bw"
property int chipAnimationTime: 25 * 12
property string chipState: ""
CanvasItem {
......@@ -47,6 +47,9 @@ Item {
state: chipState + (isHint ? "_blinking" : "")
imagePrefix: parent.chipImagePrefix + "_"
animationTime: parent.chipAnimationTime
onClicked: cellContainer.clicked()
}
}
......@@ -21,8 +21,8 @@ Item {
id: chipContainer
property int framesCount: 12
property int currentFrame: 1
property string imagePrefix: parent.chipImagePrefix + "_"
property int animationTime: parent.chipAnimationTime
property string imagePrefix: "chip_bw_"
property int animationTime: 25 * 12
signal clicked
......
......@@ -28,7 +28,6 @@ Rectangle {
anchors.leftMargin: 5
anchors.bottomMargin: 5
color: "#111111"
opacity: 0.9
border.color: "#111111"
......
......@@ -19,8 +19,8 @@ import QtQuick 1.1
import "globals.js" as Globals
Item {
anchors.fill: parent
id: tableContainer
anchors.fill: parent
property bool isBoardShowingLabels: false
property string chipsImagePrefix: "chip_bw"
......@@ -61,6 +61,10 @@ Item {
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
isShowingLabels: parent.isBoardShowingLabels
chipsImagePrefix: parent.chipsImagePrefix
chipsAnimationTime: parent.chipsAnimationTime
onCellClicked: tableContainer.cellClicked(row, column)
}
......
Markdown is supported
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