Commit 16480717 authored by dogmaphobic's avatar dogmaphobic

First experiment with thumbsticks

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