Commit 0a5a5835 authored by dogmaphobic's avatar dogmaphobic

New, system wide font (OpenSans)

UI Tweaks for all mobile platforms.
parent a8cd4b51
android/res/drawable-hdpi/icon.png

20.5 KB | W: | H:

android/res/drawable-hdpi/icon.png

21.6 KB | W: | H:

android/res/drawable-hdpi/icon.png
android/res/drawable-hdpi/icon.png
android/res/drawable-hdpi/icon.png
android/res/drawable-hdpi/icon.png
  • 2-up
  • Swipe
  • Onion skin
android/res/drawable-ldpi/icon.png

19.2 KB | W: | H:

android/res/drawable-ldpi/icon.png

20 KB | W: | H:

android/res/drawable-ldpi/icon.png
android/res/drawable-ldpi/icon.png
android/res/drawable-ldpi/icon.png
android/res/drawable-ldpi/icon.png
  • 2-up
  • Swipe
  • Onion skin
android/res/drawable-mdpi/icon.png

19.2 KB | W: | H:

android/res/drawable-mdpi/icon.png

20 KB | W: | H:

android/res/drawable-mdpi/icon.png
android/res/drawable-mdpi/icon.png
android/res/drawable-mdpi/icon.png
android/res/drawable-mdpi/icon.png
  • 2-up
  • Swipe
  • Onion skin
android/res/drawable-xhdpi/icon.png

22 KB | W: | H:

android/res/drawable-xhdpi/icon.png

23.3 KB | W: | H:

android/res/drawable-xhdpi/icon.png
android/res/drawable-xhdpi/icon.png
android/res/drawable-xhdpi/icon.png
android/res/drawable-xhdpi/icon.png
  • 2-up
  • Swipe
  • Onion skin
android/res/drawable-xxhdpi/icon.png

25.2 KB | W: | H:

android/res/drawable-xxhdpi/icon.png

27 KB | W: | H:

android/res/drawable-xxhdpi/icon.png
android/res/drawable-xxhdpi/icon.png
android/res/drawable-xxhdpi/icon.png
android/res/drawable-xxhdpi/icon.png
  • 2-up
  • Swipe
  • Onion skin
android/res/drawable-xxxhdpi/icon.png

26.9 KB | W: | H:

android/res/drawable-xxxhdpi/icon.png

28.9 KB | W: | H:

android/res/drawable-xxxhdpi/icon.png
android/res/drawable-xxxhdpi/icon.png
android/res/drawable-xxxhdpi/icon.png
android/res/drawable-xxxhdpi/icon.png
  • 2-up
  • Swipe
  • Onion skin
