From fce8e089f35acdb359cc7398e9e01a1545c4f92a Mon Sep 17 00:00:00 2001 From: dheideman Date: Wed, 26 Jul 2017 09:19:39 -0700 Subject: [PATCH] Add joystick button limit --- src/VehicleSetup/JoystickConfig.qml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/VehicleSetup/JoystickConfig.qml b/src/VehicleSetup/JoystickConfig.qml index 467bde2e381..75c9c58f0e2 100644 --- a/src/VehicleSetup/JoystickConfig.qml +++ b/src/VehicleSetup/JoystickConfig.qml @@ -27,6 +27,8 @@ SetupPage { pageName: qsTr("Joystick") pageDescription: qsTr("Joystick Setup is used to configure a calibrate joysticks.") + readonly property real _maxButtons: 16 + Connections { target: joystickManager onAvailableJoysticksChanged: { @@ -560,7 +562,7 @@ SetupPage { Repeater { id: buttonActionRepeater - model: _activeJoystick ? _activeJoystick.totalButtonCount : 0 + model: _activeJoystick ? Math.min(_activeJoystick.totalButtonCount, _maxButtons) : 0 Row { spacing: ScreenTools.defaultFontPixelWidth @@ -627,7 +629,7 @@ SetupPage { Repeater { id: jsButtonActionRepeater - model: _activeJoystick ? _activeJoystick.totalButtonCount : 0 + model: _activeJoystick ? Math.min(_activeJoystick.totalButtonCount, _maxButtons) : 0 Row { spacing: ScreenTools.defaultFontPixelWidth