Commit 64934b4b authored by Don Gagne's avatar Don Gagne

Merge pull request #2872 from DonLakeFlyer/SideDialog

Restructure side dialog ui to flow from top to bottom
parents 36d57743 7d72fc20
......@@ -44,6 +44,8 @@ QGCViewDialog {
ParameterEditorController { id: controller; factPanel: parent }
QGCPalette { id: qgcPal; colorGroupEnabled: true }
function accept() {
if (factCombo.visible) {
fact.enumIndex = factCombo.currentIndex
......@@ -69,7 +71,13 @@ QGCViewDialog {
//valueField.forceActiveFocus()
}
QGCFlickable {
anchors.fill: parent
contentHeight: _column.y + _column.height
flickableDirection: Flickable.VerticalFlick
Column {
id: _column
spacing: defaultTextHeight
anchors.left: parent.left
anchors.right: parent.right
......@@ -87,6 +95,9 @@ QGCViewDialog {
text: fact.longDescription
}
Row {
spacing: defaultTextWidth
QGCTextField {
id: valueField
text: validate ? validateValue : fact.valueString
......@@ -97,6 +108,19 @@ QGCViewDialog {
inputMethodHints: Qt.ImhFormattedNumbersOnly
}
QGCButton {
anchors.baseline: valueField.baseline
visible: fact.defaultValueAvailable
text: "Reset to default"
onClicked: {
fact.value = fact.defaultValue
fact.valueChanged(fact.value)
hideDialog()
}
}
}
QGCComboBox {
id: factCombo
width: valueField.width
......@@ -165,30 +189,37 @@ QGCViewDialog {
visible: false
text: "Force save (dangerous!)"
}
} // Column - Fact information
Row {
width: parent.width
spacing: ScreenTools.defaultFontPixelWidth / 2
visible: showRCToParam
QGCButton {
id: bottomButton
anchors.rightMargin: defaultTextWidth
anchors.right: rcButton.left
anchors.bottom: parent.bottom
visible: fact.defaultValueAvailable
text: "Reset to default"
Rectangle {
height: 1
width: ScreenTools.defaultFontPixelWidth * 5
color: qgcPal.text
anchors.verticalCenter: _advanced.verticalCenter
}
onClicked: {
fact.value = fact.defaultValue
fact.valueChanged(fact.value)
hideDialog()
QGCCheckBox {
id: _advanced
text: "Advanced settings"
}
Rectangle {
height: 1
width: ScreenTools.defaultFontPixelWidth * 5
color: qgcPal.text
anchors.verticalCenter: _advanced.verticalCenter
}
}
QGCButton {
id: rcButton
anchors.right: parent.right
anchors.bottom: parent.bottom
text: "Set RC to Param..."
visible: !validate && showRCToParam
visible: _advanced.checked && !validate && showRCToParam
onClicked: controller.setRCToParam(fact.name)
}
} // Column
}
} // QGCViewDialog
......@@ -60,7 +60,7 @@ QGCView {
controller.cancel()
}
QGCPalette { id: qgcPal; colorGroupEnabled: panel.enabled }
QGCPalette { id: qgcPal; colorGroupEnabled: true }
FirmwareUpgradeController {
id: controller
......@@ -131,7 +131,7 @@ QGCView {
QGCViewDialog {
anchors.fill: parent
property bool showFirmwareTypeSelection: advancedMode.checked
property bool showFirmwareTypeSelection: _advanced.checked
property bool px4Flow: controller.boardType == "PX4 Flow"
function accept() {
......@@ -232,6 +232,44 @@ QGCView {
onClicked: parent.firmwareVersionChanged(firmwareTypeList)
}
QGCComboBox {
id: vehicleTypeSelectionCombo
width: 200
visible: apmFlightStack.checked
model: controller.apmAvailableVersions
}
Row {
width: parent.width
spacing: ScreenTools.defaultFontPixelWidth / 2
visible: !px4Flow
Rectangle {
height: 1
width: ScreenTools.defaultFontPixelWidth * 5
color: qgcPal.text
anchors.verticalCenter: _advanced.verticalCenter
}
QGCCheckBox {
id: _advanced
text: "Advanced settings"
checked: px4Flow ? true : false
onClicked: {
firmwareVersionCombo.currentIndex = 0
firmwareVersionWarningLabel.visible = false
}
}
Rectangle {
height: 1
width: ScreenTools.defaultFontPixelWidth * 5
color: qgcPal.text
anchors.verticalCenter: _advanced.verticalCenter
}
}
QGCLabel {
width: parent.width
wrapMode: Text.WordWrap
......@@ -239,8 +277,6 @@ QGCView {
text: px4Flow ? "Select which version of the firmware you would like to install:" : "Select which version of the above flight stack you would like to install:"
}
Row {
spacing: 10
QGCComboBox {
id: firmwareVersionCombo
width: 200
......@@ -270,43 +306,13 @@ QGCView {
}
}
QGCComboBox {
id: vehicleTypeSelectionCombo
width: 200
visible: apmFlightStack.checked
model: controller.apmAvailableVersions
}
}
QGCLabel {
id: firmwareVersionWarningLabel
width: parent.width
wrapMode: Text.WordWrap
visible: false
}
}
QGCCheckBox {
id: advancedMode
anchors.bottom: parent.bottom
text: "Advanced mode"
checked: px4Flow ? true : false
visible: !px4Flow
onClicked: {
firmwareVersionCombo.currentIndex = 0
firmwareVersionWarningLabel.visible = false
}
}
QGCButton {
anchors.leftMargin: ScreenTools.defaultFontPixelWidth * 2
anchors.left: advancedMode.right
anchors.bottom: parent.bottom
text: "Help me pick a flight stack"
onClicked: Qt.openUrlExternally("http://pixhawk.org/choice")
visible: !px4Flow
}
} // Column
} // QGCViewDialog
} // Component - pixhawkFirmwareSelectDialog
......
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