Allow using right button or wheel to change team color qmlfrontend
authorunc0rr
Mon, 03 Nov 2014 23:36:53 +0300
branchqmlfrontend
changeset 10454 2b590e7972b1
parent 10452 03519fd9f98d
child 10456 6fd99bb73524
Allow using right button or wheel to change team color
qmlFrontend/qml/qmlFrontend/GameConfig.qml
--- a/qmlFrontend/qml/qmlFrontend/GameConfig.qml	Mon Nov 03 00:01:02 2014 +0300
+++ b/qmlFrontend/qml/qmlFrontend/GameConfig.qml	Mon Nov 03 23:36:53 2014 +0300
@@ -115,7 +115,14 @@
                     MouseArea {
                         z: 1
                         anchors.fill: parent
-                        onClicked: HWEngine.changeTeamColor(name, 1)
+                        acceptedButtons: Qt.LeftButton | Qt.RightButton
+                        onClicked: {
+                            if (mouse.button === Qt.LeftButton)
+                                HWEngine.changeTeamColor(name, 1)
+                            else if (mouse.button === Qt.RightButton)
+                                HWEngine.changeTeamColor(name, -1)
+                        }
+                        onWheel: HWEngine.changeTeamColor(name, -wheel.angleDelta.y)
                    }
                 }