Browse Source

Adding thumbstick bezel

QGC4.4
dogmaphobic 9 years ago
parent
commit
402b380bf8
  1. 16
      qgcresources.qrc
  2. BIN
      resources/JoystickBezel.png
  3. BIN
      resources/JoystickBezelLight.png
  4. 14
      src/QmlControls/JoystickThumbPad.qml

16
qgcresources.qrc

@ -101,16 +101,18 @@ @@ -101,16 +101,18 @@
</qresource>
<qresource prefix="/res">
<file alias="Play">resources/Play.svg</file>
<file alias="Pause">resources/Pause.svg</file>
<file alias="Stop">resources/Stop.svg</file>
<file alias="AntennaT">resources/Antenna_T.svg</file>
<file alias="AntennaRC">resources/Antenna_RC.svg</file>
<file alias="SplashScreen">resources/SplashScreen.png</file>
<file alias="QGroundControlConnect">resources/QGroundControlConnect.svg</file>
<file alias="PowerButton">resources/PowerButton.svg</file>
<file alias="AntennaT">resources/Antenna_T.svg</file>
<file alias="buttonLeft.svg">resources/buttonLeft.svg</file>
<file alias="buttonRight.svg">resources/buttonRight.svg</file>
<file alias="JoystickBezel.png">resources/JoystickBezel.png</file>
<file alias="JoystickBezelLight.png">resources/JoystickBezelLight.png</file>
<file alias="Pause">resources/Pause.svg</file>
<file alias="Play">resources/Play.svg</file>
<file alias="PowerButton">resources/PowerButton.svg</file>
<file alias="QGroundControlConnect">resources/QGroundControlConnect.svg</file>
<file alias="SplashScreen">resources/SplashScreen.png</file>
<file alias="Stop">resources/Stop.svg</file>
<file alias="XDelete.svg">resources/XDelete.svg</file>
<file alias="XDeleteBlack.svg">resources/XDeleteBlack.svg</file>
</qresource>

BIN
resources/JoystickBezel.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

BIN
resources/JoystickBezelLight.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

14
src/QmlControls/JoystickThumbPad.qml

@ -4,12 +4,8 @@ import QtQuick.Controls 1.2 @@ -4,12 +4,8 @@ import QtQuick.Controls 1.2
import QGroundControl.Palette 1.0
import QGroundControl.ScreenTools 1.0
Rectangle {
Item {
id: _joyRoot
radius: width / 2
border.color: mapPal.thumbJoystick
border.width: ScreenTools.defaultFontPixelWidth * 0.25
color: "transparent"
property alias lightColors: mapPal.lightColors /// true: use light colors from QGCMapPalette for drawing
property var stickPosition: Qt.point(0, 0)
@ -47,9 +43,11 @@ Rectangle { @@ -47,9 +43,11 @@ Rectangle {
stickPosition = Qt.point(width / 2, width / 2)
}
Column {
QGCLabel { text: xAxis }
QGCLabel { text: yAxis }
Image {
anchors.fill: parent
source: lightColors ? "/res/JoystickBezel.png" : "/res/JoystickBezelLight.png"
mipmap: true
smooth: true
}
Rectangle {

Loading…
Cancel
Save