From 048081c4452c13faa9dc307903547c844f62b8ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20Jos=C3=A9=20Pereira?= Date: Fri, 13 Aug 2021 15:06:04 -0300 Subject: [PATCH] toolbar: JoystickIndicator: Turn joystick yellow if it's not enabled (#9823) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Patrick José Pereira --- src/ui/toolbar/JoystickIndicator.qml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/ui/toolbar/JoystickIndicator.qml b/src/ui/toolbar/JoystickIndicator.qml index 469bc8e..c280295 100644 --- a/src/ui/toolbar/JoystickIndicator.qml +++ b/src/ui/toolbar/JoystickIndicator.qml @@ -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" + } } }