Commit f4b237b7 authored by Don Gagne's avatar Don Gagne

Flickable works, better real estate usage

parent fc853305
...@@ -35,6 +35,8 @@ QGCView { ...@@ -35,6 +35,8 @@ QGCView {
id: rootQGCView id: rootQGCView
viewPanel: panel viewPanel: panel
property real _margins: ScreenTools.defaultFontPixelHeight
QGCPalette { id: qgcPal; colorGroupEnabled: panel.enabled } QGCPalette { id: qgcPal; colorGroupEnabled: panel.enabled }
APMFlightModesComponentController { APMFlightModesComponentController {
...@@ -47,107 +49,117 @@ QGCView { ...@@ -47,107 +49,117 @@ QGCView {
anchors.fill: parent anchors.fill: parent
Flickable { Flickable {
anchors.fill: parent anchors.fill: parent
clip: true
Column { boundsBehavior: Flickable.StopAtBounds
width: parent.width flickableDirection: Flickable.VerticalFlick
spacing: ScreenTools.defaultFontPixelHeight contentHeight: flightModeSettings.y + flightModeSettings.height
QGCLabel { QGCLabel {
text: "Channel 5 Flight Mode Settings" id: flightModeLabel
font.weight: Font.DemiBold text: "Channel 5 Flight Mode Settings"
} font.weight: Font.DemiBold
}
Rectangle {
width: parent.width Rectangle {
height: flightModeColumn.height + ScreenTools.defaultFontPixelHeight id: flightModeSettings
color: qgcPal.windowShade anchors.topMargin: _margins
anchors.top: flightModeLabel.bottom
Column { width: flightModeColumn.width + (_margins * 2)
id: flightModeColumn height: flightModeColumn.height + ScreenTools.defaultFontPixelHeight
anchors.margins: ScreenTools.defaultFontPixelWidth color: qgcPal.windowShade
anchors.left: parent.left
anchors.right: parent.right Column {
anchors.top: parent.top id: flightModeColumn
spacing: ScreenTools.defaultFontPixelHeight anchors.margins: ScreenTools.defaultFontPixelWidth
anchors.left: parent.left
Repeater { // anchors.right: parent.right
model: 6 anchors.top: parent.top
spacing: ScreenTools.defaultFontPixelHeight
Row {
spacing: ScreenTools.defaultFontPixelWidth Repeater {
model: 6
property int index: modelData + 1
property var pwmStrings: [ "PWM 0 - 1230", "PWM 1231 - 1360", "PWM 1361 - 1490", "PWM 1491 - 1620", "PWM 1621 - 1749", "PWM 1750 +"] Row {
spacing: ScreenTools.defaultFontPixelWidth
QGCLabel { property int index: modelData + 1
anchors.baseline: modeCombo.baseline property var pwmStrings: [ "PWM 0 - 1230", "PWM 1231 - 1360", "PWM 1361 - 1490", "PWM 1491 - 1620", "PWM 1621 - 1749", "PWM 1750 +"]
text: "Flight Mode " + index + ":"
color: controller.activeFlightMode == index ? qgcPal.buttonHighlight : qgcPal.text
} QGCLabel {
anchors.baseline: modeCombo.baseline
FactComboBox { text: "Flight Mode " + index + ":"
id: modeCombo color: controller.activeFlightMode == index ? qgcPal.buttonHighlight : qgcPal.text
width: ScreenTools.defaultFontPixelWidth * 15 }
fact: controller.getParameterFact(-1, "FLTMODE" + index)
indexModel: false FactComboBox {
} id: modeCombo
width: ScreenTools.defaultFontPixelWidth * 15
QGCLabel { fact: controller.getParameterFact(-1, "FLTMODE" + index)
anchors.baseline: modeCombo.baseline indexModel: false
text: pwmStrings[modelData]
}
} }
} // Repeater - Flight Modes
} // Column - Flight Modes QGCLabel {
} // Rectangle - Flight Modes anchors.baseline: modeCombo.baseline
text: pwmStrings[modelData]
QGCLabel { }
text: "Channel Options" }
font.weight: Font.DemiBold } // Repeater - Flight Modes
} } // Column - Flight Modes
} // Rectangle - Flight Modes
Rectangle {
width: parent.width QGCLabel {
height: channelOptColumn.height + ScreenTools.defaultFontPixelHeight id: channelOptionsLabel
color: qgcPal.windowShade anchors.leftMargin: _margins
anchors.top: parent.top
Column { anchors.left: flightModeSettings.right
id: channelOptColumn text: "Channel Options"
anchors.margins: ScreenTools.defaultFontPixelWidth font.weight: Font.DemiBold
anchors.left: parent.left }
anchors.right: parent.right
anchors.top: parent.top Rectangle {
spacing: ScreenTools.defaultFontPixelHeight id: channelOptionsSettings
anchors.topMargin: _margins
Repeater { anchors.top: channelOptionsLabel.bottom
model: 6 anchors.left: channelOptionsLabel.left
width: channelOptColumn.width + (_margins * 2)
Row { height: channelOptColumn.height + ScreenTools.defaultFontPixelHeight
spacing: ScreenTools.defaultFontPixelWidth color: qgcPal.windowShade
property int index: modelData + 7 Column {
id: channelOptColumn
QGCLabel { anchors.margins: ScreenTools.defaultFontPixelWidth
anchors.baseline: optCombo.baseline anchors.left: parent.left
text: "Channel option " + index + ":" anchors.top: parent.top
color: controller.channelOptionEnabled[modelData] ? qgcPal.buttonHighlight : qgcPal.text spacing: ScreenTools.defaultFontPixelHeight
Component.onCompleted: console.log(index, controller.channelOptionEnabled[modelData]) Repeater {
} model: 6
FactComboBox { Row {
id: optCombo spacing: ScreenTools.defaultFontPixelWidth
width: ScreenTools.defaultFontPixelWidth * 15
fact: controller.getParameterFact(-1, "CH" + index + "_OPT") property int index: modelData + 7
indexModel: false
} QGCLabel {
anchors.baseline: optCombo.baseline
text: "Channel option " + index + ":"
color: controller.channelOptionEnabled[modelData] ? qgcPal.buttonHighlight : qgcPal.text
Component.onCompleted: console.log(index, controller.channelOptionEnabled[modelData])
}
FactComboBox {
id: optCombo
width: ScreenTools.defaultFontPixelWidth * 15
fact: controller.getParameterFact(-1, "CH" + index + "_OPT")
indexModel: false
} }
} // Repeater -- Channel options }
} // Column - Channel options } // Repeater -- Channel options
} // Rectangle - Channel options } // Column - Channel options
} // Column } // Rectangle - Channel options
} // FLickable } // FLickable
} // QGCViewPanel } // QGCViewPanel
} // QGCView } // QGCView
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