Browse Source

Merge pull request #8029 from DonLakeFlyer/PX4SimpleFlightMode

PX4 Flight Mode: Rework to use sizeToContents on combos for flight mode channels
QGC4.4
Don Gagne 6 years ago committed by GitHub
parent
commit
8ce76c39dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 43
      src/AutoPilotPlugins/PX4/PX4SimpleFlightModes.qml

43
src/AutoPilotPlugins/PX4/PX4SimpleFlightModes.qml

@ -81,52 +81,49 @@ Item {
height: flightModeColumn.height + ScreenTools.defaultFontPixelHeight height: flightModeColumn.height + ScreenTools.defaultFontPixelHeight
color: qgcPal.windowShade color: qgcPal.windowShade
ColumnLayout { GridLayout {
id: flightModeColumn id: flightModeColumn
anchors.margins: ScreenTools.defaultFontPixelWidth anchors.margins: ScreenTools.defaultFontPixelWidth
anchors.left: parent.left anchors.left: parent.left
anchors.top: parent.top anchors.top: parent.top
spacing: ScreenTools.defaultFontPixelHeight rows: 7
rowSpacing: ScreenTools.defaultFontPixelWidth / 2
columnSpacing: rowSpacing
flow: GridLayout.TopToBottom
RowLayout { QGCLabel {
Layout.fillWidth: true Layout.fillWidth: true
spacing: _margins text: qsTr("Mode Channel")
}
Repeater {
model: 6
QGCLabel { QGCLabel {
Layout.fillWidth: true Layout.fillWidth: true
text: qsTr("Mode channel:") text: qsTr("Flight Mode %1").arg(modelData + 1)
color: controller.activeFlightMode == index ? "yellow" : qgcPal.text
}
} }
FactComboBox { FactComboBox {
Layout.preferredWidth: _channelComboWidth Layout.fillWidth: true
fact: controller.getParameterFact(-1, "RC_MAP_FLTMODE") fact: controller.getParameterFact(-1, "RC_MAP_FLTMODE")
indexModel: false indexModel: false
} sizeToContents: true
} }
Repeater { Repeater {
model: 6 model: 6
RowLayout {
Layout.fillWidth: true
spacing: ScreenTools.defaultFontPixelWidth
property int index: modelData + 1
QGCLabel {
Layout.fillWidth: true
text: qsTr("Flight Mode %1").arg(index)
color: controller.activeFlightMode == index ? "yellow" : qgcPal.text
}
FactComboBox { FactComboBox {
Layout.preferredWidth: _channelComboWidth Layout.fillWidth: true
fact: controller.getParameterFact(-1, "COM_FLTMODE" + index) fact: controller.getParameterFact(-1, "COM_FLTMODE" + (modelData + 1))
indexModel: false indexModel: false
sizeToContents: true
}
} }
} }
} // Repeater - Flight Modes
} // Column - Flight Modes
} // Rectangle - Flight Modes } // Rectangle - Flight Modes
} // Column - Flight mode settings } // Column - Flight mode settings

Loading…
Cancel
Save