Commit 48d07927 authored by Bruno Coudoin's avatar Bruno Coudoin
Browse files

chess, disable buttons when not visible

It was possible to click on buttons when opaque.
parent 3a1d1542
......@@ -133,7 +133,8 @@ ActivityBase {
text: qsTr("Undo");
style: GCButtonStyle {}
onClicked: Activity.undo()
opacity: items.history.length > 0 ? 1 : 0
enabled: items.history.length > 0 ? 1 : 0
opacity: enabled
Behavior on opacity {
PropertyAnimation {
easing.type: Easing.InQuad
......@@ -149,7 +150,8 @@ ActivityBase {
text: qsTr("Redo");
style: GCButtonStyle {}
onClicked: Activity.redo()
opacity: items.redo_stack.length > 0 ? 1 : 0
enabled: items.redo_stack.length > 0 ? 1 : 0
opacity: enabled
Behavior on opacity {
PropertyAnimation {
easing.type: Easing.InQuad
......@@ -163,7 +165,8 @@ ActivityBase {
height: 30 * ApplicationInfo.ratio
text: qsTr("Swap");
style: GCButtonStyle {}
opacity: items.twoPlayer
enabled: items.twoPlayer
opacity: enabled
onClicked: chessboard.swap()
}
}
......
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