diff --git a/src/AutoPilotPlugins/PX4/FlightModesComponent.qml b/src/AutoPilotPlugins/PX4/FlightModesComponent.qml index 5178b1ca699c1c49bbad8301f4f6f66cc6e19cc1..d34f6ea2d0a5b13628c7b64bcac0b7beb4fee4f7 100644 --- a/src/AutoPilotPlugins/PX4/FlightModesComponent.qml +++ b/src/AutoPilotPlugins/PX4/FlightModesComponent.qml @@ -260,7 +260,7 @@ QGCView { thresholdValue: controller.manualModeThreshold thresholdDragEnabled: false - onModeChannelIndexChanged: controller.manualModeChannelIndex = modeChannelIndex + onModeChannelIndexSelected: controller.manualModeChannelIndex = index } ModeSwitchDisplay { @@ -308,7 +308,7 @@ QGCView { thresholdValue: controller.acroModeThreshold thresholdDragEnabled: true - onModeChannelIndexChanged: controller.acroModeChannelIndex = modeChannelIndex + onModeChannelIndexSelected: controller.acroModeChannelIndex = index onThresholdValueChanged: controller.acroModeThreshold = thresholdValue Behavior on y { PropertyAnimation { easing.type: Easing.InOutQuad; duration: 1000 } } @@ -341,7 +341,7 @@ QGCView { thresholdValue: controller.posCtlModeThreshold thresholdDragEnabled: true - onModeChannelIndexChanged: controller.posCtlModeChannelIndex = modeChannelIndex + onModeChannelIndexSelected: controller.posCtlModeChannelIndex = index onThresholdValueChanged: controller.posCtlModeThreshold = thresholdValue Behavior on y { PropertyAnimation { easing.type: Easing.InOutQuad; duration: 1000 } } @@ -374,7 +374,7 @@ QGCView { thresholdValue: controller.loiterModeThreshold thresholdDragEnabled: true - onModeChannelIndexChanged: controller.loiterModeChannelIndex = modeChannelIndex + onModeChannelIndexSelected: controller.loiterModeChannelIndex = index onThresholdValueChanged: controller.loiterModeThreshold = thresholdValue Behavior on y { PropertyAnimation { easing.type: Easing.InOutQuad; duration: 1000 } } @@ -391,7 +391,7 @@ QGCView { thresholdValue: controller.returnModeThreshold thresholdDragEnabled: true - onModeChannelIndexChanged: controller.returnModeChannelIndex = modeChannelIndex + onModeChannelIndexSelected: controller.returnModeChannelIndex = index onThresholdValueChanged: controller.returnModeThreshold = thresholdValue Behavior on y { PropertyAnimation { easing.type: Easing.InOutQuad; duration: 1000 } } @@ -408,7 +408,7 @@ QGCView { thresholdValue: controller.offboardModeThreshold thresholdDragEnabled: true - onModeChannelIndexChanged: controller.offboardModeChannelIndex = modeChannelIndex + onModeChannelIndexSelected: controller.offboardModeChannelIndex = index onThresholdValueChanged: controller.offboardModeThreshold = thresholdValue Behavior on y { PropertyAnimation { easing.type: Easing.InOutQuad; duration: 1000 } } diff --git a/src/QmlControls/ModeSwitchDisplay.qml b/src/QmlControls/ModeSwitchDisplay.qml index 126fd7b25618fd637026090938193f03b2f86c6c..376f15d36efd0a086c1a259cb3ead26322db8fe4 100644 --- a/src/QmlControls/ModeSwitchDisplay.qml +++ b/src/QmlControls/ModeSwitchDisplay.qml @@ -45,6 +45,8 @@ Rectangle { height: column.height + (ScreenTools.defaultFontPixelWidth * 2) color: _qgcPal.window + signal modeChannelIndexSelected(int index) + QGCPalette { id: _qgcPal; colorGroupEnabled: enabled } Item { @@ -82,7 +84,7 @@ Rectangle { currentIndex: modeChannelIndex enabled: modeChannelEnabled - onActivated: modeChannelIndex = index + onActivated: modeChannelIndexSelected(index) } QGCLabel {