<RCC>
<qresource prefix="/fonts">
<file alias="opensans">resources/fonts/OpenSans-Regular.ttf</file>
<file alias="opensans-demibold">resources/fonts/OpenSans-Semibold.ttf</file>
</qresource>
<qresource prefix="/qmlimages">
<file alias="AirframeComponentIcon.png">src/AutoPilotPlugins/Common/Images/AirframeComponentIcon.png</file>
......
......@@ -211,7 +211,7 @@ QGCView {
QGCLabel {
id: directionLabel
text: qsTr("Gimbal ") + directionTitle
font.weight: Font.DemiBold
font.family: ScreenTools.demiboldFontFamily
}
Rectangle {
......@@ -393,7 +393,7 @@ QGCView {
QGCLabel {
id: settingsLabel
text: qsTr("Gimbal Settings")
font.weight: Font.DemiBold
font.family: ScreenTools.demiboldFontFamily
}
Rectangle {
......
......@@ -63,7 +63,7 @@ QGCView {
QGCLabel {
id: flightModeLabel
text: qsTr("Flight Mode Settings") + (_fltmodeChExists ? "" : qsTr(" (Channel 5)"))
font.weight: Font.DemiBold
font.family: ScreenTools.demiboldFontFamily
}
Rectangle {
......@@ -141,7 +141,7 @@ QGCView {
anchors.top: parent.top
anchors.left: flightModeSettings.right
text: qsTr("Channel Options")
font.weight: Font.DemiBold
font.family: ScreenTools.demiboldFontFamily
visible: _channelOptionCount != 0
}
......
......@@ -80,7 +80,7 @@ QGCView {
QGCLabel {
id: failsafeLabel
text: qsTr("Failsafe Triggers")
font.weight: Font.DemiBold
font.family: ScreenTools.demiboldFontFamily
}
Rectangle {
......@@ -217,7 +217,7 @@ QGCView {
anchors.left: failsafeSettings.right
anchors.top: parent.top
text: qsTr("GeoFence")
font.weight: Font.DemiBold
font.family: ScreenTools.demiboldFontFamily
}
Rectangle {
......@@ -342,7 +342,7 @@ QGCView {
anchors.topMargin: _margins
anchors.top: geoFenceSettings.bottom
text: qsTr("Return to Launch")
font.weight: Font.DemiBold
font.family: ScreenTools.demiboldFontFamily
}
Rectangle {
......@@ -475,7 +475,7 @@ QGCView {
anchors.left: parent.left
anchors.top: rtlSettings.bottom
text: qsTr("Arming Checks")
font.weight: Font.DemiBold
font.family: ScreenTools.demiboldFontFamily
}
Rectangle {
......
......@@ -65,7 +65,7 @@ QGCView {
QGCLabel {
id: failsafeTriggersLabel
text: qsTr("Failsafe Triggers")
font.weight: Font.DemiBold
font.family: ScreenTools.demiboldFontFamily
}
Rectangle {
......@@ -158,7 +158,7 @@ QGCView {
anchors.leftMargin: _margins
anchors.left: failsafeTriggerSettings.right
text: qsTr("Return to Launch")
font.weight: Font.DemiBold
font.family: ScreenTools.demiboldFontFamily
}
Rectangle {
......
......@@ -135,7 +135,7 @@ QGCView {
QGCLabel {
id: basicLabel
text: qsTr("Basic Tuning")
font.weight: Font.DemiBold
font.family: ScreenTools.demiboldFontFamily
}
Rectangle {
......@@ -161,7 +161,7 @@ QGCView {
QGCLabel {
text: qsTr("Throttle Hover")
font.weight: Font.DemiBold
font.family: ScreenTools.demiboldFontFamily
}
QGCLabel {
......@@ -191,7 +191,7 @@ QGCView {
QGCLabel {
text: qsTr("Roll/Pitch Sensitivity")
font.weight: Font.DemiBold
font.family: ScreenTools.demiboldFontFamily
}
QGCLabel {
......@@ -224,7 +224,7 @@ QGCView {
QGCLabel {
text: qsTr("Climb Sensitivity")
font.weight: Font.DemiBold
font.family: ScreenTools.demiboldFontFamily
}
QGCLabel {
......@@ -256,7 +256,7 @@ QGCView {
QGCLabel {
text: qsTr("RC Roll/Pitch Feel")
font.weight: Font.DemiBold
font.family: ScreenTools.demiboldFontFamily
}
QGCLabel {
......@@ -287,7 +287,7 @@ QGCView {
anchors.topMargin: _margins
anchors.top: basicTuningRect.bottom
text: qsTr("AutoTune")
font.weight: Font.DemiBold
font.family: ScreenTools.demiboldFontFamily
}
Rectangle {
......
......@@ -50,6 +50,7 @@ FactPanel {
labelText: qsTr("WiFi AP Password:")
valueText: esp8266.wifiPassword
}
/* Too much info makes it all crammed
VehicleSummaryRow {
labelText: qsTr("WiFi STA SSID:")
valueText: esp8266.wifiSSIDSta
......@@ -58,6 +59,7 @@ FactPanel {
labelText: qsTr("WiFi STA Password:")
valueText: esp8266.wifiPasswordSta
}
*/
VehicleSummaryRow {
labelText: qsTr("UART Baud Rate:")
valueText: uartBaud ? uartBaud.valueString : ""
......
......@@ -130,7 +130,7 @@ QGCView {
qsTr("You've connected a %1.").arg(controller.currentVehicleName) :
qsTr("Airframe is not set.")) +
qsTr("To change this configuration, select the desired airframe below then click “Apply and Restart”.")
font.weight: Font.DemiBold
font.family: ScreenTools.demiboldFontFamily
wrapMode: Text.WordWrap
}
......
......@@ -131,7 +131,7 @@ QGCView {
*/
QGCLabel {
text: qsTr("Camera Trigger Settings")
font.weight: Font.DemiBold
font.family: ScreenTools.demiboldFontFamily
}
Rectangle {
id: camTrigRect
......@@ -213,7 +213,7 @@ QGCView {
Item { width: 1; height: _margins * 0.5; }
QGCLabel {
text: qsTr("Hardware Settings")
font.weight: Font.DemiBold
font.family: ScreenTools.demiboldFontFamily
visible: _auxPins
}
Rectangle {
......
......@@ -20,26 +20,21 @@ FactPanel {
property Fact _rcMapModeSw: controller.getParameterFact(-1, "RC_MAP_MODE_SW")
property bool _simpleMode: _rcMapFltmode.value > 0 || _rcMapModeSw.value == 0
Loader {
anchors.fill: parent
anchors.margins: 8
sourceComponent: _simpleMode ? simple : advanced
}
Component {
id: simple
Column {
anchors.margins: 8
VehicleSummaryRow {
labelText: qsTr("Mode switch:")
valueText: _rcMapFltmode.value === 0 ? qsTr("Setup required") : _rcMapFltmode.enumStringValue
}
Repeater {
model: 6
VehicleSummaryRow {
labelText: qsTr("Flight Mode %1 :").arg(index + 1)
valueText: controller.getParameterFact(-1, "COM_FLTMODE" + (index + 1)).enumStringValue
......@@ -50,29 +45,22 @@ FactPanel {
Component {
id: advanced
Column {
anchors.margins: 8
property Fact posCtlSwFact: controller.getParameterFact(-1, "RC_MAP_POSCTL_SW")
property Fact loiterSwFact: controller.getParameterFact(-1, "RC_MAP_LOITER_SW")
property Fact returnSwFact: controller.getParameterFact(-1, "RC_MAP_RETURN_SW")
VehicleSummaryRow {
labelText: qsTr("Mode switch:")
valueText: _rcMapModeSw.value === 0 ? qsTr("Setup required") : _rcMapModeSw.valueString
}
VehicleSummaryRow {
labelText: qsTr("Position Ctl switch:")
valueText: posCtlSwFact.value === 0 ? qsTr("Disabled") : posCtlSwFact.valueString
}
VehicleSummaryRow {
labelText: qsTr("Loiter switch:")
valueText: loiterSwFact.value === 0 ? qsTr("Disabled") : loiterSwFact.valueString
}
VehicleSummaryRow {
labelText: qsTr("Return switch:")
valueText: returnSwFact.value === 0 ? qsTr("Disabled") : returnSwFact.valueString
......
......@@ -71,7 +71,7 @@ Item {
QGCLabel {
id: flightModeLabel
text: qsTr("Flight Mode Settings")
font.weight: Font.DemiBold
font.family: ScreenTools.demiboldFontFamily
}
Rectangle {
......@@ -136,7 +136,7 @@ Item {
QGCLabel {
text: qsTr("Switch Settings")
font.weight: Font.DemiBold
font.family: ScreenTools.demiboldFontFamily
}
Rectangle {
......
......@@ -123,7 +123,7 @@ QGCView {
QGCLabel {
text: qsTr("Battery")
font.weight: Font.DemiBold
font.family: ScreenTools.demiboldFontFamily
}
Rectangle {
......@@ -236,7 +236,7 @@ QGCView {
QGCLabel {
text: qsTr("ESC PWM Minimum and Maximum Calibration")
font.weight: Font.DemiBold
font.family: ScreenTools.demiboldFontFamily
}
Rectangle {
......@@ -276,7 +276,7 @@ QGCView {
QGCLabel {
text: qsTr("UAVCAN Bus Configuration")
font.weight: Font.DemiBold
font.family: ScreenTools.demiboldFontFamily
visible: showUAVCAN.checked
}
......@@ -306,7 +306,7 @@ QGCView {
QGCLabel {
text: qsTr("UAVCAN Motor Index and Direction Assignment")
font.weight: Font.DemiBold
font.family: ScreenTools.demiboldFontFamily
visible: showUAVCAN.checked
}
......@@ -358,7 +358,7 @@ QGCView {
QGCLabel {
text: qsTr("Advanced Power Settings")
font.weight: Font.DemiBold
font.family: ScreenTools.demiboldFontFamily
visible: showAdvanced.checked
}
......
......@@ -44,7 +44,7 @@ QGCView {
QGCPalette { id: palette; colorGroupEnabled: enabled }
property real _margins: ScreenTools.defaultFontPixelHeight
property real _middleRowWidth: ScreenTools.defaultFontPixelWidth * 22
property real _middleRowWidth: ScreenTools.defaultFontPixelWidth * 24
property real _editFieldWidth: ScreenTools.defaultFontPixelWidth * 18
property Fact _fenceAction: controller.getParameterFact(-1, "GF_ACTION")
......@@ -75,7 +75,7 @@ QGCView {
Item { width: 1; height: _margins * 0.5; }
QGCLabel {
text: qsTr("Low Battery Failsafe Trigger")
font.weight: Font.DemiBold
font.family: ScreenTools.demiboldFontFamily
}
Rectangle {
color: palette.windowShade
......@@ -146,7 +146,7 @@ QGCView {
*/
QGCLabel {
text: qsTr("RC Loss Failsafe Trigger")
font.weight: Font.DemiBold
font.family: ScreenTools.demiboldFontFamily
}
Rectangle {
color: palette.windowShade
......@@ -203,7 +203,7 @@ QGCView {
*/
QGCLabel {
text: qsTr("Data Link Loss Failsafe Trigger")
font.weight: Font.DemiBold
font.family: ScreenTools.demiboldFontFamily
}
Rectangle {
color: palette.windowShade
......@@ -260,7 +260,7 @@ QGCView {
*/
QGCLabel {
text: qsTr("Geofence Failsafe Trigger")
font.weight: Font.DemiBold
font.family: ScreenTools.demiboldFontFamily
}
Rectangle {
color: palette.windowShade
......@@ -340,7 +340,7 @@ QGCView {
QGCLabel {
id: rtlLabel
text: qsTr("Return Home Settings")
font.weight: Font.DemiBold
font.family: ScreenTools.demiboldFontFamily
}
Rectangle {
id: rtlSettings
......@@ -453,7 +453,7 @@ QGCView {
*/
QGCLabel {
text: qsTr("Land Mode Settings")
font.weight: Font.DemiBold
font.family: ScreenTools.demiboldFontFamily
}
Rectangle {
color: palette.windowShade
......
......@@ -43,7 +43,7 @@ Item {
visible: !_controller.videoRunning
QGCLabel {
text: qsTr("NO VIDEO")
font.weight: Font.DemiBold
font.family: ScreenTools.demiboldFontFamily
color: "white"
font.pixelSize: _mainIsMap ? 12 * ScreenTools.fontHRatio : 20 * ScreenTools.fontHRatio
anchors.centerIn: parent
......
......@@ -200,7 +200,7 @@ Map {
QGCLabel {
id: scaleText
color: isSatelliteMap ? "white" : "black"
font.weight: Font.DemiBold
font.family: ScreenTools.demiboldFontFamily
horizontalAlignment: Text.AlignHCenter
anchors.bottom: parent.bottom
anchors.right: parent.right
......
......@@ -90,7 +90,7 @@ Item {
QGCLabel {
text: active ? heading.toFixed(0) : qsTr("OFF")
font.weight: active ? Font.DemiBold : Font.Light
font.family: active ? ScreenTools.demiboldFontFamily : ScreenTools.normalFontFamily
font.pixelSize: _fontSize < 1 ? 1 : _fontSize;
color: "white"
anchors.centerIn: parent
......
......@@ -71,7 +71,7 @@ Rectangle {
anchors.horizontalCenterOffset: -(_longDash * 0.8)
anchors.verticalCenter: parent.verticalCenter
smooth: true
font.weight: Font.DemiBold
font.family: ScreenTools.demiboldFontFamily
font.pixelSize: _fontSize < 1 ? 1 : _fontSize;
text: _pitch
color: "white"
......@@ -82,7 +82,7 @@ Rectangle {
anchors.horizontalCenterOffset: (_longDash * 0.8)
anchors.verticalCenter: parent.verticalCenter
smooth: true
font.weight: Font.DemiBold
font.family: ScreenTools.demiboldFontFamily
font.pixelSize: _fontSize < 1 ? 1 : _fontSize;
text: _pitch
color: "white"
......
......@@ -96,7 +96,7 @@ QGCFlickable {
width: parent.width
horizontalAlignment: Text.AlignHCenter
font.pixelSize: ScreenTools.largeFontPixelSize * (largeValue ? 1.3 : 1.0)
font.weight: largeValue ? Font.ExtraBold : Font.Normal
font.family: largeValue ? ScreenTools.demiboldFontFamily : ScreenTools.normalFontFamily
fontSizeMode: Text.HorizontalFit
color: textColor
text: fact.valueString
......
......@@ -62,12 +62,13 @@ Rectangle {
width: listview.width
Text {
anchors.verticalCenter: parent.verticalCenter
id: field
text: display
color: qgcPal.text
width: parent.width
wrapMode: Text.Wrap
font.family: ScreenTools.normalFontFamily
anchors.verticalCenter: parent.verticalCenter
}
}
}
......
......@@ -11,7 +11,7 @@ Item {
signal clicked()
property alias buttonImage: roundButton.buttonImage
property alias rotateImage: roundButton.rotateImage
property real radius: ScreenTools.defaultFontPixelHeight * 1.5
property real radius: ScreenTools.isTinyScreen ? ScreenTools.defaultFontPixelHeight * 2.5 : ScreenTools.defaultFontPixelHeight * 1.5
property int dropDirection: dropDown
property alias dropDownComponent: dropDownLoader.sourceComponent
property real viewportMargins: 0
......
......@@ -77,7 +77,7 @@ QGCView {
QGCLabel {
id: panelLabel
text: panelTitle
font.weight: Font.DemiBold
font.family: ScreenTools.demiboldFontFamily
}
......@@ -111,7 +111,7 @@ QGCView {
QGCLabel {
text: title
font.weight: Font.DemiBold
font.family: ScreenTools.demiboldFontFamily
}
QGCLabel {
......
......@@ -93,7 +93,7 @@ QGCViewDialog {
QGCLabel {
text: mavCmdInfo.friendlyName
color: textColor
font.weight: Font.DemiBold
font.family: ScreenTools.demiboldFontFamily
}
QGCLabel {
......
......@@ -43,7 +43,7 @@ QGCView {
QGCPalette { id: __qgcPal; colorGroupEnabled: true }
property Fact _editorDialogFact: Fact { }
property int _rowHeight: ScreenTools.defaultFontPixelHeight * 2
property int _rowHeight: ScreenTools.isTinyScreen ? ScreenTools.defaultFontPixelHeight * 4 : ScreenTools.defaultFontPixelHeight * 2
property int _rowWidth: 10 // Dynamic adjusted at runtime
property bool _searchFilter: false ///< true: showing results of search
property var _searchResults ///< List of parameter names from search results
......@@ -53,7 +53,6 @@ QGCView {
ParameterEditorController {
id: controller;
factPanel: panel
onShowErrorMessage: {
showMessage(qsTr("Parameter Load Errors"), errorMsg, StandardButton.Ok)
}
......@@ -76,7 +75,6 @@ QGCView {
anchors.top: searchText.top
anchors.bottom: searchText.bottom
text: qsTr("Filter by:")
onClicked: {
_searchResults = controller.searchParametersForComponent(-1, searchText.text)
_searchFilter = true
......@@ -184,7 +182,7 @@ QGCView {
spacing: Math.ceil(ScreenTools.defaultFontPixelHeight * 0.25)
QGCLabel {
text: qsTr("Component #: %1)").arg(componentId.toString())
font.weight: Font.DemiBold
font.family: ScreenTools.demiboldFontFamily
anchors.horizontalCenter: parent.horizontalCenter
}
ExclusiveGroup { id: groupGroup }
......
......@@ -60,7 +60,13 @@ Button {
background: Item {
property bool down: control.pressed || (control.checkable && control.checked)
implicitWidth: Math.round(TextSingleton.implicitHeight * 4.5)
implicitHeight: ScreenTools.isMobile ? ScreenTools.defaultFontPixelHeight * 2.5 : Math.max(25, Math.round(TextSingleton.implicitHeight * 1.2))
implicitHeight: {
if(ScreenTools.isTinyScreen)
return ScreenTools.defaultFontPixelHeight * 3.5
if(ScreenTools.isMobile)
return ScreenTools.defaultFontPixelHeight * 2.5
return Math.max(25, Math.round(TextSingleton.implicitHeight * 1.2))
}
Rectangle {
anchors.fill: parent
......@@ -103,9 +109,8 @@ Button {
antialiasing: true
text: control.text
font.pixelSize: ScreenTools.defaultFontPixelSize
font.family: ScreenTools.normalFontFamily
anchors.verticalCenter: parent.verticalCenter
color: _showHighlight ?
control._qgcPal.buttonHighlightText :
(primary ? control._qgcPal.primaryButtonText : control._qgcPal.buttonText)
......
......@@ -30,8 +30,9 @@ CheckBox {
text: control.text
antialiasing: true
font.pixelSize: ScreenTools.defaultFontPixelSize
anchors.verticalCenter: parent.verticalCenter
font.family: ScreenTools.normalFontFamily
color: control.__qgcPal.text
anchors.verticalCenter: parent.verticalCenter
}
}
}
......
......@@ -19,7 +19,13 @@ ComboBox {
background: Item {
implicitWidth: Math.round(TextSingleton.implicitHeight * 4.5)
implicitHeight: ScreenTools.isMobile ? ScreenTools.defaultFontPixelHeight * 3 * 0.75 : Math.max(25, Math.round(TextSingleton.implicitHeight * 1.2))
implicitHeight: {
if(ScreenTools.isTinyScreen)
return ScreenTools.defaultFontPixelHeight * 3.5
if(ScreenTools.isMobile)
return ScreenTools.defaultFontPixelHeight * 2.5
return Math.max(25, Math.round(TextSingleton.implicitHeight * 1.2))
}
Rectangle {
anchors.fill: parent
......
......@@ -11,6 +11,7 @@ Text {
property bool enabled: true
font.pixelSize: ScreenTools.defaultFontPixelSize
font.family: ScreenTools.normalFontFamily
color: __qgcPal.text
antialiasing: true
}
......@@ -29,11 +29,10 @@ RadioButton {
id: text
text: control.text
font.pixelSize: ScreenTools.defaultFontPixelSize
font.family: ScreenTools.normalFontFamily
antialiasing: true
anchors.centerIn: parent
color: control.__qgcPal.text
anchors.centerIn: parent
}
}
}
......
......@@ -20,7 +20,14 @@ TextField {
property var __qgcPal: QGCPalette { colorGroupEnabled: enabled }
textColor: __qgcPal.textFieldText
height: ScreenTools.isMobile ? ScreenTools.defaultFontPixelHeight * 3 * 0.75 : implicitHeight
height: {
if(ScreenTools.isTinyScreen)
return ScreenTools.defaultFontPixelHeight * 3.5
if(ScreenTools.isMobile)
return ScreenTools.defaultFontPixelHeight * 2.5
return implicitHeight
}
Label {
id: unitsLabelWidthGenerator
......@@ -28,6 +35,7 @@ TextField {
width: contentWidth + ((parent.__contentHeight/3)*2)
visible: false
antialiasing: true
font.family: ScreenTools.normalFontFamily
}
style: TextFieldStyle {
......@@ -54,13 +62,14 @@ TextField {
anchors.bottom: parent.bottom
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignHCenter
horizontalAlignment:Text.AlignHCenter
x: parent.width - width
width: unitsLabelWidthGenerator.width
text: control.unitsLabel
font.pixelSize: ScreenTools.defaultFontPixelSize
font.family: ScreenTools.normalFontFamily
antialiasing: true
color: control.textColor
......
......@@ -10,7 +10,7 @@ Item {
signal clicked()
property alias buttonImage: button.source
property real radius: ScreenTools.defaultFontPixelHeight * 1.5
property real radius: ScreenTools.isTinyScreen ? ScreenTools.defaultFontPixelHeight * 2.5 : ScreenTools.defaultFontPixelHeight * 1.5
property bool rotateImage: false
property bool lightBorders: true
......
......@@ -11,12 +11,14 @@ Item {
property real availableHeight: 0
readonly property real defaultFontPixelSize: _textMeasure.fontHeight * ScreenToolsController.defaultFontPixelSizeRatio
readonly property real defaultFontPixelHeight: defaultFontPixelSize
readonly property real defaultFontPixelWidth: _textMeasure.fontWidth * ScreenToolsController.defaultFontPixelSizeRatio
readonly property real smallFontPixelSize: defaultFontPixelSize * ScreenToolsController.smallFontPixelSizeRatio
readonly property real smallFontPixelHeight: smallFontPixelSize
readonly property real smallFontPixelWidth: defaultFontPixelWidth * ScreenToolsController.smallFontPixelSizeRatio
property real defaultFontPixelSize: 1
property real defaultFontPixelHeight: 1
property real defaultFontPixelWidth: 1
property real smallFontPixelSize: 1
property real smallFontPixelHeight: 1
property real smallFontPixelWidth: 1
property real mediumFontPixelSize: 1
property real largeFontPixelSize: 1
// To proportionally scale fonts
......@@ -27,8 +29,8 @@ Item {
// On OSX ElCapitan with Qt 5.4.0 any font pixel size above 19 shows garbage test. No idea why at this point.
// Will remove Math.min when problem is figure out.
readonly property real mediumFontPixelSize: Math.min(defaultFontPixelSize * ScreenToolsController.mediumFontPixelSizeRatio, ScreenToolsController.isMobile ? 10000 : 19)
readonly property real largeFontPixelSize: Math.min(defaultFontPixelSize * ScreenToolsController.largeFontPixelSizeRatio, ScreenToolsController.isMobile ? 10000 : 19)
// readonly property real mediumFontPixelSize: Math.min(defaultFontPixelSize * ScreenToolsController.mediumFontPixelSizeRatio, ScreenToolsController.isMobile ? 10000 : 19)
// readonly property real largeFontPixelSize: Math.min(defaultFontPixelSize * ScreenToolsController.largeFontPixelSizeRatio, ScreenToolsController.isMobile ? 10000 : 19)
property bool isAndroid: ScreenToolsController.isAndroid
property bool isiOS: ScreenToolsController.isiOS
......@@ -37,6 +39,9 @@ Item {
property bool isTinyScreen: (Screen.width / Screen.pixelDensity) < 120 // 120mm
property bool isShortScreen: ScreenToolsController.isMobile && ((Screen.height / Screen.width) < 0.6) // Nexus 7 for example
readonly property string normalFontFamily: "opensans"
readonly property string demiboldFontFamily: "opensans-demibold"
function mouseX() {
return ScreenToolsController.mouseX()
}
......@@ -48,7 +53,29 @@ Item {
Text {
id: _textMeasure
text: "X"
font.family: normalFontFamily
property real fontWidth: contentWidth * (ScreenToolsController.testHighDPI ? 2 : 1)
property real fontHeight: contentHeight * (ScreenToolsController.testHighDPI ? 2 : 1)
Component.onCompleted: {
var fudgeFactor = 1.0
// Small Android Devices (Large Scaling Error)
if(ScreenToolsController.isAndroid && (Screen.width / Screen.pixelDensity) < 120) {
fudgeFactor = 0.6
// Nexus 7 type
} else if(ScreenToolsController.isAndroid && (Screen.height / Screen.width) < 0.6) {
fudgeFactor = 0.75
// iPhones
} else if (ScreenToolsController.isiOS && (Screen.width / Screen.pixelDensity) < 120) {
fudgeFactor = 0.75
}
defaultFontPixelSize = _textMeasure.fontHeight * ScreenToolsController.defaultFontPixelSizeRatio * fudgeFactor
defaultFontPixelHeight = defaultFontPixelSize * fudgeFactor
defaultFontPixelWidth = _textMeasure.fontWidth * ScreenToolsController.defaultFontPixelSizeRatio * fudgeFactor
smallFontPixelSize = defaultFontPixelSize * ScreenToolsController.smallFontPixelSizeRatio * fudgeFactor
smallFontPixelHeight = smallFontPixelSize * fudgeFactor
smallFontPixelWidth = defaultFontPixelWidth * ScreenToolsController.smallFontPixelSizeRatio * fudgeFactor
mediumFontPixelSize = defaultFontPixelSize * ScreenToolsController.mediumFontPixelSizeRatio * fudgeFactor
largeFontPixelSize = defaultFontPixelSize * ScreenToolsController.largeFontPixelSizeRatio * fudgeFactor
}
}
}
......@@ -32,7 +32,9 @@ const double ScreenToolsController::_defaultFontPixelSizeRatio = 1.0;
#elif __android__
const double ScreenToolsController::_defaultFontPixelSizeRatio = 1.0;
#elif __ios__
const double ScreenToolsController::_defaultFontPixelSizeRatio = 0.6;
const double ScreenToolsController::_defaultFontPixelSizeRatio = 0.8;
#elif defined Q_OS_LINUX
const double ScreenToolsController::_defaultFontPixelSizeRatio = 0.8;
#else
const double ScreenToolsController::_defaultFontPixelSizeRatio = 0.8;
#endif
......
......@@ -14,7 +14,7 @@ Button {
text: "Button" ///< Pass in your own button text
checkable: true
implicitHeight: ScreenTools.isTinyScreen ? ScreenTools.defaultFontPixelHeight * 3 : ScreenTools.defaultFontPixelHeight * 2.5
implicitHeight: ScreenTools.isTinyScreen ? ScreenTools.defaultFontPixelHeight * 5 : ScreenTools.defaultFontPixelHeight * 2.5
style: ButtonStyle {
id: buttonStyle
......
......@@ -49,7 +49,7 @@ QGCView {
QGCLabel {
id: titleLabel
text: qsTr("PX4Flow Camera")
font.weight: Font.DemiBold
font.family: ScreenTools.demiboldFontFamily
}
Image {
......
......@@ -35,11 +35,13 @@ import QGroundControl.Palette 1.0
Rectangle {
id: _summaryRoot
anchors.fill: parent
anchors.rightMargin: ScreenTools.defaultFontPixelWidth
anchors.leftMargin: ScreenTools.defaultFontPixelWidth
color: qgcPal.window
property real _minSummaryW: ScreenTools.defaultFontPixelWidth * 40
property real _minSummaryW: ScreenTools.defaultFontPixelWidth * 42
property real _summaryBoxWidth: _minSummaryW
property real _summaryBoxSpace: ScreenTools.defaultFontPixelWidth
property real _summaryBoxSpace: ScreenTools.defaultFontPixelWidth * 2
function computeSummaryBoxSize() {
var sw = 0
......@@ -51,7 +53,7 @@ Rectangle {
} else {
_summaryBoxSpace = 0
if(idx > 1) {
_summaryBoxSpace = ScreenTools.defaultFontPixelWidth
_summaryBoxSpace = ScreenTools.defaultFontPixelWidth * 2
sw = _summaryBoxSpace * (idx - 1)
}
rw = _summaryRoot.width - sw
......@@ -92,7 +94,7 @@ Rectangle {
width: parent.width
wrapMode: Text.WordWrap
color: setupComplete ? qgcPal.text : qgcPal.warningText
font.weight: Font.DemiBold
font.family: ScreenTools.demiboldFontFamily
horizontalAlignment: Text.AlignHCenter
text: setupComplete ?
qsTr("Below you will find a summary of the settings for your vehicle. To the left are the setup menus for each component.") :
......@@ -111,11 +113,16 @@ Rectangle {
// Outer summary item rectangle
Rectangle {
width: _summaryBoxWidth
height: ScreenTools.defaultFontPixelHeight * 13
color: qgcPal.window
height: ScreenTools.isTinyScreen ? ScreenTools.defaultFontPixelHeight * 20 : ScreenTools.defaultFontPixelHeight * 13
color: qgcPal.windowShade
visible: modelData.summaryQmlSource.toString() !== ""
border.width: 1
border.color: qgcPal.text
Component.onCompleted: {
border.color = Qt.rgba(border.color.r, border.color.g, border.color.b, 0.1)
}
readonly property real titleHeight: ScreenTools.defaultFontPixelHeight * 2
readonly property real titleHeight: ScreenTools.isTinyScreen ? ScreenTools.defaultFontPixelHeight * 4 : ScreenTools.defaultFontPixelHeight * 2
// Title bar
QGCButton {
......@@ -126,21 +133,19 @@ Rectangle {
// Setup indicator
Rectangle {
anchors.rightMargin: ScreenTools.defaultFontPixelWidth * 0.5
anchors.rightMargin: ScreenTools.defaultFontPixelWidth
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
width: ScreenTools.defaultFontPixelWidth * 1.5
width: ScreenTools.defaultFontPixelWidth * 1.75
height: width
radius: width / 2
color: modelData.setupComplete ? "#00d932" : "red"
visible: modelData.requiresSetup
}
onClicked : {
setupView.showVehicleComponentPanel(modelData)
}
}
// Summary Qml
Rectangle {
anchors.top: titleBar.bottom
......
......@@ -141,6 +141,14 @@ MainWindow::MainWindow()
Q_ASSERT(_instance == NULL);
_instance = this;
//-- Load fonts
if(QFontDatabase::addApplicationFont(":/fonts/opensans") < 0) {
qWarning() << "Could not load /fonts/opensans font";
}
if(QFontDatabase::addApplicationFont(":/fonts/opensans-demibold") < 0) {
qWarning() << "Could not load /fonts/opensans-demibold font";
}
// Qt 4/5 on Ubuntu does place the native menubar correctly so on Linux we revert back to in-window menu bar.
#ifdef Q_OS_LINUX
menuBar()->setNativeMenuBar(false);
......
......@@ -372,6 +372,7 @@ Item {
readOnly: true
textFormat: TextEdit.RichText
color: "white"
font.family: ScreenTools.normalFontFamily
}
}
//-- Dismiss System Message
......@@ -379,8 +380,8 @@ Item {
anchors.margins: ScreenTools.defaultFontPixelHeight
anchors.top: parent.top
anchors.right: parent.right
width: ScreenTools.defaultFontPixelHeight * 1.5
height: ScreenTools.defaultFontPixelHeight * 1.5
width: ScreenTools.isTinyScreen ? ScreenTools.defaultFontPixelHeight * 2.5 : ScreenTools.defaultFontPixelHeight * 1.5
height: width
source: "/res/XDelete.svg"
fillMode: Image.PreserveAspectFit
mipmap: true
......@@ -404,7 +405,8 @@ Item {
criticalMessageText.text = ""
//-- Show all messages in queue
for (var i = 0; i < mainWindow.messageQueue.length; i++) {
criticalMessageText.append(mainWindow.messageQueue[i])
var text = mainWindow.messageQueue[i]
criticalMessageText.append(text)
}
//-- Clear it
mainWindow.messageQueue = []
......@@ -449,7 +451,7 @@ Item {
anchors.left: parent.left
readOnly: true
textFormat: TextEdit.RichText
font.weight: Font.DemiBold
font.family: ScreenTools.demiboldFontFamily
wrapMode: TextEdit.WordWrap
color: qgcPal.warningText
}
......@@ -461,12 +463,11 @@ Item {
anchors.margins: ScreenTools.defaultFontPixelHeight
anchors.top: parent.top
anchors.right: parent.right
width: ScreenTools.defaultFontPixelHeight * 1.5
height: ScreenTools.defaultFontPixelHeight * 1.5
width: ScreenTools.isTinyScreen ? ScreenTools.defaultFontPixelHeight * 2.5 : ScreenTools.defaultFontPixelHeight * 1.5
height: width
source: "/res/XDelete.svg"
fillMode: Image.PreserveAspectFit
color: qgcPal.warningText
MouseArea {
anchors.fill: parent
onClicked: {
......
......@@ -133,7 +133,7 @@ Item {
// This is the menu dialog panel which is anchored to the left edge
Rectangle {
id: __leftMenu
width: ScreenTools.defaultFontPixelWidth * 14
width: ScreenTools.defaultFontPixelWidth * 16
anchors.left: parent.left
anchors.top: __topSeparator.bottom
anchors.bottom: parent.bottom
......@@ -193,7 +193,6 @@ Item {
anchors.right: parent.right
text: qsTr("Offline Maps")
exclusiveGroup: panelActionGroup
visible: !ScreenTools.isTinyScreen
onClicked: {
if(__rightPanel.source != "OfflineMap.qml") {
__rightPanel.source = "OfflineMap.qml"
......
......@@ -47,6 +47,7 @@ QGCView {
id: _textMeasure
text: "X"
color: qgcPal.window
font.family: ScreenTools.normalFontFamily
}
GridLayout {
......@@ -57,74 +58,92 @@ QGCView {
Text {
text: qsTr("Qt Platform:")
color: qgcPal.text
font.family: ScreenTools.normalFontFamily
}
Text {
text: Qt.platform.os
color: qgcPal.text
font.family: ScreenTools.normalFontFamily
}
Text {
text: qsTr("Default font width:")
color: qgcPal.text
font.family: ScreenTools.normalFontFamily
}
Text {
text: _textMeasure.contentWidth
color: qgcPal.text
font.family: ScreenTools.normalFontFamily
}
Text {
text: qsTr("Default font height:")
color: qgcPal.text
font.family: ScreenTools.normalFontFamily
}
Text {
text: _textMeasure.contentHeight
color: qgcPal.text
font.family: ScreenTools.normalFontFamily
}
Text {
text: qsTr("Default font pixel size:")
color: qgcPal.text
font.family: ScreenTools.normalFontFamily
}
Text {
text: _textMeasure.font.pixelSize
color: qgcPal.text
font.family: ScreenTools.normalFontFamily
}
Text {
text: qsTr("Default font point size:")
color: qgcPal.text
font.family: ScreenTools.normalFontFamily
}
Text {
text: _textMeasure.font.pointSize
color: qgcPal.text
font.family: ScreenTools.normalFontFamily
}
Text {
text: qsTr("QML Screen Desktop:")
color: qgcPal.text
font.family: ScreenTools.normalFontFamily
}
Text {
text: Screen.desktopAvailableWidth + " x " + Screen.desktopAvailableHeight
color: qgcPal.text
font.family: ScreenTools.normalFontFamily
}
Text {
text: qsTr("QML Screen Size:")
color: qgcPal.text
font.family: ScreenTools.normalFontFamily
}
Text {
text: Screen.width + " x " + Screen.height
color: qgcPal.text
font.family: ScreenTools.normalFontFamily
}
Text {
text: qsTr("QML Pixel Density:")
color: qgcPal.text
font.family: ScreenTools.normalFontFamily
}
Text {
text: Screen.pixelDensity
color: qgcPal.text
font.family: ScreenTools.normalFontFamily
}
Text {
text: qsTr("QML Pixel Ratio:")
color: qgcPal.text
font.family: ScreenTools.normalFontFamily
}
Text {
text: Screen.devicePixelRatio
color: qgcPal.text
font.family: ScreenTools.normalFontFamily
}
}
......
......@@ -134,7 +134,7 @@ Rectangle {
*/
readonly property real tbFontSmall: 10 * ScreenTools.fontHRatio
readonly property real tbFontSmall: 8 * ScreenTools.fontHRatio
readonly property real tbFontNormal: 12 * ScreenTools.fontHRatio
readonly property real tbFontLarge: 18 * ScreenTools.fontHRatio
......@@ -214,7 +214,7 @@ Rectangle {
QGCLabel {
id: gpsLabel
text: (activeVehicle && activeVehicle.gps.count.value >= 0) ? qsTr("GPS Status") : qsTr("GPS Data Unavailable")
font.weight:Font.DemiBold
font.family: ScreenTools.demiboldFontFamily
anchors.horizontalCenter: parent.horizontalCenter
}
......@@ -268,7 +268,7 @@ Rectangle {
QGCLabel {
id: battLabel
text: qsTr("Battery Status")
font.weight:Font.DemiBold
font.family: ScreenTools.demiboldFontFamily
anchors.horizontalCenter: parent.horizontalCenter
}
......@@ -315,7 +315,7 @@ Rectangle {
QGCLabel {
id: rssiLabel
text: activeVehicle ? (activeVehicle.rcRSSI != 255 ? qsTr("RC RSSI Status") : qsTr("RC RSSI Data Unavailable")) : qsTr("N/A", "No data avaliable")
font.weight:Font.DemiBold
font.family: ScreenTools.demiboldFontFamily
anchors.horizontalCenter: parent.horizontalCenter
}
......@@ -361,7 +361,7 @@ Rectangle {
QGCLabel {
id: telemLabel
text: qsTr("Telemetry RSSI Status")
font.weight: Font.DemiBold
font.family: ScreenTools.demiboldFontFamily
anchors.horizontalCenter: parent.horizontalCenter
}
......@@ -504,7 +504,7 @@ Rectangle {
id: connectionLost
text: qsTr("COMMUNICATION LOST")
font.pixelSize: tbFontLarge
font.weight: Font.DemiBold
font.family: ScreenTools.demiboldFontFamily
color: colorRed
anchors.rightMargin: ScreenTools.defaultFontPixelWidth
anchors.right: disconnectButton.left
......
......@@ -183,12 +183,13 @@ Row {
QGCLabel {
anchors.top: parent.top
anchors.leftMargin: gpsIcon.width
anchors.left: parent.left
//anchors.leftMargin: gpsIcon.width
//anchors.left: parent.left
anchors.right: gpsRow.right
visible: activeVehicle && !isNaN(activeVehicle.gps.hdop.value)
font.pixelSize: tbFontSmall
color: qgcPal.buttonText
text: activeVehicle ? activeVehicle.gps.hdop.valueString : ""
text: activeVehicle ? activeVehicle.gps.hdop.value.toFixed(0) : ""
}
MouseArea {
......@@ -470,7 +471,7 @@ Row {
anchors.verticalCenter: parent.verticalCenter
horizontalAlignment: Text.AlignRight
font.pixelSize: ScreenTools.smallFontPixelSize
font.weight: Font.DemiBold
font.family: ScreenTools.demiboldFontFamily
color: colorWhite
}
}
......@@ -503,7 +504,7 @@ Row {
QGCLabel {
text: 'R '
font.pixelSize: ScreenTools.smallFontPixelSize
font.weight: Font.DemiBold
font.family: ScreenTools.demiboldFontFamily
color: colorWhite
}
QGCLabel {
......@@ -511,7 +512,7 @@ Row {
width: getProportionalDimmension(30)
horizontalAlignment: Text.AlignRight
font.pixelSize: ScreenTools.smallFontPixelSize
font.weight: Font.DemiBold
font.family: ScreenTools.demiboldFontFamily
color: colorWhite
}
}
......@@ -520,7 +521,7 @@ Row {
QGCLabel {
text: 'L '
font.pixelSize: ScreenTools.smallFontPixelSize
font.weight: Font.DemiBold
font.family: ScreenTools.demiboldFontFamily
color: colorWhite
}
QGCLabel {
......@@ -528,7 +529,7 @@ Row {
width: getProportionalDimmension(30)
horizontalAlignment: Text.AlignRight
font.pixelSize: ScreenTools.smallFontPixelSize
font.weight: Font.DemiBold
font.family: ScreenTools.demiboldFontFamily
color: colorWhite
}
}
......
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