From d5b4de2e09c5d1d5cf313c9d438576c62b1cf8af Mon Sep 17 00:00:00 2001 From: Don Gagne Date: Tue, 29 Aug 2023 11:11:32 -0700 Subject: [PATCH] Change button name when forced to buttons only --- src/VehicleSetup/SetupView.qml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/VehicleSetup/SetupView.qml b/src/VehicleSetup/SetupView.qml index 715f9b6..cd190b3 100644 --- a/src/VehicleSetup/SetupView.qml +++ b/src/VehicleSetup/SetupView.qml @@ -260,12 +260,16 @@ Rectangle { id: joystickButton imageResource: "/qmlimages/Joystick.png" setupIndicator: true - setupComplete: joystickManager.activeJoystick ? joystickManager.activeJoystick.calibrated || joystickManager.activeJoystick.axisCount == 0 : false + setupComplete: _activeJoystick ? _activeJoystick.calibrated || _buttonsOnly : false exclusiveGroup: setupButtonGroup visible: _fullParameterVehicleAvailable && joystickManager.joysticks.length !== 0 - text: qsTr("Joystick") + text: _forcedToButtonsOnly ? qsTr("Buttons") : qsTr("Joystick") Layout.fillWidth: true onClicked: showPanel(this, "JoystickConfig.qml") + + property var _activeJoystick: joystickManager.activeJoystick + property bool _buttonsOnly: _activeJoystick ? _activeJoystick.axisCount == 0 : false + property bool _forcedToButtonsOnly: !QGroundControl.corePlugin.options.allowJoystickSelection && _buttonsOnly } Repeater {