Commit 16480717 authored by dogmaphobic's avatar dogmaphobic

First experiment with thumbsticks

parent 6c714562
......@@ -216,15 +216,15 @@ Item {
height: availableHeight
}
//-- Virtual Joystick
Item {
id: multiTouchItem
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: parent.bottom
width: parent.width * 0.6
height: thumbAreaHeight
visible: QGroundControl.virtualTabletJoystick
anchors.centerIn: parent
readonly property real thumbAreaHeight: parent.height / 4
readonly property real thumbAreaHeight: Math.min(parent.height * 0.25, ScreenTools.defaultFontPixelWidth * 16)
QGCMapPalette { id: mapPal; lightColors: !isBackgroundDark }
......@@ -302,7 +302,6 @@ Item {
interval: 10
running: QGroundControl.virtualTabletJoystick
repeat: true
onTriggered: {
if (_activeVehicle) {
_activeVehicle.virtualTabletJoystickValue(rightStick.xAxis, rightStick.yAxis, leftStick.xAxis, leftStick.yAxis)
......
......@@ -26,7 +26,7 @@
#include <QApplication>
#include <QPalette>
QColor QGCMapPalette::_thumbJoystick[QGCMapPalette::_cColorGroups] = { QColor("#ffffff"), QColor("#f000000") };
QColor QGCMapPalette::_thumbJoystick[QGCMapPalette::_cColorGroups] = { QColor(255,255,255,127), QColor(0,0,0,127) };
QGCMapPalette::QGCMapPalette(QObject* parent) :
QObject(parent)
......
......@@ -5,9 +5,10 @@ import QGroundControl.Palette 1.0
import QGroundControl.ScreenTools 1.0
Rectangle {
id: _joyRoot
radius: width / 2
border.color: mapPal.thumbJoystick
border.width: 2
border.width: ScreenTools.defaultFontPixelWidth * 0.25
color: "transparent"
property alias lightColors: mapPal.lightColors /// true: use light colors from QGCMapPalette for drawing
......
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