Commit 76077ac5 authored by Don Gagne's avatar Don Gagne

Merge pull request #1970 from DonLakeFlyer/Tablet

Tablet usability fixes
parents 696643ab e5a698a7
...@@ -104,253 +104,260 @@ QGCView { ...@@ -104,253 +104,260 @@ QGCView {
id: panel id: panel
anchors.fill: parent anchors.fill: parent
Flickable {
anchors.fill: parent
flickableDirection: Flickable.VerticalFlick
contentHeight: innerColumn.height
Column {
id: innerColumn
anchors.left: parent.left
anchors.right: parent.right
spacing: ScreenTools.defaultFontPixelHeight
QGCLabel {
text: "POWER CONFIG"
font.pixelSize: ScreenTools.largeFontPixelSize
}
Column { QGCLabel {
anchors.fill: parent text: "Battery"
spacing: ScreenTools.defaultFontPixelHeight font.pixelSize: ScreenTools.mediumFontPixelSize
}
QGCLabel {
text: "POWER CONFIG"
font.pixelSize: ScreenTools.largeFontPixelSize
}
QGCLabel { Rectangle {
text: "Battery" width: parent.width
font.pixelSize: ScreenTools.mediumFontPixelSize height: voltageCol.height + ScreenTools.defaultFontPixelHeight
} color: palette.windowShade
Rectangle { Column {
width: parent.width id: voltageCol
height: voltageCol.height + ScreenTools.defaultFontPixelHeight anchors.margins: ScreenTools.defaultFontPixelHeight / 2
color: palette.windowShade anchors.left: parent.left
anchors.top: parent.top
spacing: ScreenTools.defaultFontPixelHeight / 2
Column { property real firstColumnWidth: Math.max(Math.max(cellsLabel.contentWidth, battHighLabel.contentWidth), battLowLabel.contentWidth) + ScreenTools.defaultFontPixelWidth
id: voltageCol
anchors.margins: ScreenTools.defaultFontPixelHeight / 2
anchors.left: parent.left
anchors.top: parent.top
spacing: ScreenTools.defaultFontPixelHeight / 2
property real firstColumnWidth: Math.max(Math.max(cellsLabel.contentWidth, battHighLabel.contentWidth), battLowLabel.contentWidth) + ScreenTools.defaultFontPixelWidth Row {
spacing: ScreenTools.defaultFontPixelWidth
Row { QGCLabel {
spacing: ScreenTools.defaultFontPixelWidth id: cellsLabel
text: "Number of Cells (in Series)"
anchors.baseline: cellsField.baseline
}
QGCLabel { FactTextField {
id: cellsLabel id: cellsField
text: "Number of Cells (in Series)" x: voltageCol.firstColumnWidth
anchors.baseline: cellsField.baseline width: textEditWidth
fact: battNumCells
showUnits: true
}
} }
FactTextField { Row {
id: cellsField spacing: ScreenTools.defaultFontPixelWidth
x: voltageCol.firstColumnWidth
width: textEditWidth QGCLabel {
fact: battNumCells id: battHighLabel
showUnits: true text: "Full Voltage (per cell)"
anchors.baseline: battHighField.baseline
}
FactTextField {
id: battHighField
x: voltageCol.firstColumnWidth
width: textEditWidth
fact: battHighVolt
showUnits: true
}
} }
}
Row { Row {
spacing: ScreenTools.defaultFontPixelWidth spacing: ScreenTools.defaultFontPixelWidth
QGCLabel { QGCLabel {
id: battHighLabel id: battLowLabel
text: "Full Voltage (per cell)" text: "Empty Voltage (per cell)"
anchors.baseline: battHighField.baseline anchors.baseline: battLowField.baseline
} }
FactTextField { FactTextField {
id: battHighField id: battLowField
x: voltageCol.firstColumnWidth x: voltageCol.firstColumnWidth
width: textEditWidth width: textEditWidth
fact: battHighVolt fact: battLowVolt
showUnits: true showUnits: true
}
} }
} // Column
QGCColoredImage {
id: batteryImage
anchors.verticalCenter: voltageCol.verticalCenter
x: voltageCol.firstColumnWidth + textEditWidth + (ScreenTools.defaultFontPixelWidth * 3)
width: height * 0.75
height: voltageCol.height
fillMode: Image.PreserveAspectFit
smooth: true
color: palette.button
cache: false
source: getBatteryImage();
} }
Row { Column {
spacing: ScreenTools.defaultFontPixelWidth anchors.leftMargin: ScreenTools.defaultFontPixelWidth * 2
anchors.left: batteryImage.right
anchors.verticalCenter: voltageCol.verticalCenter
spacing: ScreenTools.defaultFontPixelHeight
QGCLabel { QGCLabel {
id: battLowLabel text: "Battery Max: " + (battNumCells.value * battHighVolt.value).toFixed(1) + ' V'
text: "Empty Voltage (per cell)"
anchors.baseline: battLowField.baseline
} }
FactTextField { QGCLabel {
id: battLowField text: "Battery Min: " + (battNumCells.value * battLowVolt.value).toFixed(1) + ' V'
x: voltageCol.firstColumnWidth
width: textEditWidth
fact: battLowVolt
showUnits: true
} }
} }
} // Column } // Rectangle - Battery settings
QGCColoredImage { QGCLabel {
id: batteryImage text: "ESC Calibration"
anchors.verticalCenter: voltageCol.verticalCenter font.pixelSize: ScreenTools.mediumFontPixelSize
x: voltageCol.firstColumnWidth + textEditWidth + (ScreenTools.defaultFontPixelWidth * 3)
width: height * 0.75
height: voltageCol.height
fillMode: Image.PreserveAspectFit
smooth: true
color: palette.button
cache: false
source: getBatteryImage();
} }
Column { Rectangle {
anchors.leftMargin: ScreenTools.defaultFontPixelWidth * 2 width: parent.width
anchors.left: batteryImage.right height: escCalColumn.height + ScreenTools.defaultFontPixelHeight
anchors.verticalCenter: voltageCol.verticalCenter color: palette.windowShade
spacing: ScreenTools.defaultFontPixelHeight
QGCLabel { Column {
text: "Battery Max: " + (battNumCells.value * battHighVolt.value).toFixed(1) + ' V' id : escCalColumn
} anchors.margins: ScreenTools.defaultFontPixelHeight / 2
anchors.left: parent.left
anchors.top: parent.top
spacing: ScreenTools.defaultFontPixelWidth
QGCLabel { QGCLabel {
text: "Battery Min: " + (battNumCells.value * battLowVolt.value).toFixed(1) + ' V' color: palette.warningText
} text: "<font color=\"yellow\">WARNING: Propellers must be removed from vehicle prior to performing ESC calibration.</font>"
} }
} // Rectangle - Battery settings
QGCLabel {
text: "ESC Calibration"
font.pixelSize: ScreenTools.mediumFontPixelSize
}
Rectangle {
width: parent.width
height: escCalColumn.height + ScreenTools.defaultFontPixelHeight
color: palette.windowShade
Column {
id : escCalColumn
anchors.margins: ScreenTools.defaultFontPixelHeight / 2
anchors.left: parent.left
anchors.top: parent.top
spacing: ScreenTools.defaultFontPixelWidth
QGCLabel {
color: palette.warningText
text: "<font color=\"yellow\">WARNING: Propellers must be removed from vehicle prior to performing ESC calibration.</font>"
}
QGCLabel { QGCLabel {
text: "You must use USB connection for this operation." text: "You must use USB connection for this operation."
} }
QGCButton { QGCButton {
text: "Calibrate" text: "Calibrate"
onClicked: controller.calibrateEsc() onClicked: controller.calibrateEsc()
}
} }
} }
}
QGCLabel {
text: "UAVCAN ESC Configuration"
font.pixelSize: ScreenTools.mediumFontPixelSize
}
Rectangle {
width: parent.width
height: uavCanEscCalColumn.height + ScreenTools.defaultFontPixelHeight
color: palette.windowShade
Column {
id: uavCanEscCalColumn
anchors.margins: ScreenTools.defaultFontPixelHeight / 2
anchors.left: parent.left
anchors.top: parent.top
spacing: ScreenTools.defaultFontPixelWidth
QGCLabel {
color: palette.warningText
text: "<font color=\"yellow\">WARNING: Propellers must be removed from vehicle prior to performing UAVCAN ESC configuration.</font>"
}
QGCLabel { QGCLabel {
text: "You must use USB connection for this operation." text: "UAVCAN ESC Configuration"
} font.pixelSize: ScreenTools.mediumFontPixelSize
}
QGCButton { Rectangle {
text: "Start Configuration" width: parent.width
onClicked: controller.busConfigureActuators() height: uavCanEscCalColumn.height + ScreenTools.defaultFontPixelHeight
} color: palette.windowShade
QGCButton { Column {
text: "End Configuration" id: uavCanEscCalColumn
onClicked: controller.StopBusConfigureActuators() anchors.margins: ScreenTools.defaultFontPixelHeight / 2
} anchors.left: parent.left
} anchors.top: parent.top
} spacing: ScreenTools.defaultFontPixelWidth
QGCCheckBox {
id: showAdvanced
text: "Show Advanced Settings"
}
QGCLabel {
text: "Advanced Power Settings"
font.pixelSize: ScreenTools.mediumFontPixelSize
visible: showAdvanced.checked
}
Rectangle {
id: batteryRectangle
width: parent.width
height: advBatteryColumn.height + ScreenTools.defaultFontPixelHeight
color: palette.windowShade
visible: showAdvanced.checked
Column {
id: advBatteryColumn
anchors.margins: ScreenTools.defaultFontPixelHeight / 2
anchors.left: parent.left
anchors.right: parent.right
anchors.top: parent.top
spacing: ScreenTools.defaultFontPixelWidth
Row {
spacing: ScreenTools.defaultFontPixelWidth
QGCLabel { QGCLabel {
text: "Voltage Drop on Full Load (per cell)" color: palette.warningText
anchors.baseline: battDropField.baseline text: "<font color=\"yellow\">WARNING: Propellers must be removed from vehicle prior to performing UAVCAN ESC configuration.</font>"
} }
FactTextField { QGCLabel {
id: battDropField text: "You must use USB connection for this operation."
width: textEditWidth
fact: battVoltLoadDrop
showUnits: true
} }
}
QGCLabel { QGCButton {
width: parent.width text: "Start Configuration"
wrapMode: Text.WordWrap onClicked: controller.busConfigureActuators()
text: "Batteries show less voltage at high throttle. Enter the difference in Volts between idle throttle and full " + }
"throttle, divided by the number of battery cells. Leave at the default if unsure. " +
"<font color=\"yellow\">If this value is set too high, the battery might be deep discharged and damaged.</font>" QGCButton {
text: "End Configuration"
onClicked: controller.StopBusConfigureActuators()
}
} }
}
Row { QGCCheckBox {
spacing: ScreenTools.defaultFontPixelWidth id: showAdvanced
text: "Show Advanced Settings"
}
QGCLabel { QGCLabel {
text: "Compensated Minimum Voltage:" text: "Advanced Power Settings"
font.pixelSize: ScreenTools.mediumFontPixelSize
visible: showAdvanced.checked
}
Rectangle {
id: batteryRectangle
width: parent.width
height: advBatteryColumn.height + ScreenTools.defaultFontPixelHeight
color: palette.windowShade
visible: showAdvanced.checked
Column {
id: advBatteryColumn
anchors.margins: ScreenTools.defaultFontPixelHeight / 2
anchors.left: parent.left
anchors.right: parent.right
anchors.top: parent.top
spacing: ScreenTools.defaultFontPixelWidth
Row {
spacing: ScreenTools.defaultFontPixelWidth
QGCLabel {
text: "Voltage Drop on Full Load (per cell)"
anchors.baseline: battDropField.baseline
}
FactTextField {
id: battDropField
width: textEditWidth
fact: battVoltLoadDrop
showUnits: true
}
} }
QGCLabel { QGCLabel {
text: ((battNumCells.value * battLowVolt.value) - (battNumCells.value * battVoltLoadDrop.value)).toFixed(1) + ' V' width: parent.width
wrapMode: Text.WordWrap
text: "Batteries show less voltage at high throttle. Enter the difference in Volts between idle throttle and full " +
"throttle, divided by the number of battery cells. Leave at the default if unsure. " +
"<font color=\"yellow\">If this value is set too high, the battery might be deep discharged and damaged.</font>"
}
Row {
spacing: ScreenTools.defaultFontPixelWidth
QGCLabel {
text: "Compensated Minimum Voltage:"
}
QGCLabel {
text: ((battNumCells.value * battLowVolt.value) - (battNumCells.value * battVoltLoadDrop.value)).toFixed(1) + ' V'
}
} }
} }
} } // Rectangle - Advanced power settings
} // Rectangle - Advanced power settings } // Column
} // Column } // Flickable
} // QGCViewPanel } // QGCViewPanel
} // QGCView } // QGCView
...@@ -108,7 +108,7 @@ QGCView { ...@@ -108,7 +108,7 @@ QGCView {
Rectangle { Rectangle {
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
width: parent.width / 3 width: parent.width * 0.75
height: syncNeededText.height + (ScreenTools.defaultFontPixelWidth * 2) height: syncNeededText.height + (ScreenTools.defaultFontPixelWidth * 2)
border.width: 1 border.width: 1
border.color: "white" border.color: "white"
......
...@@ -64,7 +64,7 @@ Button { ...@@ -64,7 +64,7 @@ Button {
background: Item { background: Item {
property bool down: control.pressed || (control.checkable && control.checked) property bool down: control.pressed || (control.checkable && control.checked)
implicitWidth: Math.round(TextSingleton.implicitHeight * 4.5) implicitWidth: Math.round(TextSingleton.implicitHeight * 4.5)
implicitHeight: Math.max(25, Math.round(TextSingleton.implicitHeight * 1.2)) implicitHeight: ScreenTools.isMobile ? ScreenTools.defaultFontPixelHeight * 3 * 0.75 : Math.max(25, Math.round(TextSingleton.implicitHeight * 1.2))
Rectangle { Rectangle {
anchors.fill: parent anchors.fill: parent
......
...@@ -11,7 +11,7 @@ CheckBox { ...@@ -11,7 +11,7 @@ CheckBox {
style: CheckBoxStyle { style: CheckBoxStyle {
label: Item { label: Item {
implicitWidth: text.implicitWidth + 2 implicitWidth: text.implicitWidth + 2
implicitHeight: text.implicitHeight implicitHeight: ScreenTools.isMobile ? ScreenTools.defaultFontPixelHeight * 3 * 0.75 : text.implicitHeight
baselineOffset: text.baselineOffset baselineOffset: text.baselineOffset
Rectangle { Rectangle {
anchors.fill: text anchors.fill: text
......
...@@ -18,7 +18,7 @@ ComboBox { ...@@ -18,7 +18,7 @@ ComboBox {
background: Item { background: Item {
implicitWidth: Math.round(TextSingleton.implicitHeight * 4.5) implicitWidth: Math.round(TextSingleton.implicitHeight * 4.5)
implicitHeight: Math.max(25, Math.round(TextSingleton.implicitHeight * 1.2)) implicitHeight: ScreenTools.isMobile ? ScreenTools.defaultFontPixelHeight * 3 * 0.75 : Math.max(25, Math.round(TextSingleton.implicitHeight * 1.2))
Rectangle { Rectangle {
anchors.fill: parent anchors.fill: parent
......
...@@ -11,7 +11,7 @@ RadioButton { ...@@ -11,7 +11,7 @@ RadioButton {
style: RadioButtonStyle { style: RadioButtonStyle {
label: Item { label: Item {
implicitWidth: text.implicitWidth + 2 implicitWidth: text.implicitWidth + 2
implicitHeight: text.implicitHeight implicitHeight: ScreenTools.isMobile ? ScreenTools.defaultFontPixelHeight * 3 * 0.75 : text.implicitHeight
baselineOffset: text.y + text.baselineOffset baselineOffset: text.y + text.baselineOffset
Rectangle { Rectangle {
anchors.fill: text anchors.fill: text
......
...@@ -12,6 +12,7 @@ TextField { ...@@ -12,6 +12,7 @@ TextField {
property var __qgcPal: QGCPalette { colorGroupEnabled: enabled } property var __qgcPal: QGCPalette { colorGroupEnabled: enabled }
textColor: __qgcPal.textFieldText textColor: __qgcPal.textFieldText
height: ScreenTools.isMobile ? ScreenTools.defaultFontPixelHeight * 3 * 0.75 : implicitHeight
Label { Label {
id: unitsLabelWidthGenerator id: unitsLabelWidthGenerator
......
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