Browse Source

toolbar: JoystickIndicator: Turn joystick yellow if it's not enabled (#9823)

Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
QGC4.4
Patrick José Pereira 4 years ago committed by GitHub
parent
commit
048081c445
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 13
      src/ui/toolbar/JoystickIndicator.qml

13
src/ui/toolbar/JoystickIndicator.qml

@ -84,7 +84,18 @@ Item { @@ -84,7 +84,18 @@ Item {
sourceSize.height: height
source: "/qmlimages/Joystick.png"
fillMode: Image.PreserveAspectFit
color: globals.activeVehicle && globals.activeVehicle.joystickEnabled && joystickManager.activeJoystick ? qgcPal.buttonText : "red"
color: {
if(globals.activeVehicle && joystickManager.activeJoystick) {
if(globals.activeVehicle.joystickEnabled) {
// Everything ready to use joystick
return qgcPal.buttonText
}
// Joystick is not enabled in the joystick configuration page
return "yellow"
}
// Joystick not available or there is no active vehicle
return "red"
}
}
}

Loading…
Cancel
Save