summaryrefslogtreecommitdiff
path: root/qml/Square.qml
diff options
context:
space:
mode:
Diffstat (limited to 'qml/Square.qml')
-rw-r--r--qml/Square.qml8
1 files changed, 6 insertions, 2 deletions
diff --git a/qml/Square.qml b/qml/Square.qml
index 78b7a5d..b1e3e0c 100644
--- a/qml/Square.qml
+++ b/qml/Square.qml
@@ -2,17 +2,21 @@ import QtQuick 2.0
Rectangle {
property int i: 0
- property string image: ""
+ property string piece: ""
+ property string image: piece !== "" ? "images/" + piece + ".svg" : ""
+
width: page.width / 8
height: this.width
color: ((i >> 3 ^ i) & 1) == 0 ? "#e8ebef" : "#7d8796"
border.color: "yellow"
border.width: 0
+
MouseArea {
anchors.fill: parent
- onClicked: parent.border.width ^= parseInt(0.1 * parent.width)
+ onClicked: functions.select(i);
}
Image {
+ id: piece_image
sourceSize.width: parent.width
sourceSize.height: parent.height
source: image