improved the out of focus issue

master
Qiaoyong Zhong 11 years ago
parent 92243ed48b
commit d45790cee7

@ -82,6 +82,7 @@ function moveKey(event) {
cellValues[i] = v2;
}
}
event.accepted = true;
break;
case Qt.Key_Right:
for (i = 0; i < gridSize; i++) {
@ -102,6 +103,7 @@ function moveKey(event) {
cellValues[i] = v2;
}
}
event.accepted = true;
break;
case Qt.Key_Up:
for (i = 0; i < gridSize; i++) {
@ -118,6 +120,7 @@ function moveKey(event) {
}
}
}
event.accepted = true;
break;
case Qt.Key_Down:
for (i = 0; i < gridSize; i++) {
@ -139,6 +142,7 @@ function moveKey(event) {
moveMergeTilesUpDown(i, v, v2, indices, false);
}
}
event.accepted = true;
break;
}

@ -43,6 +43,7 @@ ApplicationWindow {
Item {
id: helper
focus: false
property var myColors: {"bglight": "#FAF8EF",
"bggray": Qt.rgba(238/255, 228/255, 218/255, 0.35),
"bgdark": "#BBADA0",
@ -62,6 +63,11 @@ ApplicationWindow {
focus: true
Keys.onPressed: MyScript.moveKey(event)
MouseArea {
anchors.fill: parent
onClicked: parent.forceActiveFocus()
}
Text {
id: gameName
font.family: "Sans-serif"

Loading…
Cancel
Save