Commit 1048dacc authored by Don Gagne's avatar Don Gagne

New QGCGroupBox control

parent 5c0dfa95
...@@ -79,6 +79,7 @@ ...@@ -79,6 +79,7 @@
<file alias="QGroundControl/Controls/QGCFlickable.qml">src/QmlControls/QGCFlickable.qml</file> <file alias="QGroundControl/Controls/QGCFlickable.qml">src/QmlControls/QGCFlickable.qml</file>
<file alias="QGroundControl/Controls/QGCFlickableHorizontalIndicator.qml">src/QmlControls/QGCFlickableHorizontalIndicator.qml</file> <file alias="QGroundControl/Controls/QGCFlickableHorizontalIndicator.qml">src/QmlControls/QGCFlickableHorizontalIndicator.qml</file>
<file alias="QGroundControl/Controls/QGCFlickableVerticalIndicator.qml">src/QmlControls/QGCFlickableVerticalIndicator.qml</file> <file alias="QGroundControl/Controls/QGCFlickableVerticalIndicator.qml">src/QmlControls/QGCFlickableVerticalIndicator.qml</file>
<file alias="QGroundControl/Controls/QGCGroupBox.qml">src/QmlControls/QGCGroupBox.qml</file>
<file alias="QGroundControl/Controls/QGCLabel.qml">src/QmlControls/QGCLabel.qml</file> <file alias="QGroundControl/Controls/QGCLabel.qml">src/QmlControls/QGCLabel.qml</file>
<file alias="QGroundControl/Controls/QGCListView.qml">src/QmlControls/QGCListView.qml</file> <file alias="QGroundControl/Controls/QGCListView.qml">src/QmlControls/QGCListView.qml</file>
<file alias="QGroundControl/Controls/QGCMapLabel.qml">src/QmlControls/QGCMapLabel.qml</file> <file alias="QGroundControl/Controls/QGCMapLabel.qml">src/QmlControls/QGCMapLabel.qml</file>
......
...@@ -7,11 +7,6 @@ ...@@ -7,11 +7,6 @@
* *
****************************************************************************/ ****************************************************************************/
/// @file
/// @brief Battery, propeller and magnetometer settings
/// @author Gus Grubba <mavlink@grubba.com>
import QtQuick 2.2 import QtQuick 2.2
import QtQuick.Controls 1.2 import QtQuick.Controls 1.2
import QtQuick.Dialogs 1.2 import QtQuick.Dialogs 1.2
...@@ -30,10 +25,14 @@ SetupPage { ...@@ -30,10 +25,14 @@ SetupPage {
Component { Component {
id: pageComponent id: pageComponent
Column { Item {
width: Math.max(availableWidth, innerColumn.width)
height: innerColumn.height
ColumnLayout {
id: innerColumn id: innerColumn
width: availableWidth anchors.horizontalCenter: parent.horizontalCenter
spacing: ScreenTools.defaultFontPixelHeight * 0.5 spacing: ScreenTools.defaultFontPixelHeight
property int textEditWidth: ScreenTools.defaultFontPixelWidth * 8 property int textEditWidth: ScreenTools.defaultFontPixelWidth * 8
...@@ -216,22 +215,12 @@ SetupPage { ...@@ -216,22 +215,12 @@ SetupPage {
} // QGCViewDialog } // QGCViewDialog
} // Component - calcAmpsPerVoltDlgComponent } // Component - calcAmpsPerVoltDlgComponent
QGCGroupBox {
QGCLabel { id: batteryGroup
text: qsTr("Battery") title: qsTr("Battery")
font.family: ScreenTools.demiboldFontFamily
}
Rectangle {
width: parent.width
height: batteryGrid.height + ScreenTools.defaultFontPixelHeight
color: qgcPal.windowShade
GridLayout { GridLayout {
id: batteryGrid id: batteryGrid
anchors.margins: ScreenTools.defaultFontPixelHeight / 2
anchors.left: parent.left
anchors.top: parent.top
columns: 5 columns: 5
columnSpacing: ScreenTools.defaultFontPixelWidth columnSpacing: ScreenTools.defaultFontPixelWidth
...@@ -356,31 +345,23 @@ SetupPage { ...@@ -356,31 +345,23 @@ SetupPage {
"Click the Calculate button for help with calculating a new value." "Click the Calculate button for help with calculating a new value."
} }
} // Grid } // Grid
} // Rectangle - Battery settings } // QGCGroupBox - Battery settings
QGCLabel { QGCGroupBox {
text: qsTr("ESC PWM Minimum and Maximum Calibration") anchors.left: batteryGroup.left
font.family: ScreenTools.demiboldFontFamily anchors.right: batteryGroup.right
} title: qsTr("ESC PWM Minimum and Maximum Calibration")
Rectangle {
width: parent.width
height: escCalColumn.height + ScreenTools.defaultFontPixelHeight
color: qgcPal.windowShade
Column { ColumnLayout {
id : escCalColumn
anchors.margins: ScreenTools.defaultFontPixelHeight / 2
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
anchors.top: parent.top
spacing: ScreenTools.defaultFontPixelWidth spacing: ScreenTools.defaultFontPixelWidth
QGCLabel { QGCLabel {
width: parent.width
color: qgcPal.warningText color: qgcPal.warningText
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
text: qsTr("WARNING: Propellers must be removed from vehicle prior to performing ESC calibration.") text: qsTr("WARNING: Propellers must be removed from vehicle prior to performing ESC calibration.")
Layout.fillWidth: true
} }
QGCLabel { QGCLabel {
...@@ -401,23 +382,14 @@ SetupPage { ...@@ -401,23 +382,14 @@ SetupPage {
checked: uavcanEnable.rawValue != 0 checked: uavcanEnable.rawValue != 0
} }
QGCLabel { QGCGroupBox {
text: qsTr("UAVCAN Bus Configuration") anchors.left: batteryGroup.left
font.family: ScreenTools.demiboldFontFamily anchors.right: batteryGroup.right
visible: showUAVCAN.checked title: qsTr("UAVCAN Bus Configuration")
}
Rectangle {
width: parent.width
height: uavCanConfigRow.height + ScreenTools.defaultFontPixelHeight
color: qgcPal.windowShade
visible: showUAVCAN.checked visible: showUAVCAN.checked
Row { Row {
id: uavCanConfigRow id: uavCanConfigRow
anchors.margins: ScreenTools.defaultFontPixelHeight / 2
anchors.left: parent.left
anchors.top: parent.top
spacing: ScreenTools.defaultFontPixelWidth spacing: ScreenTools.defaultFontPixelWidth
FactComboBox { FactComboBox {
...@@ -434,44 +406,34 @@ SetupPage { ...@@ -434,44 +406,34 @@ SetupPage {
} }
} }
QGCLabel { QGCGroupBox {
text: qsTr("UAVCAN Motor Index and Direction Assignment") anchors.left: batteryGroup.left
font.family: ScreenTools.demiboldFontFamily anchors.right: batteryGroup.right
visible: showUAVCAN.checked title: qsTr("UAVCAN Motor Index and Direction Assignment")
}
Rectangle {
width: parent.width
height: uavCanEscCalColumn.height + ScreenTools.defaultFontPixelHeight
color: qgcPal.windowShade
visible: showUAVCAN.checked visible: showUAVCAN.checked
enabled: uavcanEnabledCheckBox.checked
Column { ColumnLayout {
id: uavCanEscCalColumn
anchors.margins: ScreenTools.defaultFontPixelHeight / 2
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
anchors.top: parent.top
spacing: ScreenTools.defaultFontPixelWidth spacing: ScreenTools.defaultFontPixelWidth
QGCLabel { QGCLabel {
width: parent.width
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
color: qgcPal.warningText color: qgcPal.warningText
text: qsTr("WARNING: Propellers must be removed from vehicle prior to performing UAVCAN ESC configuration.") text: qsTr("WARNING: Propellers must be removed from vehicle prior to performing UAVCAN ESC configuration.")
Layout.fillWidth: true
} }
QGCLabel { QGCLabel {
width: parent.width
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
text: qsTr("ESC parameters will only be accessible in the editor after assignment.") text: qsTr("ESC parameters will only be accessible in the editor after assignment.")
Layout.fillWidth: true
} }
QGCLabel { QGCLabel {
width: parent.width
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
text: qsTr("Start the process, then turn each motor into its turn direction, in the order of their motor indices.") text: qsTr("Start the process, then turn each motor into its turn direction, in the order of their motor indices.")
Layout.fillWidth: true
} }
QGCButton { QGCButton {
...@@ -493,25 +455,15 @@ SetupPage { ...@@ -493,25 +455,15 @@ SetupPage {
text: qsTr("Show Advanced Settings") text: qsTr("Show Advanced Settings")
} }
QGCLabel { QGCGroupBox {
text: qsTr("Advanced Power Settings") anchors.left: batteryGroup.left
font.family: ScreenTools.demiboldFontFamily anchors.right: batteryGroup.right
visible: showAdvanced.checked title: qsTr("Advanced Power Settings")
}
Rectangle {
id: batteryRectangle
width: parent.width
height: advBatteryColumn.height + ScreenTools.defaultFontPixelHeight
color: qgcPal.windowShade
visible: showAdvanced.checked visible: showAdvanced.checked
Column { ColumnLayout {
id: advBatteryColumn
anchors.margins: ScreenTools.defaultFontPixelHeight / 2
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
anchors.top: parent.top
spacing: ScreenTools.defaultFontPixelWidth spacing: ScreenTools.defaultFontPixelWidth
Row { Row {
...@@ -531,11 +483,11 @@ SetupPage { ...@@ -531,11 +483,11 @@ SetupPage {
} }
QGCLabel { QGCLabel {
width: parent.width
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
text: qsTr("Batteries show less voltage at high throttle. Enter the difference in Volts between idle throttle and full ") + text: qsTr("Batteries show less voltage at high throttle. Enter the difference in Volts between idle throttle and full ") +
qsTr("throttle, divided by the number of battery cells. Leave at the default if unsure. ") + qsTr("throttle, divided by the number of battery cells. Leave at the default if unsure. ") +
highlightPrefix + qsTr("If this value is set too high, the battery might be deep discharged and damaged.") + highlightSuffix highlightPrefix + qsTr("If this value is set too high, the battery might be deep discharged and damaged.") + highlightSuffix
Layout.fillWidth: true
} }
Row { Row {
...@@ -549,8 +501,9 @@ SetupPage { ...@@ -549,8 +501,9 @@ SetupPage {
text: ((battNumCells.value * battLowVolt.value) - (battNumCells.value * battVoltLoadDrop.value)).toFixed(1) + qsTr(" V") text: ((battNumCells.value * battLowVolt.value) - (battNumCells.value * battVoltLoadDrop.value)).toFixed(1) + qsTr(" V")
} }
} }
}
} // Rectangle - Advanced power settings
} // Column } // Column
} // QGCGroupBox - Advanced power settings
} // Column
} // Item
} // Component } // Component
} // SetupPage } // SetupPage
/****************************************************************************
*
* (c) 2009-2016 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
*
* QGroundControl is licensed according to the terms in the file
* COPYING.md in the root of the source code directory.
*
****************************************************************************/
import QtQuick 2.2
import QtQuick.Controls 2.0
import QGroundControl.Palette 1.0
import QGroundControl.ScreenTools 1.0
GroupBox {
id: control
QGCPalette { id: qgcPal; colorGroupEnabled: enabled }
background: Rectangle {
y: control.topPadding - control.padding
width: parent.width
height: parent.height - control.topPadding + control.padding
color: qgcPal.windowShade
}
label: QGCLabel {
width: control.availableWidth
text: control.title
}
}
...@@ -31,6 +31,7 @@ QGCCheckBox 1.0 QGCCheckBox.qml ...@@ -31,6 +31,7 @@ QGCCheckBox 1.0 QGCCheckBox.qml
QGCColoredImage 1.0 QGCColoredImage.qml QGCColoredImage 1.0 QGCColoredImage.qml
QGCComboBox 1.0 QGCComboBox.qml QGCComboBox 1.0 QGCComboBox.qml
QGCFlickable 1.0 QGCFlickable.qml QGCFlickable 1.0 QGCFlickable.qml
QGCGroupBox 1.0 QGCGroupBox.qml
QGCLabel 1.0 QGCLabel.qml QGCLabel 1.0 QGCLabel.qml
QGCListView 1.0 QGCListView.qml QGCListView 1.0 QGCListView.qml
QGCMapLabel 1.0 QGCMapLabel.qml QGCMapLabel 1.0 QGCMapLabel.qml
......
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