Browse Source

Merge pull request #5502 from bluerobotics/pr-limit-joystick-btns

Add joystick button limit
QGC4.4
Don Gagne 8 years ago committed by GitHub
parent
commit
c6ac209a9a
  1. 6
      src/VehicleSetup/JoystickConfig.qml

6
src/VehicleSetup/JoystickConfig.qml

@ -27,6 +27,8 @@ SetupPage { @@ -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 { @@ -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 { @@ -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

Loading…
Cancel
Save