Commit ff7c0f69 authored by Don Gagne's avatar Don Gagne

Merge pull request #3502 from DonLakeFlyer/SafetySmallScreenAPM

Safety: Small screen fixes
parents e0b483ff 811ab74e
...@@ -49,6 +49,7 @@ QGCView { ...@@ -49,6 +49,7 @@ QGCView {
property Fact _armingCheck: controller.getParameterFact(-1, "ARMING_CHECK") property Fact _armingCheck: controller.getParameterFact(-1, "ARMING_CHECK")
property real _margins: ScreenTools.defaultFontPixelHeight property real _margins: ScreenTools.defaultFontPixelHeight
property bool _showIcon: !ScreenTools.isTinyScreen
ExclusiveGroup { id: fenceActionRadioGroup } ExclusiveGroup { id: fenceActionRadioGroup }
ExclusiveGroup { id: landLoiterRadioGroup } ExclusiveGroup { id: landLoiterRadioGroup }
...@@ -61,8 +62,16 @@ QGCView { ...@@ -61,8 +62,16 @@ QGCView {
QGCFlickable { QGCFlickable {
clip: true clip: true
anchors.fill: parent anchors.fill: parent
contentHeight: armingCheckSettings.y + armingCheckSettings.height contentHeight: flowLayout.height
contentWidth: armingCheckSettings.x + armingCheckSettings.width contentWidth: flowLayout.width
Flow {
id: flowLayout
width: panel.width // parent.width doesn't work for some reason
spacing: _margins
Column {
spacing: _margins / 2
QGCLabel { QGCLabel {
id: failsafeLabel id: failsafeLabel
...@@ -72,10 +81,6 @@ QGCView { ...@@ -72,10 +81,6 @@ QGCView {
Rectangle { Rectangle {
id: failsafeSettings id: failsafeSettings
anchors.topMargin: _margins / 2
anchors.rightMargin: _margins
anchors.left: parent.left
anchors.top: failsafeLabel.bottom
width: throttleEnableCombo.x + throttleEnableCombo.width + _margins width: throttleEnableCombo.x + throttleEnableCombo.width + _margins
height: mahField.y + mahField.height + _margins height: mahField.y + mahField.height + _margins
color: palette.windowShade color: palette.windowShade
...@@ -197,23 +202,21 @@ QGCView { ...@@ -197,23 +202,21 @@ QGCView {
showUnits: true showUnits: true
} }
} // Rectangle - Failsafe Settings } // Rectangle - Failsafe Settings
} // Column - Failsafe Settings
Column {
spacing: _margins / 2
QGCLabel { QGCLabel {
id: geoFenceLabel id: geoFenceLabel
anchors.leftMargin: _margins
anchors.left: failsafeSettings.right
anchors.top: parent.top
text: qsTr("GeoFence") text: qsTr("GeoFence")
font.family: ScreenTools.demiboldFontFamily font.family: ScreenTools.demiboldFontFamily
} }
Rectangle { Rectangle {
id: geoFenceSettings id: geoFenceSettings
anchors.topMargin: _margins / 2
anchors.left: geoFenceLabel.left
anchors.top: geoFenceLabel.bottom
anchors.bottom: failsafeSettings.bottom
width: fenceAltMaxField.x + fenceAltMaxField.width + _margins width: fenceAltMaxField.x + fenceAltMaxField.width + _margins
height: fenceAltMaxField.y + fenceAltMaxField.height + _margins
color: palette.windowShade color: palette.windowShade
QGCCheckBox { QGCCheckBox {
...@@ -323,20 +326,19 @@ QGCView { ...@@ -323,20 +326,19 @@ QGCView {
showUnits: true showUnits: true
} }
} // Rectangle - GeoFence Settings } // Rectangle - GeoFence Settings
} // Column - GeoFence Settings
Column {
spacing: _margins / 2
QGCLabel { QGCLabel {
id: rtlLabel id: rtlLabel
anchors.topMargin: _margins
anchors.top: geoFenceSettings.bottom
text: qsTr("Return to Launch") text: qsTr("Return to Launch")
font.family: ScreenTools.demiboldFontFamily font.family: ScreenTools.demiboldFontFamily
} }
Rectangle { Rectangle {
id: rtlSettings id: rtlSettings
anchors.topMargin: _margins / 2
anchors.left: parent.left
anchors.top: rtlLabel.bottom
width: rltAltFinalField.x + rltAltFinalField.width + _margins width: rltAltFinalField.x + rltAltFinalField.width + _margins
height: rltAltFinalField.y + rltAltFinalField.height + _margins height: rltAltFinalField.y + rltAltFinalField.height + _margins
color: palette.windowShade color: palette.windowShade
...@@ -359,13 +361,14 @@ QGCView { ...@@ -359,13 +361,14 @@ QGCView {
anchors.fill: icon anchors.fill: icon
source: icon source: icon
color: palette.text color: palette.text
visible: _showIcon
} }
QGCRadioButton { QGCRadioButton {
id: returnAtCurrentRadio id: returnAtCurrentRadio
anchors.leftMargin: _margins anchors.margins: _margins
anchors.left: icon.right anchors.left: _showIcon ? icon.right : parent.left
anchors.top: icon.top anchors.top: parent.top
text: qsTr("Return at current altitude") text: qsTr("Return at current altitude")
checked: _rtlAltFact.value == 0 checked: _rtlAltFact.value == 0
exclusiveGroup: returnAltRadioGroup exclusiveGroup: returnAltRadioGroup
...@@ -456,33 +459,47 @@ QGCView { ...@@ -456,33 +459,47 @@ QGCView {
showUnits: true showUnits: true
} }
} // Rectangle - RTL Settings } // Rectangle - RTL Settings
} // Column - RTL Settings
Column {
spacing: _margins / 2
QGCLabel { QGCLabel {
id: armingCheckLabel
anchors.topMargin: _margins
anchors.left: parent.left
anchors.top: rtlSettings.bottom
text: qsTr("Arming Checks") text: qsTr("Arming Checks")
font.family: ScreenTools.demiboldFontFamily font.family: ScreenTools.demiboldFontFamily
} }
Rectangle { Rectangle {
id: armingCheckSettings width: flowLayout.width
anchors.topMargin: _margins / 2 height: armingCheckInnerColumn.height + (_margins * 2)
anchors.left: parent.left
anchors.top: armingCheckLabel.bottom
width: armingCheckColumn.x + armingCheckColumn.width + _margins
height: armingCheckColumn.y + armingCheckColumn.height + _margins
color: palette.windowShade color: palette.windowShade
Column { Column {
id: armingCheckColumn id: armingCheckInnerColumn
anchors.margins: _margins
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
spacing: _margins spacing: _margins
QGCLabel { text: qsTr("Be very careful when turning off arming checks. Could lead to loss of Vehicle control.") } QGCLabel {
FactBitmask { fact: _armingCheck } id: armingCheckWarning
anchors.left: parent.left
anchors.right: parent.right
wrapMode: Text.WordWrap
text: qsTr("Turning off arming checks can lead to loss of Vehicle control.")
}
FactBitmask {
id: armingCheckBitmask
anchors.left: parent.left
anchors.right: parent.right
fact: _armingCheck
} }
} }
} // Rectangle - Arming checks
} // Column - Arming Checks
} // Flow
} // QGCFlickable } // QGCFlickable
} // QGCViewPanel } // QGCViewPanel
} // QGCView } // QGCView
...@@ -46,21 +46,23 @@ QGCView { ...@@ -46,21 +46,23 @@ QGCView {
QGCFlickable { QGCFlickable {
clip: true clip: true
anchors.fill: parent anchors.fill: parent
contentHeight: rtlSettings.y + rtlSettings.height contentWidth: flowLayout.width
flickableDirection: Flickable.VerticalFlick contentHeight: flowLayout.height
Flow {
id: flowLayout
width: panel.width // parent.width doesn't work for some reason
spacing: _margins
Column {
spacing: _margins / 2
QGCLabel { QGCLabel {
id: failsafeTriggersLabel
text: qsTr("Failsafe Triggers") text: qsTr("Failsafe Triggers")
font.family: ScreenTools.demiboldFontFamily font.family: ScreenTools.demiboldFontFamily
} }
Rectangle { Rectangle {
id: failsafeTriggerSettings
anchors.topMargin: _margins / 2
anchors.rightMargin: _margins
anchors.left: parent.left
anchors.top: failsafeTriggersLabel.bottom
width: throttlePWMField.x + throttlePWMField.width + _margins width: throttlePWMField.x + throttlePWMField.width + _margins
height: gcsCheckbox.y + gcsCheckbox.height + _margins height: gcsCheckbox.y + gcsCheckbox.height + _margins
color: palette.windowShade color: palette.windowShade
...@@ -139,22 +141,19 @@ QGCView { ...@@ -139,22 +141,19 @@ QGCView {
onClicked: _failsafeGCSEnable.value = checked ? 1 : 0 onClicked: _failsafeGCSEnable.value = checked ? 1 : 0
} }
} // Rectangle - Failsafe trigger settings } // Rectangle - Failsafe trigger settings
} // Column - Failsafe trigger settings
Column {
spacing: _margins / 2
QGCLabel { QGCLabel {
id: rtlLabel
anchors.leftMargin: _margins
anchors.left: failsafeTriggerSettings.right
text: qsTr("Return to Launch") text: qsTr("Return to Launch")
font.family: ScreenTools.demiboldFontFamily font.family: ScreenTools.demiboldFontFamily
} }
Rectangle { Rectangle {
id: rtlSettings
anchors.topMargin: _margins / 2
anchors.left: rtlLabel.left
anchors.top: rtlLabel.bottom
anchors.bottom: failsafeTriggerSettings.bottom
width: rltAltField.x + rltAltField.width + _margins width: rltAltField.x + rltAltField.width + _margins
height: rltAltField.y + rltAltField.height + _margins
color: palette.windowShade color: palette.windowShade
QGCRadioButton { QGCRadioButton {
...@@ -191,6 +190,8 @@ QGCView { ...@@ -191,6 +190,8 @@ QGCView {
enabled: returnAltRadio.checked enabled: returnAltRadio.checked
} }
} // Rectangle - RTL Settings } // Rectangle - RTL Settings
} // Column - RTL Settings
} // Flow
} // QGCFlickable } // QGCFlickable
} // QGCViewPanel } // QGCViewPanel
} // QGCView } // QGCView
...@@ -6,7 +6,7 @@ import QGroundControl.Palette 1.0 ...@@ -6,7 +6,7 @@ import QGroundControl.Palette 1.0
import QGroundControl.Controls 1.0 import QGroundControl.Controls 1.0
import QGroundControl.ScreenTools 1.0 import QGroundControl.ScreenTools 1.0
Row { Flow {
spacing: ScreenTools.defaultFontPixelWidth spacing: ScreenTools.defaultFontPixelWidth
property Fact fact: Fact { } property Fact fact: Fact { }
......
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