Commit e26596c1 authored by Don Gagne's avatar Don Gagne

Support for default value and right-click

parent 84dda118
......@@ -25,7 +25,7 @@
/// @author Don Gagne <don@thegagnes.com>
import QtQuick 2.3
import QtQuick.Controls 1.2
import QtQuick.Controls 1.3
import QtQuick.Controls.Styles 1.2
import QGroundControl.Controls 1.0
......@@ -161,6 +161,23 @@ Rectangle {
text: modelFact.valueString + " " + modelFact.units
width: __charWidth.contentWidth * 20
height: contentHeight
color: modelFact.valueEqualsDefault ? __qgcPal.text : "orange"
Menu {
id: rightClickMenu
visible: false
MenuItem {
id: resetToDefaultMenuItem
text: "Reset to default"
enabled: modelFact.defaultValueAvailable
onTriggered: modelFact.value = modelFact.defaultValue
}
MenuItem {
text: "Set RC to Param"
onTriggered: __controller.setRCToParam(modelData)
}
}
MouseArea {
anchors.fill: parent
......@@ -171,7 +188,7 @@ Rectangle {
editor.checked = true
editor.focus = true
} else if (mouse.button == Qt.RightButton) {
__controller.setRCToParam(modelData)
rightClickMenu.popup()
}
}
}
......
......@@ -56,7 +56,7 @@ Rectangle {
id: infoLabel
width: parent.width
wrapMode: Text.WordWrap
text: "Click a parameter value to modify. Right-click to set an RC to Param mapping. Use caution when modifying parameters here since the values are not checked for validity."
text: "Click a parameter value to modify. Right-click for additional options. Values which have been modified from the default are shown in orange. Use caution when modifying parameters here since the values are not checked for validity."
}
ParameterEditor {
......
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