Commit 13a9a09b authored by nanthony21's avatar nanthony21 Committed by Nick Anthony

Deadband bar now turns green when it has been clicked on.

parent 4c591cfb
...@@ -86,6 +86,7 @@ SetupPage { ...@@ -86,6 +86,7 @@ SetupPage {
property int axisValue: 0 property int axisValue: 0
property int deadbandValue: 0 property int deadbandValue: 0
property bool narrowIndicator: false property bool narrowIndicator: false
property color deadbandColor: "#8c161a"
property color __barColor: qgcPal.windowShade property color __barColor: qgcPal.windowShade
...@@ -105,7 +106,7 @@ SetupPage { ...@@ -105,7 +106,7 @@ SetupPage {
x: _deadbandPosition x: _deadbandPosition
width: _deadbandWidth width: _deadbandWidth
height: parent.height / 2 height: parent.height / 2
color: "#8c161a" color: deadbandColor
visible: controller.deadbandToggle visible: controller.deadbandToggle
property real _percentDeadband: ((2 * deadbandValue) / (32768.0 * 2)) property real _percentDeadband: ((2 * deadbandValue) / (32768.0 * 2))
...@@ -801,11 +802,13 @@ SetupPage { ...@@ -801,11 +802,13 @@ SetupPage {
MouseArea { MouseArea {
id: deadbandMouseArea id: deadbandMouseArea
anchors.fill: parent.item anchors.fill: parent.item
enabled: controller.deadbandToggle
property real startY property real startY
onPressed: { onPressed: {
startY = mouseY startY = mouseY
parent.item.deadbandColor = "#3C6315"
} }
onPositionChanged: { onPositionChanged: {
var newValue = parent.item.deadbandValue + (startY - mouseY)*15 var newValue = parent.item.deadbandValue + (startY - mouseY)*15
...@@ -814,6 +817,7 @@ SetupPage { ...@@ -814,6 +817,7 @@ SetupPage {
} }
onReleased: { onReleased: {
controller.setDeadbandValue(modelData,parent.item.deadbandValue) controller.setDeadbandValue(modelData,parent.item.deadbandValue)
parent.item.deadbandColor = "#8c161a"
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment