Commit fcf77a69 authored by Don Gagne's avatar Don Gagne

Use SetupPage as base

This also fixes scrolling
parent 86e636ab
......@@ -21,23 +21,30 @@ import QGroundControl.FactSystem 1.0
import QGroundControl.FactControls 1.0
/// Joystick Config
QGCView {
id: rootQGCView
viewPanel: panel
SetupPage {
id: joystickPage
pageComponent: pageComponent
pageName: qsTr("Joystick")
pageDescription: qsTr("Joystick Setup is used to configure a calibrate joysticks.")
QGCPalette { id: qgcPal; colorGroupEnabled: panel.enabled }
Component {
id: pageComponent
Item {
width: availableWidth
height: Math.max(leftColumn.height, rightColumn.height)
readonly property string dialogTitle: qsTr("Joystick Config")
readonly property real labelToMonitorMargin: defaultTextWidth * 3
property bool controllerCompleted: false
property bool controllerAndViewReady: false
readonly property real labelToMonitorMargin: defaultTextWidth * 3
property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle
property var _activeJoystick: joystickManager.activeJoystick
JoystickConfigController {
id: controller
factPanel: panel
factPanel: joystickPage.viewPanel
statusText: statusText
cancelButton: cancelButton
nextButton: nextButton
......@@ -45,24 +52,20 @@ QGCView {
Component.onCompleted: {
controllerCompleted = true
if (rootQGCView.completedSignalled) {
if (joystickPage.completedSignalled) {
controllerAndViewReady = true
controller.start()
}
}
}
onCompleted: {
Component.onCompleted: {
if (controllerCompleted) {
controllerAndViewReady = true
controller.start()
}
}
QGCViewPanel {
id: panel
anchors.fill: parent
// Live axis monitor control component
Component {
id: axisMonitorDisplayComponent
......@@ -123,36 +126,22 @@ QGCView {
duration: 1500
}
/*
/*
// Axis value debugger
QGCLabel {
anchors.fill: parent
text: axisValue
}
*/
*/
}
} // Component - axisMonitorDisplayComponent
// Main view Qml starts here
QGCLabel {
id: header
font.pointSize: ScreenTools.mediumFontPointSize
text: qsTr("JOYSTICK")
}
Item {
id: spacer
anchors.top: header.bottom
width: parent.width
height: 10
}
// Left side column
Column {
id: leftColumn
anchors.rightMargin: ScreenTools.defaultFontPixelWidth
anchors.top: spacer.bottom
anchors.left: parent.left
anchors.right: rightColumn.left
spacing: 10
......@@ -178,11 +167,11 @@ QGCView {
id: rollLoader
anchors.left: rollLabel.right
anchors.right: parent.right
height: rootQGCView.defaultTextHeight
height: ScreenTools.defaultFontPixelHeight
width: 100
sourceComponent: axisMonitorDisplayComponent
property real defaultTextWidth: rootQGCView.defaultTextWidth
property real defaultTextWidth: ScreenTools.defaultFontPixelWidth
property bool mapped: controller.rollAxisMapped
property bool reversed: controller.rollAxisReversed
}
......@@ -208,11 +197,11 @@ QGCView {
id: pitchLoader
anchors.left: pitchLabel.right
anchors.right: parent.right
height: rootQGCView.defaultTextHeight
height: ScreenTools.defaultFontPixelHeight
width: 100
sourceComponent: axisMonitorDisplayComponent
property real defaultTextWidth: rootQGCView.defaultTextWidth
property real defaultTextWidth: ScreenTools.defaultFontPixelWidth
property bool mapped: controller.pitchAxisMapped
property bool reversed: controller.pitchAxisReversed
}
......@@ -238,11 +227,11 @@ QGCView {
id: yawLoader
anchors.left: yawLabel.right
anchors.right: parent.right
height: rootQGCView.defaultTextHeight
height: ScreenTools.defaultFontPixelHeight
width: 100
sourceComponent: axisMonitorDisplayComponent
property real defaultTextWidth: rootQGCView.defaultTextWidth
property real defaultTextWidth: ScreenTools.defaultFontPixelWidth
property bool mapped: controller.yawAxisMapped
property bool reversed: controller.yawAxisReversed
}
......@@ -268,11 +257,11 @@ QGCView {
id: throttleLoader
anchors.left: throttleLabel.right
anchors.right: parent.right
height: rootQGCView.defaultTextHeight
height: ScreenTools.defaultFontPixelHeight
width: 100
sourceComponent: axisMonitorDisplayComponent
property real defaultTextWidth: rootQGCView.defaultTextWidth
property real defaultTextWidth: ScreenTools.defaultFontPixelWidth
property bool mapped: controller.throttleAxisMapped
property bool reversed: controller.throttleAxisReversed
}
......@@ -647,11 +636,11 @@ QGCView {
Loader {
id: theLoader
anchors.verticalCenter: axisLabel.verticalCenter
height: rootQGCView.defaultTextHeight
height: ScreenTools.defaultFontPixelHeight
width: 200
sourceComponent: axisMonitorDisplayComponent
property real defaultTextWidth: rootQGCView.defaultTextWidth
property real defaultTextWidth: ScreenTools.defaultFontPixelWidth
property bool mapped: true
readonly property bool reversed: false
}
......@@ -676,7 +665,8 @@ QGCView {
}
}
Row {
Flow {
width: parent.width
spacing: -1
Repeater {
......@@ -704,5 +694,6 @@ QGCView {
} // Row
} // Column - Axis Monitor
} // Column - Right Column
} // QGCViewPanel
}
} // Item
} // Component - pageComponent
} // SetupPage
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