Commit e1d73b08 authored by dogmaphobic's avatar dogmaphobic

Moving to point size fonts.

Android done.
parent 3f55f678
......@@ -119,7 +119,7 @@ QGCView {
anchors.left: parent.left
anchors.right: applyButton.right
text: qsTr("Please select your airframe type")
font.pixelSize: ScreenTools.mediumFontPixelSize
font.pointSize: ScreenTools.mediumFontPointSize
wrapMode: Text.WordWrap
}
......
......@@ -20,11 +20,9 @@ FactPanel {
property Fact sysIdFact: controller.getParameterFact(-1, "FRAME")
Column {
anchors.fill: parent
anchors.margins: 8
anchors.fill: parent
anchors.margins: ScreenTools.defaultFontPixelWidth
VehicleSummaryRow {
id: nameRow;
labelText: qsTr("Frame Type:")
......
......@@ -24,7 +24,7 @@ FactPanel {
Column {
anchors.fill: parent
anchors.margins: 8
anchors.margins: ScreenTools.defaultFontPixelWidth
VehicleSummaryRow {
visible: _mountTypeExists
......
......@@ -23,7 +23,7 @@ FactPanel {
Column {
anchors.fill: parent
anchors.margins: 8
anchors.margins: ScreenTools.defaultFontPixelWidth
VehicleSummaryRow {
labelText: qsTr("Flight Mode 1:")
......
......@@ -42,7 +42,7 @@ FactPanel {
Column {
anchors.fill: parent
anchors.margins: 8
anchors.margins: ScreenTools.defaultFontPixelWidth
VehicleSummaryRow {
labelText: qsTr("Battery monitor:")
......
......@@ -21,7 +21,7 @@ FactPanel {
Column {
anchors.fill: parent
anchors.margins: 8
anchors.margins: ScreenTools.defaultFontPixelWidth
VehicleSummaryRow {
labelText: qsTr("Roll:")
......
......@@ -85,7 +85,7 @@ FactPanel {
Column {
anchors.fill: parent
anchors.margins: 8
anchors.margins: ScreenTools.defaultFontPixelWidth
VehicleSummaryRow {
labelText: qsTr("Arming Checks:")
......
......@@ -24,7 +24,7 @@ FactPanel {
Column {
anchors.fill: parent
anchors.margins: 8
anchors.margins: ScreenTools.defaultFontPixelWidth
VehicleSummaryRow {
labelText: qsTr("Throttle failsafe:")
......
......@@ -64,8 +64,8 @@ QGCView {
readonly property string _badCompassCalText: "The calibration for Compass %1 appears to be poor. " +
"Check the compass position within your vehicle and re-do the calibration."
readonly property int sideBarH1PointSize: ScreenTools.mediumFontPixelSize
readonly property int mainTextH1PointSize: ScreenTools.mediumFontPixelSize // Seems to be unused
readonly property int sideBarH1PointSize: ScreenTools.mediumFontPointSize
readonly property int mainTextH1PointSize: ScreenTools.mediumFontPointSize // Seems to be unused
readonly property int rotationColumnWidth: 250
......@@ -269,7 +269,7 @@ QGCView {
Column {
QGCLabel {
font.pixelSize: sideBarH1PointSize
font.pointSize: sideBarH1PointSize
text: qsTr("Set Orientations")
}
......@@ -459,7 +459,7 @@ QGCView {
anchors.left: orientationCalArea.left
width: parent.width
wrapMode: Text.WordWrap
font.pixelSize: ScreenTools.mediumFontPixelSize
font.pointSize: ScreenTools.mediumFontPointSize
}
Flow {
......
......@@ -46,7 +46,7 @@ FactPanel {
Column {
anchors.fill: parent
anchors.margins: 8
anchors.margins: ScreenTools.defaultFontPixelWidth
VehicleSummaryRow {
labelText: qsTr("Compass 1:")
......
......@@ -41,11 +41,11 @@ QGCView {
QGCPalette { id: palette; colorGroupEnabled: panel.enabled }
property real _margins: ScreenTools.defaultFontPixelHeight
property real _middleRowWidth: ScreenTools.defaultFontPixelWidth * 22
property real _editFieldWidth: ScreenTools.defaultFontPixelWidth * 20
property real _labelWidth: ScreenTools.defaultFontPixelWidth * 12
property real _statusWidth: ScreenTools.defaultFontPixelWidth * 8
property real _smallFont: ScreenTools.smallFontPixelSize
property real _middleRowWidth: ScreenTools.defaultFontPixelWidth * 18
property real _editFieldWidth: ScreenTools.defaultFontPixelWidth * 16
property real _labelWidth: ScreenTools.defaultFontPixelWidth * 10
property real _statusWidth: ScreenTools.defaultFontPixelWidth * 6
property real _smallFont: ScreenTools.smallFontPointSize
readonly property string dialogTitle: qsTr("controller WiFi Bridge")
property int stStatus: XMLHttpRequest.UNSENT
......@@ -319,12 +319,12 @@ QGCView {
spacing: _margins
QGCLabel {
text: qsTr("Messages Received")
font.pixelSize: _smallFont
font.pointSize: _smallFont
width: _labelWidth
}
QGCLabel {
id: vpackets
font.pixelSize: _smallFont
font.pointSize: _smallFont
width: _statusWidth
horizontalAlignment: Text.AlignRight
}
......@@ -332,13 +332,13 @@ QGCView {
Row {
spacing: _margins
QGCLabel {
font.pixelSize: _smallFont
font.pointSize: _smallFont
text: qsTr("Messages Received")
width: _labelWidth
}
QGCLabel {
id: gpackets
font.pixelSize: _smallFont
font.pointSize: _smallFont
width: _statusWidth
horizontalAlignment: Text.AlignRight
}
......@@ -346,12 +346,12 @@ QGCView {
Row {
spacing: _margins
QGCLabel {
font.pixelSize: _smallFont
font.pointSize: _smallFont
text: qsTr("Messages Received")
width: _labelWidth
}
QGCLabel {
font.pixelSize: _smallFont
font.pointSize: _smallFont
text: controller.vehicle ? thisThingHasNoNumberLocaleSupport(controller.vehicle.messagesReceived) : 0
width: _statusWidth
horizontalAlignment: Text.AlignRight
......@@ -361,84 +361,84 @@ QGCView {
spacing: _margins
QGCLabel {
text: qsTr("Messages Lost")
font.pixelSize: _smallFont
font.pointSize: _smallFont
width: _labelWidth
}
QGCLabel {
id: vlost
width: _statusWidth
horizontalAlignment: Text.AlignRight
font.pixelSize: _smallFont
font.pointSize: _smallFont
}
}
Row {
spacing: _margins
QGCLabel {
text: qsTr("Messages Lost")
font.pixelSize: _smallFont
font.pointSize: _smallFont
width: _labelWidth
}
QGCLabel {
id: glost
width: _statusWidth
horizontalAlignment: Text.AlignRight
font.pixelSize: _smallFont
font.pointSize: _smallFont
}
}
Row {
spacing: _margins
QGCLabel {
text: qsTr("Messages Lost")
font.pixelSize: _smallFont
font.pointSize: _smallFont
width: _labelWidth
}
QGCLabel {
text: controller.vehicle ? thisThingHasNoNumberLocaleSupport(controller.vehicle.messagesLost) : 0
width: _statusWidth
horizontalAlignment: Text.AlignRight
font.pixelSize: _smallFont
font.pointSize: _smallFont
}
}
Row {
spacing: _margins
QGCLabel {
text: qsTr("Messages Sent")
font.pixelSize: _smallFont
font.pointSize: _smallFont
width: _labelWidth
}
QGCLabel {
id: vsent
width: _statusWidth
horizontalAlignment: Text.AlignRight
font.pixelSize: _smallFont
font.pointSize: _smallFont
}
}
Row {
spacing: _margins
QGCLabel {
text: qsTr("Messages Sent")
font.pixelSize: _smallFont
font.pointSize: _smallFont
width: _labelWidth
}
QGCLabel {
id: gsent
width: _statusWidth
horizontalAlignment: Text.AlignRight
font.pixelSize: _smallFont
font.pointSize: _smallFont
}
}
Row {
spacing: _margins
QGCLabel {
text: qsTr("Messages Sent")
font.pixelSize: _smallFont
font.pointSize: _smallFont
width: _labelWidth
}
QGCLabel {
text: controller.vehicle ? thisThingHasNoNumberLocaleSupport(controller.vehicle.messagesSent) : 0
width: _statusWidth
horizontalAlignment: Text.AlignRight
font.pixelSize: _smallFont
font.pointSize: _smallFont
}
}
}
......
......@@ -29,7 +29,7 @@ FactPanel {
Column {
anchors.fill: parent
anchors.margins: 8
anchors.margins: ScreenTools.defaultFontPixelWidth
VehicleSummaryRow {
labelText: qsTr("Firmware Version:")
valueText: esp8266.version
......
......@@ -8,9 +8,10 @@ import QGroundControl.Controllers 1.0
import QGroundControl.Palette 1.0
FactPanel {
id: panel
anchors.fill: parent
color: qgcPal.windowShadeDark
id: panel
anchors.fill: parent
anchors.margins: ScreenTools.defaultFontPixelWidth
color: qgcPal.windowShadeDark
QGCPalette { id: qgcPal; colorGroupEnabled: enabled }
AirframeComponentController { id: controller; factPanel: panel }
......@@ -21,19 +22,15 @@ FactPanel {
property bool autoStartSet: sysAutoStartFact ? (sysAutoStartFact.value !== 0) : false
Column {
anchors.fill: parent
anchors.margins: 8
anchors.fill: parent
VehicleSummaryRow {
labelText: qsTr("System ID:")
valueText: sysIdFact ? sysIdFact.valueString : ""
}
VehicleSummaryRow {
labelText: qsTr("Airframe type:")
valueText: autoStartSet ? controller.currentAirframeType : qsTr("Setup required")
}
VehicleSummaryRow {
labelText: qsTr("Vehicle:")
valueText: autoStartSet ? controller.currentVehicleName : qsTr("Setup required")
......
......@@ -45,8 +45,8 @@ QGCView {
QGCPalette { id: palette; colorGroupEnabled: enabled }
property real _margins: ScreenTools.defaultFontPixelHeight
property real _middleRowWidth: ScreenTools.defaultFontPixelWidth * 20
property real _editFieldWidth: ScreenTools.defaultFontPixelWidth * 20
property real _middleRowWidth: ScreenTools.defaultFontPixelWidth * 16
property real _editFieldWidth: ScreenTools.defaultFontPixelWidth * 16
property Fact _camTriggerMode: controller.getParameterFact(-1, "TRIG_MODE")
property Fact _camTriggerPol: controller.getParameterFact(-1, "TRIG_POLARITY", false) // Don't bitch about missing as these only exist if trigger mode is enabled
......
......@@ -22,7 +22,7 @@ FactPanel {
Column {
anchors.fill: parent
anchors.margins: 8
anchors.margins: ScreenTools.defaultFontPixelWidth
VehicleSummaryRow {
labelText: qsTr("Trigger mode:")
......
......@@ -22,7 +22,7 @@ FactPanel {
Loader {
anchors.fill: parent
anchors.margins: 8
anchors.margins: ScreenTools.defaultFontPixelWidth
sourceComponent: _simpleMode ? simple : advanced
}
......
......@@ -201,7 +201,7 @@ Item {
anchors.left: parent.left
anchors.right: buttonColumn.left
text: topHelpText
font.pixelSize: ScreenTools.defaultFontPixelSize
font.pointSize: ScreenTools.defaultFontPointSize
wrapMode: Text.WordWrap
}
......
......@@ -24,7 +24,7 @@ FactPanel {
Column {
anchors.fill: parent
anchors.margins: 8
anchors.margins: ScreenTools.defaultFontPixelWidth
VehicleSummaryRow {
labelText: qsTr("Roll:")
......
......@@ -47,7 +47,7 @@ FactPanel {
Column {
anchors.fill: parent
anchors.margins: 8
anchors.margins: ScreenTools.defaultFontPixelWidth
VehicleSummaryRow {
labelText: qsTr("Battery Full:")
......
......@@ -44,8 +44,8 @@ QGCView {
QGCPalette { id: palette; colorGroupEnabled: enabled }
property real _margins: ScreenTools.defaultFontPixelHeight
property real _middleRowWidth: ScreenTools.defaultFontPixelWidth * 24
property real _editFieldWidth: ScreenTools.defaultFontPixelWidth * 18
property real _middleRowWidth: ScreenTools.defaultFontPixelWidth * 20
property real _editFieldWidth: ScreenTools.defaultFontPixelWidth * 14
property Fact _fenceAction: controller.getParameterFact(-1, "GF_ACTION")
property Fact _fenceRadius: controller.getParameterFact(-1, "GF_MAX_HOR_DIST")
......
......@@ -24,7 +24,7 @@ FactPanel {
Column {
anchors.fill: parent
anchors.margins: 8
anchors.margins: ScreenTools.defaultFontPixelWidth
VehicleSummaryRow {
labelText: qsTr("RTL min alt:")
......
......@@ -409,7 +409,7 @@ QGCView {
anchors.left: orientationCalArea.left
width: parent.width
wrapMode: Text.WordWrap
font.pixelSize: ScreenTools.mediumFontPixelSize
font.pointSize: ScreenTools.mediumFontPointSize
}
Flow {
......
......@@ -25,7 +25,7 @@ FactPanel {
Column {
anchors.fill: parent
anchors.margins: 8
anchors.margins: ScreenTools.defaultFontPixelWidth
VehicleSummaryRow {
labelText: qsTr("Compass:")
......
......@@ -45,7 +45,7 @@ Item {
text: qsTr("NO VIDEO")
font.family: ScreenTools.demiboldFontFamily
color: "white"
font.pixelSize: _mainIsMap ? 12 * ScreenTools.fontHRatio : 20 * ScreenTools.fontHRatio
font.pointSize: _mainIsMap ? 12 * ScreenTools.fontHRatio : 20 * ScreenTools.fontHRatio
anchors.centerIn: parent
}
}
......@@ -61,8 +61,8 @@ Item {
visible: !_mainIsMap
rollAngle: _roll
pitchAngle: _pitch
width: ScreenTools.defaultFontPixelSize * (30)
height: ScreenTools.defaultFontPixelSize * (30)
width: ScreenTools.defaultFontPixelHeight * (30)
height: ScreenTools.defaultFontPixelHeight * (30)
active: QGroundControl.multiVehicleManager.activeVehicleAvailable
z: QGroundControl.zOrderWidgets
}
......
......@@ -51,8 +51,6 @@ Item {
function getGadgetWidth() {
if(ScreenTools.isMobile) {
if(ScreenTools.isTinyScreen)
return mainWindow.width * 0.2
return mainWindow.width * 0.15
}
var w = mainWindow.width * 0.15
......@@ -74,7 +72,7 @@ Item {
visible: _activeVehicle && !_activeVehicle.coordinateValid && _mainIsMap
z: QGroundControl.zOrderTopMost
color: mapPal.text
font.pixelSize: ScreenTools.largeFontPixelSize
font.pointSize: ScreenTools.largeFontPointSize
text: qsTr("No GPS Lock for Vehicle")
}
......@@ -83,7 +81,7 @@ Item {
visible: _activeVehicle && !_activeVehicle.coordinateValid
z: QGroundControl.zOrderTopMost
color: mapPal.text
font.pixelSize: ScreenTools.largeFontPixelSize
font.pointSize: ScreenTools.largeFontPointSize
text: _activeVehicle ? _activeVehicle.prearmError : ""
}
}
......@@ -247,12 +245,11 @@ Item {
//-- Zoom Map In
RoundButton {
id: mapZoomPlus
visible: _mainIsMap && !ScreenTools.isTinyScreen
visible: _mainIsMap
buttonImage: "/qmlimages/ZoomPlus.svg"
exclusiveGroup: _dropButtonsExclusiveGroup
z: QGroundControl.zOrderWidgets
lightBorders: _lightWidgetBorders
onClicked: {
if(_flightMap)
_flightMap.zoomLevel += 0.5
......@@ -263,12 +260,11 @@ Item {
//-- Zoom Map Out
RoundButton {
id: mapZoomMinus
visible: _mainIsMap && !ScreenTools.isTinyScreen
visible: _mainIsMap
buttonImage: "/qmlimages/ZoomMinus.svg"
exclusiveGroup: _dropButtonsExclusiveGroup
z: QGroundControl.zOrderWidgets
lightBorders: _lightWidgetBorders
onClicked: {
if(_flightMap)
_flightMap.zoomLevel -= 0.5
......@@ -283,7 +279,7 @@ Item {
anchors.margins: _barMargin
anchors.bottom: parent.bottom
anchors.horizontalCenter: parent.horizontalCenter
width: guidedModeColumn.width + (_margins * 2)
width: guidedModeColumn.width + (_margins * 2)
height: guidedModeColumn.height + (_margins * 2)
radius: _margins
color: _lightWidgetBorders ? qgcPal.mapWidgetBorderLight : qgcPal.mapWidgetBorderDark
......@@ -328,7 +324,6 @@ Item {
id: guidedModeHideTimer
interval: 7000
running: true
onTriggered: {
if (ScreenTools.isShortScreen) {
_guidedModeBar.state = "Hidden"
......@@ -360,9 +355,9 @@ Item {
_activeVehicle.guidedModeLand()
break;
case confirmTakeoff:
var altitude = altitudeSlider.getValue()
if (!isNaN(altitude)) {
_activeVehicle.guidedModeTakeoff(altitude)
var altitude1 = altitudeSlider.getValue()
if (!isNaN(altitude1)) {
_activeVehicle.guidedModeTakeoff(altitude1)
}
break;
case confirmArm:
......@@ -375,9 +370,9 @@ Item {
_activeVehicle.emergencyStop()
break;
case confirmChangeAlt:
var altitude = altitudeSlider.getValue()
if (!isNaN(altitude)) {
_activeVehicle.guidedModeChangeAltitude(altitude)
var altitude2 = altitudeSlider.getValue()
if (!isNaN(altitude2)) {
_activeVehicle.guidedModeChangeAltitude(altitude2)
}
break;
case confirmGoTo:
......@@ -432,7 +427,7 @@ Item {
guidedModeConfirm.confirmText = qsTr("move vehicle")
break;
case confirmRetask:
_guidedModeBar.confirmText = qsTr("active waypoint change")
_guidedModeBar.confirmText = qsTr("active waypoint change")
break;
}
guidedModeBar.visible = false
......
......@@ -175,9 +175,9 @@ Map {
width: scaleImageLeft.width + scaleImage.width + scaleImageRight.width
anchors {
bottom: parent.bottom
bottomMargin: ScreenTools.defaultFontPixelSize * (0.66)
bottomMargin: ScreenTools.defaultFontPixelHeight * (0.66)
right: parent.right
rightMargin: ScreenTools.defaultFontPixelSize * (0.33)
rightMargin: ScreenTools.defaultFontPixelHeight * (0.33)
}
Image {
id: scaleImageLeft
......@@ -204,7 +204,7 @@ Map {
horizontalAlignment: Text.AlignHCenter
anchors.bottom: parent.bottom
anchors.right: parent.right
anchors.bottomMargin: ScreenTools.defaultFontPixelSize * (0.83)
anchors.bottomMargin: ScreenTools.defaultFontPixelHeight * (0.83)
text: "0 m"
}
Component.onCompleted: {
......@@ -300,9 +300,9 @@ Map {
z: 1000
anchors {
bottom: parent.bottom;
bottomMargin: ScreenTools.defaultFontPixelSize * (1.25)
rightMargin: ScreenTools.defaultFontPixelSize * (1.66)
leftMargin: ScreenTools.defaultFontPixelSize * (1.66)
bottomMargin: ScreenTools.defaultFontPixelHeight * (1.25)
rightMargin: ScreenTools.defaultFontPixelHeight * (1.66)
leftMargin: ScreenTools.defaultFontPixelHeight * (1.66)
left: parent.left
}
width: parent.width - anchors.rightMargin - anchors.leftMargin
......
......@@ -85,6 +85,6 @@ Item {
pitchAngle: _pitchAngle
rollAngle: _rollAngle
color: Qt.rgba(0,0,0,0)
size: ScreenTools.defaultFontPixelSize * (10)
size: ScreenTools.defaultFontPixelHeight * (10)
}
}
......@@ -40,9 +40,9 @@ Item {
property real heading: 0
property real size: _defaultSize
property real _defaultSize: ScreenTools.defaultFontPixelSize * (10)
property real _defaultSize: ScreenTools.defaultFontPixelHeight * (10)
property real _sizeRatio: ScreenTools.isTinyScreen ? (size / _defaultSize) * 0.5 : size / _defaultSize
property int _fontSize: ScreenTools.defaultFontPixelSize * _sizeRatio
property int _fontSize: ScreenTools.defaultFontPointSize * _sizeRatio
width: size
height: size
......@@ -91,7 +91,7 @@ Item {
QGCLabel {
text: active ? heading.toFixed(0) : qsTr("OFF")
font.family: active ? ScreenTools.demiboldFontFamily : ScreenTools.normalFontFamily
font.pixelSize: _fontSize < 1 ? 1 : _fontSize;
font.pointSize: _fontSize < 8 ? 8 : _fontSize;
color: "white"
anchors.centerIn: parent
}
......
......@@ -54,15 +54,15 @@ Item {
property Fact groundSpeedFact: _emptyFact
property Fact airSpeedFact: _emptyFact
property real _defaultSize: ScreenTools.defaultFontPixelSize * (9)
property real _defaultSize: ScreenTools.defaultFontPixelHeight * (9)
property color _backgroundColor: qgcPal.window
property real _spacing: ScreenTools.defaultFontPixelSize * 0.33
property real _spacing: ScreenTools.defaultFontPixelHeight * 0.33
property real _topBottomMargin: (size * 0.05) / 2
property real _availableValueHeight: maxHeight - (attitudeWidget.height + _spacer1.height + _spacer2.height + (_spacing * 4)) - (_showCompass ? compass.height : 0)
property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle
readonly property bool _showCompass: !ScreenTools.isShortScreen
readonly property bool _showCompass: true // !ScreenTools.isShortScreen
QGCPalette { id: qgcPal }
......
......@@ -50,13 +50,13 @@ Rectangle {
property real _innerRadius: (width - (_topBottomMargin * 3)) / 4
property real _outerRadius: _innerRadius + _topBottomMargin
property real _defaultSize: ScreenTools.defaultFontPixelSize * (9)
property real _defaultSize: ScreenTools.defaultFontPixelHeight * (9)
property real _sizeRatio: ScreenTools.isTinyScreen ? (size / _defaultSize) * 0.5 : size / _defaultSize
property real _bigFontSize: ScreenTools.defaultFontPixelSize * 2.5 * _sizeRatio
property real _normalFontSize:ScreenTools.defaultFontPixelSize * 1.5 * _sizeRatio
property real _labelFontSize: ScreenTools.defaultFontPixelSize * 0.75 * _sizeRatio
property real _spacing: ScreenTools.defaultFontPixelSize * 0.33
property real _bigFontSize: ScreenTools.defaultFontPointSize * 2.5 * _sizeRatio
property real _normalFontSize:ScreenTools.defaultFontPointSize * 1.5 * _sizeRatio
property real _labelFontSize: ScreenTools.defaultFontPointSize * 0.75 * _sizeRatio
property real _spacing: ScreenTools.defaultFontPixelHeight * 0.33
property real _topBottomMargin: (size * 0.05) / 2
QGCAttitudeWidget {
......
......@@ -40,7 +40,7 @@ Rectangle {
property real _reticleSlot: _reticleSpacing + _reticleHeight
property real _longDash: size * 0.40
property real _shortDash: size * 0.25
property real _fontSize: ScreenTools.defaultFontPixelSize * (size / _defaultSize)
property real _fontSize: ScreenTools.defaultFontPointSize * (size / _defaultSize)
property real _defaultSize: ScreenTools.isAndroid ? 300 : 100
......@@ -72,7 +72,7 @@ Rectangle {
anchors.verticalCenter: parent.verticalCenter
smooth: true
font.family: ScreenTools.demiboldFontFamily
font.pixelSize: _fontSize < 1 ? 1 : _fontSize;
font.pointSize: _fontSize < 1 ? 1 : _fontSize;
text: _pitch
color: "white"
visible: (_pitch != 0) && ((_pitch % 10) === 0)
......@@ -83,7 +83,7 @@ Rectangle {
anchors.verticalCenter: parent.verticalCenter
smooth: true
font.family: ScreenTools.demiboldFontFamily
font.pixelSize: _fontSize < 1 ? 1 : _fontSize;
font.pointSize: _fontSize < 1 ? 1 : _fontSize;