diff --git a/qgcresources.qrc b/qgcresources.qrc index 9cd9d8e411b15641b380bd8cdb70d76e2fe29f08..7d47bf524be0809f231f1cbb0349ed98b526c9aa 100644 --- a/qgcresources.qrc +++ b/qgcresources.qrc @@ -101,16 +101,18 @@ - resources/Play.svg - resources/Pause.svg - resources/Stop.svg - resources/Antenna_T.svg resources/Antenna_RC.svg - resources/SplashScreen.png - resources/QGroundControlConnect.svg - resources/PowerButton.svg + resources/Antenna_T.svg resources/buttonLeft.svg resources/buttonRight.svg + resources/JoystickBezel.png + resources/JoystickBezelLight.png + resources/Pause.svg + resources/Play.svg + resources/PowerButton.svg + resources/QGroundControlConnect.svg + resources/SplashScreen.png + resources/Stop.svg resources/XDelete.svg resources/XDeleteBlack.svg diff --git a/resources/JoystickBezel.png b/resources/JoystickBezel.png new file mode 100644 index 0000000000000000000000000000000000000000..45a775cb633dc71e59528516daa329e7383715cd Binary files /dev/null and b/resources/JoystickBezel.png differ diff --git a/resources/JoystickBezelLight.png b/resources/JoystickBezelLight.png new file mode 100644 index 0000000000000000000000000000000000000000..c22d1d6c25a5d1bbb39576ecff319dbff03623d6 Binary files /dev/null and b/resources/JoystickBezelLight.png differ diff --git a/src/FlightDisplay/FlightDisplayView.qml b/src/FlightDisplay/FlightDisplayView.qml index c7a0d23c5a9e1f64f456b53d34860f15884da2fa..36cd02325364f8c31820f466d06f82d2732fc61f 100644 --- a/src/FlightDisplay/FlightDisplayView.qml +++ b/src/FlightDisplay/FlightDisplayView.qml @@ -128,7 +128,7 @@ Item { } //-- PIP Window - Rectangle { + Item { id: pip visible: _controller.hasVideo && _isPipVisible anchors.margins: ScreenTools.defaultFontPixelHeight @@ -136,8 +136,6 @@ Item { anchors.bottom: parent.bottom width: _pipSize height: _pipSize * (9/16) - color: "#000010" - border.color: isBackgroundDark ? Qt.rgba(1,1,1,0.75) : Qt.rgba(0,0,0,0.75) Loader { id: pipLoader anchors.fill: parent @@ -216,15 +214,17 @@ Item { height: availableHeight } + //-- Virtual Joystick Item { id: multiTouchItem - anchors.left: parent.left - anchors.right: parent.right - anchors.bottom: parent.bottom + width: parent.width - (pip.width / 2) height: thumbAreaHeight visible: QGroundControl.virtualTabletJoystick + anchors.bottom: pip.top + anchors.bottomMargin: ScreenTools.defaultFontPixelHeight * 2 + anchors.horizontalCenter: parent.horizontalCenter - 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 } @@ -313,7 +313,6 @@ Item { interval: 10 running: QGroundControl.virtualTabletJoystick repeat: true - onTriggered: { if (_activeVehicle) { _activeVehicle.virtualTabletJoystickValue(rightStick.xAxis, rightStick.yAxis, leftStick.xAxis, leftStick.yAxis) diff --git a/src/FlightDisplay/FlightDisplayViewVideo.qml b/src/FlightDisplay/FlightDisplayViewVideo.qml index 0a5c505f7c1bf6d22d9499dcc29834d5c5e5792a..f98c0b5fa256f2249ca2f64dc87aed9bf571881e 100644 --- a/src/FlightDisplay/FlightDisplayViewVideo.qml +++ b/src/FlightDisplay/FlightDisplayViewVideo.qml @@ -39,7 +39,7 @@ Item { Rectangle { id: noVideo anchors.fill: parent - color: "black" + color: Qt.rgba(0,0,0,0.75) visible: !_controller.videoRunning QGCLabel { text: "NO VIDEO" diff --git a/src/FlightDisplay/FlightDisplayViewWidgets.qml b/src/FlightDisplay/FlightDisplayViewWidgets.qml index 85abdd70195078f9024ff24c45aef6045b50fde3..4dbcf964d7138b4ab37029c7a7ac6b70da40dab0 100644 --- a/src/FlightDisplay/FlightDisplayViewWidgets.qml +++ b/src/FlightDisplay/FlightDisplayViewWidgets.qml @@ -92,7 +92,7 @@ Item { anchors.margins: ScreenTools.defaultFontPixelHeight anchors.right: parent.right anchors.verticalCenter: parent.verticalCenter - visible: _isInstrumentVisible + visible: _isInstrumentVisible && !QGroundControl.virtualTabletJoystick size: getGadgetWidth() active: _activeVehicle != null heading: _heading @@ -109,6 +109,55 @@ Item { } } + //-- Alternate Instrument Panel + Rectangle { + visible: QGroundControl.virtualTabletJoystick + anchors.margins: ScreenTools.defaultFontPixelHeight + anchors.right: parent.right + anchors.bottom: parent.bottom + width: _pipSize + height: _pipSize * (9/16) + color: Qt.rgba(0,0,0,0.75) + Column { + id: instruments + width: parent.width + spacing: ScreenTools.defaultFontPixelSize * 0.33 + anchors.verticalCenter: parent.verticalCenter + QGCLabel { + text: "Altitude (m)" + font.pixelSize: ScreenTools.defaultFontPixelSize * 0.75 + width: parent.width + height: ScreenTools.defaultFontPixelSize * 0.75 + color: "white" + horizontalAlignment: TextEdit.AlignHCenter + } + QGCLabel { + text: _altitudeWGS84 < 10000 ? _altitudeWGS84.toFixed(1) : _altitudeWGS84.toFixed(0) + font.pixelSize: ScreenTools.defaultFontPixelSize * 1.5 + font.weight: Font.DemiBold + width: parent.width + color: "white" + horizontalAlignment: TextEdit.AlignHCenter + } + QGCLabel { + text: "Ground Speed (km/h)" + font.pixelSize: ScreenTools.defaultFontPixelSize * 0.75 + width: parent.width + height: ScreenTools.defaultFontPixelSize * 0.75 + color: "white" + horizontalAlignment: TextEdit.AlignHCenter + } + QGCLabel { + text: (_groundSpeed * 3.6).toFixed(1) + font.pixelSize: ScreenTools.defaultFontPixelSize + font.weight: Font.DemiBold + width: parent.width + color: "white" + horizontalAlignment: TextEdit.AlignHCenter + } + } + } + //-- Show (Hidden) Instrument Panel Rectangle { id: openButton @@ -118,7 +167,7 @@ Item { height: ScreenTools.defaultFontPixelSize * 2 width: ScreenTools.defaultFontPixelSize * 2 radius: ScreenTools.defaultFontPixelSize / 3 - visible: !_isInstrumentVisible + visible: !_isInstrumentVisible && !QGroundControl.virtualTabletJoystick color: isBackgroundDark ? Qt.rgba(0,0,0,0.75) : Qt.rgba(0,0,0,0.5) Image { width: parent.width * 0.75 diff --git a/src/QGCMapPalette.cc b/src/QGCMapPalette.cc index 96487f45579854cd15460dd702e92368ebb73967..d1a169f226fde285dc1dff8edffc5bac8fe14a3e 100644 --- a/src/QGCMapPalette.cc +++ b/src/QGCMapPalette.cc @@ -26,7 +26,7 @@ #include #include -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) diff --git a/src/QmlControls/JoystickThumbPad.qml b/src/QmlControls/JoystickThumbPad.qml index 2869df958bbdb2111c6cc3a240d94db162963ac6..c702c31110ad73dd2d160633d81f693c90309146 100644 --- a/src/QmlControls/JoystickThumbPad.qml +++ b/src/QmlControls/JoystickThumbPad.qml @@ -4,11 +4,8 @@ import QtQuick.Controls 1.2 import QGroundControl.Palette 1.0 import QGroundControl.ScreenTools 1.0 -Rectangle { - radius: width / 2 - border.color: mapPal.thumbJoystick - border.width: 2 - color: "transparent" +Item { + id: _joyRoot property alias lightColors: mapPal.lightColors /// true: use light colors from QGCMapPalette for drawing property var stickPosition: Qt.point(0, 0) @@ -54,6 +51,13 @@ Rectangle { } */ + Image { + anchors.fill: parent + source: lightColors ? "/res/JoystickBezel.png" : "/res/JoystickBezelLight.png" + mipmap: true + smooth: true + } + Rectangle { anchors.margins: parent.width / 4 anchors.fill: parent