diff --git a/src/AutoPilotPlugins/APM/APMAirframeComponent.qml b/src/AutoPilotPlugins/APM/APMAirframeComponent.qml index 458d6ad32d1480d78cf937c61ce62d40391c3410..19c73883d0ce27ceb476b6eaa1aeb065ed35c160 100644 --- a/src/AutoPilotPlugins/APM/APMAirframeComponent.qml +++ b/src/AutoPilotPlugins/APM/APMAirframeComponent.qml @@ -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 } diff --git a/src/AutoPilotPlugins/APM/APMAirframeComponentSummary.qml b/src/AutoPilotPlugins/APM/APMAirframeComponentSummary.qml index 90fed8bf7715547f3f17e78c661af4e479279d18..59b62957acc5c766880b1be03c68364978e830aa 100644 --- a/src/AutoPilotPlugins/APM/APMAirframeComponentSummary.qml +++ b/src/AutoPilotPlugins/APM/APMAirframeComponentSummary.qml @@ -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:") diff --git a/src/AutoPilotPlugins/APM/APMCameraComponentSummary.qml b/src/AutoPilotPlugins/APM/APMCameraComponentSummary.qml index ca1749b797f9ca47014ebcd52faeaa268adef33b..4d083b238a69f54fa858feb764552dc3e5db7ec9 100644 --- a/src/AutoPilotPlugins/APM/APMCameraComponentSummary.qml +++ b/src/AutoPilotPlugins/APM/APMCameraComponentSummary.qml @@ -24,7 +24,7 @@ FactPanel { Column { anchors.fill: parent - anchors.margins: 8 + anchors.margins: ScreenTools.defaultFontPixelWidth VehicleSummaryRow { visible: _mountTypeExists diff --git a/src/AutoPilotPlugins/APM/APMFlightModesComponentSummary.qml b/src/AutoPilotPlugins/APM/APMFlightModesComponentSummary.qml index 38b5fca111c80a42c4246878ff2eee0219a7e9a0..da3db3c7ecf0289380f9fc7e147d2a4dcac50bc3 100644 --- a/src/AutoPilotPlugins/APM/APMFlightModesComponentSummary.qml +++ b/src/AutoPilotPlugins/APM/APMFlightModesComponentSummary.qml @@ -23,7 +23,7 @@ FactPanel { Column { anchors.fill: parent - anchors.margins: 8 + anchors.margins: ScreenTools.defaultFontPixelWidth VehicleSummaryRow { labelText: qsTr("Flight Mode 1:") diff --git a/src/AutoPilotPlugins/APM/APMPowerComponentSummary.qml b/src/AutoPilotPlugins/APM/APMPowerComponentSummary.qml index 2639407650dd6158d8fa1c7ff92ea790f132e03f..70e998d56f0766d804db3d96e0d961dbd864064f 100644 --- a/src/AutoPilotPlugins/APM/APMPowerComponentSummary.qml +++ b/src/AutoPilotPlugins/APM/APMPowerComponentSummary.qml @@ -42,7 +42,7 @@ FactPanel { Column { anchors.fill: parent - anchors.margins: 8 + anchors.margins: ScreenTools.defaultFontPixelWidth VehicleSummaryRow { labelText: qsTr("Battery monitor:") diff --git a/src/AutoPilotPlugins/APM/APMRadioComponentSummary.qml b/src/AutoPilotPlugins/APM/APMRadioComponentSummary.qml index 678cde14c2f46de7bb5d137ce791e8ab50326a82..af02fff05a9ae1b0b01327349c1b757514471381 100644 --- a/src/AutoPilotPlugins/APM/APMRadioComponentSummary.qml +++ b/src/AutoPilotPlugins/APM/APMRadioComponentSummary.qml @@ -21,7 +21,7 @@ FactPanel { Column { anchors.fill: parent - anchors.margins: 8 + anchors.margins: ScreenTools.defaultFontPixelWidth VehicleSummaryRow { labelText: qsTr("Roll:") diff --git a/src/AutoPilotPlugins/APM/APMSafetyComponentSummaryCopter.qml b/src/AutoPilotPlugins/APM/APMSafetyComponentSummaryCopter.qml index a66709cea6c39b8fd6a8706c4014695e29208f2b..bb3cd9dd1acbb3d46c37b24a60da972729ebfa64 100644 --- a/src/AutoPilotPlugins/APM/APMSafetyComponentSummaryCopter.qml +++ b/src/AutoPilotPlugins/APM/APMSafetyComponentSummaryCopter.qml @@ -85,7 +85,7 @@ FactPanel { Column { anchors.fill: parent - anchors.margins: 8 + anchors.margins: ScreenTools.defaultFontPixelWidth VehicleSummaryRow { labelText: qsTr("Arming Checks:") diff --git a/src/AutoPilotPlugins/APM/APMSafetyComponentSummaryPlane.qml b/src/AutoPilotPlugins/APM/APMSafetyComponentSummaryPlane.qml index 7f0d62c20e2991a64b89143dd2d8b079b99b9a3d..ad1f1aa8d70411cc640bdbc6715f2dfbfb79309b 100644 --- a/src/AutoPilotPlugins/APM/APMSafetyComponentSummaryPlane.qml +++ b/src/AutoPilotPlugins/APM/APMSafetyComponentSummaryPlane.qml @@ -24,7 +24,7 @@ FactPanel { Column { anchors.fill: parent - anchors.margins: 8 + anchors.margins: ScreenTools.defaultFontPixelWidth VehicleSummaryRow { labelText: qsTr("Throttle failsafe:") diff --git a/src/AutoPilotPlugins/APM/APMSensorsComponent.qml b/src/AutoPilotPlugins/APM/APMSensorsComponent.qml index 34cd88810c55e1a93c8aedd02840b87b658b74be..24c605d56b0c27b20536c0fe59eae99023824079 100644 --- a/src/AutoPilotPlugins/APM/APMSensorsComponent.qml +++ b/src/AutoPilotPlugins/APM/APMSensorsComponent.qml @@ -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 { diff --git a/src/AutoPilotPlugins/APM/APMSensorsComponentSummary.qml b/src/AutoPilotPlugins/APM/APMSensorsComponentSummary.qml index fa20dfa036cb82db416e389f5356521a32b210c3..8cab03f2e755379131b5a5e5aabf622d6aebf199 100644 --- a/src/AutoPilotPlugins/APM/APMSensorsComponentSummary.qml +++ b/src/AutoPilotPlugins/APM/APMSensorsComponentSummary.qml @@ -46,7 +46,7 @@ FactPanel { Column { anchors.fill: parent - anchors.margins: 8 + anchors.margins: ScreenTools.defaultFontPixelWidth VehicleSummaryRow { labelText: qsTr("Compass 1:") diff --git a/src/AutoPilotPlugins/Common/ESP8266Component.qml b/src/AutoPilotPlugins/Common/ESP8266Component.qml index 95a45a19ad402162f762b26aff56d2e399c494ec..b76a533292920381453470f9ae1937217f0a9207 100644 --- a/src/AutoPilotPlugins/Common/ESP8266Component.qml +++ b/src/AutoPilotPlugins/Common/ESP8266Component.qml @@ -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 } } } diff --git a/src/AutoPilotPlugins/Common/ESP8266ComponentSummary.qml b/src/AutoPilotPlugins/Common/ESP8266ComponentSummary.qml index 715916277224d9936e9b9af5a9ee38941d3412a0..a45bee2c584207bf4f53d406224eac8c1486c64b 100644 --- a/src/AutoPilotPlugins/Common/ESP8266ComponentSummary.qml +++ b/src/AutoPilotPlugins/Common/ESP8266ComponentSummary.qml @@ -29,7 +29,7 @@ FactPanel { Column { anchors.fill: parent - anchors.margins: 8 + anchors.margins: ScreenTools.defaultFontPixelWidth VehicleSummaryRow { labelText: qsTr("Firmware Version:") valueText: esp8266.version diff --git a/src/AutoPilotPlugins/PX4/AirframeComponentSummary.qml b/src/AutoPilotPlugins/PX4/AirframeComponentSummary.qml index 7bb330970526831907f77daa4a043137e8ff1e92..babb1379aa1c81227ebfa45b0ed21d42b2ccb278 100644 --- a/src/AutoPilotPlugins/PX4/AirframeComponentSummary.qml +++ b/src/AutoPilotPlugins/PX4/AirframeComponentSummary.qml @@ -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") diff --git a/src/AutoPilotPlugins/PX4/CameraComponent.qml b/src/AutoPilotPlugins/PX4/CameraComponent.qml index 3fe01882e0a6c625593be626f9238b63f4f3b553..c85a6cbd853a6b01ae3f6acd48e7e8ee0b888db9 100644 --- a/src/AutoPilotPlugins/PX4/CameraComponent.qml +++ b/src/AutoPilotPlugins/PX4/CameraComponent.qml @@ -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 diff --git a/src/AutoPilotPlugins/PX4/CameraComponentSummary.qml b/src/AutoPilotPlugins/PX4/CameraComponentSummary.qml index 5d36514ee033d0753b027ab7d1f6e50f5d05a2e2..32130f2cc3c536595fa863cc52f82ba6ed4148da 100644 --- a/src/AutoPilotPlugins/PX4/CameraComponentSummary.qml +++ b/src/AutoPilotPlugins/PX4/CameraComponentSummary.qml @@ -22,7 +22,7 @@ FactPanel { Column { anchors.fill: parent - anchors.margins: 8 + anchors.margins: ScreenTools.defaultFontPixelWidth VehicleSummaryRow { labelText: qsTr("Trigger mode:") diff --git a/src/AutoPilotPlugins/PX4/FlightModesComponentSummary.qml b/src/AutoPilotPlugins/PX4/FlightModesComponentSummary.qml index 730c9dd859b01445af296523350a71e92ae13395..6744b54017bd23bda526626bef2d5c3c9c82d142 100644 --- a/src/AutoPilotPlugins/PX4/FlightModesComponentSummary.qml +++ b/src/AutoPilotPlugins/PX4/FlightModesComponentSummary.qml @@ -22,7 +22,7 @@ FactPanel { Loader { anchors.fill: parent - anchors.margins: 8 + anchors.margins: ScreenTools.defaultFontPixelWidth sourceComponent: _simpleMode ? simple : advanced } diff --git a/src/AutoPilotPlugins/PX4/PX4AdvancedFlightModes.qml b/src/AutoPilotPlugins/PX4/PX4AdvancedFlightModes.qml index e1a2d52c75099dbb8bf5ff2a8b9d18d1d5aa85fc..c0ff702d604a08b3e784d184ba763c55c75da85d 100644 --- a/src/AutoPilotPlugins/PX4/PX4AdvancedFlightModes.qml +++ b/src/AutoPilotPlugins/PX4/PX4AdvancedFlightModes.qml @@ -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 } diff --git a/src/AutoPilotPlugins/PX4/PX4RadioComponentSummary.qml b/src/AutoPilotPlugins/PX4/PX4RadioComponentSummary.qml index 00c6f527ccf9457f01dfdfdc98e0cbdafd546567..13b08b03803edfd121b747c9616bdb89cda36213 100644 --- a/src/AutoPilotPlugins/PX4/PX4RadioComponentSummary.qml +++ b/src/AutoPilotPlugins/PX4/PX4RadioComponentSummary.qml @@ -24,7 +24,7 @@ FactPanel { Column { anchors.fill: parent - anchors.margins: 8 + anchors.margins: ScreenTools.defaultFontPixelWidth VehicleSummaryRow { labelText: qsTr("Roll:") diff --git a/src/AutoPilotPlugins/PX4/PowerComponentSummary.qml b/src/AutoPilotPlugins/PX4/PowerComponentSummary.qml index 5c77f0a362f8fb8493a611b6d425b969946a3992..426605ee82338769fdee3d98281020e32b76f97e 100644 --- a/src/AutoPilotPlugins/PX4/PowerComponentSummary.qml +++ b/src/AutoPilotPlugins/PX4/PowerComponentSummary.qml @@ -47,7 +47,7 @@ FactPanel { Column { anchors.fill: parent - anchors.margins: 8 + anchors.margins: ScreenTools.defaultFontPixelWidth VehicleSummaryRow { labelText: qsTr("Battery Full:") diff --git a/src/AutoPilotPlugins/PX4/SafetyComponent.qml b/src/AutoPilotPlugins/PX4/SafetyComponent.qml index c8332748ff228d495282329159eb2140d375d8e5..24e300630ee7b5afd044fb3e094b534525f4641a 100644 --- a/src/AutoPilotPlugins/PX4/SafetyComponent.qml +++ b/src/AutoPilotPlugins/PX4/SafetyComponent.qml @@ -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") diff --git a/src/AutoPilotPlugins/PX4/SafetyComponentSummary.qml b/src/AutoPilotPlugins/PX4/SafetyComponentSummary.qml index e2be9d92cc8d5badf7568bfa12d82c4233ef1978..b7a534056db4b4e7de9013ecf784e617b34f9316 100644 --- a/src/AutoPilotPlugins/PX4/SafetyComponentSummary.qml +++ b/src/AutoPilotPlugins/PX4/SafetyComponentSummary.qml @@ -24,7 +24,7 @@ FactPanel { Column { anchors.fill: parent - anchors.margins: 8 + anchors.margins: ScreenTools.defaultFontPixelWidth VehicleSummaryRow { labelText: qsTr("RTL min alt:") diff --git a/src/AutoPilotPlugins/PX4/SensorsComponent.qml b/src/AutoPilotPlugins/PX4/SensorsComponent.qml index 986702f10898ed03b456ba7554a917c0224b9dc9..f6be8dc0cff65e36a8ffcc186250149b17ef8175 100644 --- a/src/AutoPilotPlugins/PX4/SensorsComponent.qml +++ b/src/AutoPilotPlugins/PX4/SensorsComponent.qml @@ -409,7 +409,7 @@ QGCView { anchors.left: orientationCalArea.left width: parent.width wrapMode: Text.WordWrap - font.pixelSize: ScreenTools.mediumFontPixelSize + font.pointSize: ScreenTools.mediumFontPointSize } Flow { diff --git a/src/AutoPilotPlugins/PX4/SensorsComponentSummaryFixedWing.qml b/src/AutoPilotPlugins/PX4/SensorsComponentSummaryFixedWing.qml index 8d8f45516aedaac0989aee797edcaf270aaeea31..6851b18832113fcdc848e15687e3900b128aac19 100644 --- a/src/AutoPilotPlugins/PX4/SensorsComponentSummaryFixedWing.qml +++ b/src/AutoPilotPlugins/PX4/SensorsComponentSummaryFixedWing.qml @@ -25,7 +25,7 @@ FactPanel { Column { anchors.fill: parent - anchors.margins: 8 + anchors.margins: ScreenTools.defaultFontPixelWidth VehicleSummaryRow { labelText: qsTr("Compass:") diff --git a/src/FlightDisplay/FlightDisplayViewVideo.qml b/src/FlightDisplay/FlightDisplayViewVideo.qml index e81f580da21d054446f6f15083d32b4f701ffb86..6022d8acb7ace90a64508c2d77d4b73011ddffc1 100644 --- a/src/FlightDisplay/FlightDisplayViewVideo.qml +++ b/src/FlightDisplay/FlightDisplayViewVideo.qml @@ -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 } diff --git a/src/FlightDisplay/FlightDisplayViewWidgets.qml b/src/FlightDisplay/FlightDisplayViewWidgets.qml index 81b182ab1c17bf5bfea6dd1ceac48732939d85b5..a12b934e7a543dd9ec084c514f1b6e5790101f3b 100644 --- a/src/FlightDisplay/FlightDisplayViewWidgets.qml +++ b/src/FlightDisplay/FlightDisplayViewWidgets.qml @@ -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 diff --git a/src/FlightMap/FlightMap.qml b/src/FlightMap/FlightMap.qml index d472a36c0193fb0acbee5f80e839c85136c7fc1a..46989b096f4518cd3c44038c0c64c5dc3c17a904 100644 --- a/src/FlightMap/FlightMap.qml +++ b/src/FlightMap/FlightMap.qml @@ -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 diff --git a/src/FlightMap/Widgets/QGCAttitudeHUD.qml b/src/FlightMap/Widgets/QGCAttitudeHUD.qml index d75536c7467a15445392650b3da391f01aefc380..7354720d1b89ae2ddb327376e2daa58d7a9a5151 100644 --- a/src/FlightMap/Widgets/QGCAttitudeHUD.qml +++ b/src/FlightMap/Widgets/QGCAttitudeHUD.qml @@ -85,6 +85,6 @@ Item { pitchAngle: _pitchAngle rollAngle: _rollAngle color: Qt.rgba(0,0,0,0) - size: ScreenTools.defaultFontPixelSize * (10) + size: ScreenTools.defaultFontPixelHeight * (10) } } diff --git a/src/FlightMap/Widgets/QGCCompassWidget.qml b/src/FlightMap/Widgets/QGCCompassWidget.qml index 2384e21de62cc39c044c8029cfc9a7ef91d47df1..4b12745f72f834bc85d1b291b0125b3a0e77125f 100644 --- a/src/FlightMap/Widgets/QGCCompassWidget.qml +++ b/src/FlightMap/Widgets/QGCCompassWidget.qml @@ -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 } diff --git a/src/FlightMap/Widgets/QGCInstrumentWidget.qml b/src/FlightMap/Widgets/QGCInstrumentWidget.qml index 829a907c4cd4ffecdabf0526aa699cfd0d151810..d7a2075a5970e8ec68c042347cdc27ece458afa6 100644 --- a/src/FlightMap/Widgets/QGCInstrumentWidget.qml +++ b/src/FlightMap/Widgets/QGCInstrumentWidget.qml @@ -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 } diff --git a/src/FlightMap/Widgets/QGCInstrumentWidgetAlternate.qml b/src/FlightMap/Widgets/QGCInstrumentWidgetAlternate.qml index 21b1b5ac7d26841adf1e090456963864a9685a9e..2b0aa4e0146d5d1f903a471a0c532088a7073c55 100644 --- a/src/FlightMap/Widgets/QGCInstrumentWidgetAlternate.qml +++ b/src/FlightMap/Widgets/QGCInstrumentWidgetAlternate.qml @@ -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 { diff --git a/src/FlightMap/Widgets/QGCPitchIndicator.qml b/src/FlightMap/Widgets/QGCPitchIndicator.qml index b3341ee493a579702d833f23abb18f0cbd1dba02..61f409a9824b05ab74ce9dbb7971b503ac5c5b18 100644 --- a/src/FlightMap/Widgets/QGCPitchIndicator.qml +++ b/src/FlightMap/Widgets/QGCPitchIndicator.qml @@ -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; text: _pitch color: "white" visible: (_pitch != 0) && ((_pitch % 10) === 0) diff --git a/src/FlightMap/Widgets/QGCSlider.qml b/src/FlightMap/Widgets/QGCSlider.qml index 65781dac44a8b2b671ed541bbe04f800d2babd99..2a2b4244959c2a980b1e2c2339dbc8ee15f801e8 100644 --- a/src/FlightMap/Widgets/QGCSlider.qml +++ b/src/FlightMap/Widgets/QGCSlider.qml @@ -52,15 +52,15 @@ Item { Rectangle { anchors.fill: parent - radius: ScreenTools.defaultFontPixelSize * (0.5) + radius: ScreenTools.defaultFontPixelHeight * (0.5) color: Qt.rgba(0,0,0,0.65); } Rectangle { anchors.left: parent.left - anchors.leftMargin: ScreenTools.defaultFontPixelSize * (0.33) - radius: ScreenTools.defaultFontPixelSize * (0.33) - height: ScreenTools.defaultFontPixelSize * (0.33) + anchors.leftMargin: ScreenTools.defaultFontPixelHeight * (0.33) + radius: ScreenTools.defaultFontPixelHeight * (0.33) + height: ScreenTools.defaultFontPixelHeight * (0.33) width: handle.x - x color: "#69bb17" anchors.verticalCenter: parent.verticalCenter @@ -69,21 +69,21 @@ Item { Rectangle { id: labelRect width: label.width - height: label.height + ScreenTools.defaultFontPixelSize * (0.33) - radius: ScreenTools.defaultFontPixelSize * (0.33) + height: label.height + ScreenTools.defaultFontPixelHeight * (0.33) + radius: ScreenTools.defaultFontPixelHeight * (0.33) smooth: true color: Qt.rgba(1,1,1,0.75); - border.width: ScreenTools.defaultFontPixelSize * (0.083) + border.width: ScreenTools.defaultFontPixelHeight * (0.083) border.color: Qt.rgba(0,0,0,0.45); anchors.bottom: handle.top - anchors.bottomMargin: ScreenTools.defaultFontPixelSize * (0.33) + anchors.bottomMargin: ScreenTools.defaultFontPixelHeight * (0.33) visible: mouseRegion.pressed x: Math.max(Math.min(handle.x + (handle.width - width ) / 2, slider.width - width), 0) QGCLabel{ id: label color: "black" text: slider.value.toFixed(2) - width: font.pixelSize * 3.5 + width: font.pointSize * 3.5 anchors.horizontalCenter: labelRect.horizontalCenter horizontalAlignment: Text.AlignHCenter anchors.verticalCenter: labelRect.verticalCenter @@ -93,7 +93,7 @@ Item { Rectangle { id: handle; smooth: true - width: ScreenTools.defaultFontPixelSize * (2.16); + width: ScreenTools.defaultFontPixelHeight * (2.16); y: (slider.height - height) / 2; x: (slider.value - slider.minimum) * slider.length / (slider.maximum - slider.minimum) diff --git a/src/FlightMap/Widgets/ValuesWidget.qml b/src/FlightMap/Widgets/ValuesWidget.qml index f53f740fe54d287c69610e451a582a354ae5af4e..8d3e5f9f770a145204f1b67abf6c3fbd63948ce5 100644 --- a/src/FlightMap/Widgets/ValuesWidget.qml +++ b/src/FlightMap/Widgets/ValuesWidget.qml @@ -79,7 +79,6 @@ QGCFlickable { model: _activeVehicle ? controller.largeValues : 0 Column { - id: valueColumn width: _largeColumn.width property Fact fact: _activeVehicle.getFact(modelData.replace("Vehicle.", "")) @@ -95,7 +94,7 @@ QGCFlickable { QGCLabel { width: parent.width horizontalAlignment: Text.AlignHCenter - font.pixelSize: ScreenTools.largeFontPixelSize * (largeValue ? 1.3 : 1.0) + font.pointSize: ScreenTools.mediumFontPointSize * (largeValue ? 1.3 : 1.0) font.family: largeValue ? ScreenTools.demiboldFontFamily : ScreenTools.normalFontFamily fontSizeMode: Text.HorizontalFit color: textColor @@ -117,7 +116,6 @@ QGCFlickable { model: _activeVehicle ? controller.smallValues : 0 Column { - id: valueColumn width: (_root.width / 2) - (_margins / 2) - 0.1 clip: true @@ -126,7 +124,7 @@ QGCFlickable { QGCLabel { width: parent.width horizontalAlignment: Text.AlignHCenter - font.pixelSize: ScreenTools.smallFontPixelSize + font.pointSize: ScreenTools.smallFontPointSize * 0.75 fontSizeMode: Text.HorizontalFit color: textColor text: fact.shortDescription @@ -141,7 +139,7 @@ QGCFlickable { QGCLabel { width: parent.width horizontalAlignment: Text.AlignHCenter - font.pixelSize: ScreenTools.smallFontPixelSize + font.pointSize: ScreenTools.smallFontPointSize * 0.75 fontSizeMode: Text.HorizontalFit color: textColor text: fact.units diff --git a/src/MissionEditor/MissionItemStatus.qml b/src/MissionEditor/MissionItemStatus.qml index 0819aa004714a58f9caba7173ec6437dd4732e13..f0f0b1d6ac30092e7fe165cdded7ccea7654b9e8 100644 --- a/src/MissionEditor/MissionItemStatus.qml +++ b/src/MissionEditor/MissionItemStatus.qml @@ -98,18 +98,18 @@ Rectangle { id: graphRow anchors.top: parent.top anchors.bottom: parent.bottom - spacing: ScreenTools.smallFontPixelWidth + spacing: ScreenTools.defaultFontPixelWidth * ScreenTools.smallFontPointRatio Repeater { model: missionItems Item { height: graphRow.height - width: ScreenTools.smallFontPixelWidth * 2 + width: ScreenTools.defaultFontPixelWidth * ScreenTools.smallFontPointRatio * 2 visible: object.specifiesCoordinate && !object.isStandaloneCoordinate - property real availableHeight: height - ScreenTools.smallFontPixelHeight - indicator.height + property real availableHeight: height - (ScreenTools.defaultFontPixelHeight * ScreenTools.smallFontPointRatio) - indicator.height property bool graphAbsolute: true @@ -128,7 +128,7 @@ Rectangle { QGCLabel { anchors.bottom: parent.bottom anchors.horizontalCenter: parent.horizontalCenter - font.pixelSize: ScreenTools.smallFontPixelSize + font.pointSize: ScreenTools.smallFontPointSize text: (object.relativeAltitude ? "" : "=") + object.coordinate.altitude.toFixed(0) } */ diff --git a/src/MissionEditor/SimpleItemEditor.qml b/src/MissionEditor/SimpleItemEditor.qml index d4a213a6cbd102d1ad603bee891a127cb20a60ac..f4d03a85ff632ea88f1f8b4b898cac5d2c049657 100644 --- a/src/MissionEditor/SimpleItemEditor.qml +++ b/src/MissionEditor/SimpleItemEditor.qml @@ -40,7 +40,7 @@ Rectangle { QGCLabel { width: parent.width wrapMode: Text.WordWrap - font.pixelSize: ScreenTools.smallFontPixelHeight + font.pointSize: ScreenTools.smallFontPointSize text: missionItem.sequenceNumber == 0 ? qsTr("Planned home position.") : (missionItem.rawEdit ? diff --git a/src/QmlControls/DropButton.qml b/src/QmlControls/DropButton.qml index cc3afb975106d565a170a935427c01a491826a85..d01f57aaefc4c0d737056930eb9f6b2330babc7c 100644 --- a/src/QmlControls/DropButton.qml +++ b/src/QmlControls/DropButton.qml @@ -11,7 +11,7 @@ Item { signal clicked() property alias buttonImage: roundButton.buttonImage property alias rotateImage: roundButton.rotateImage - property real radius: ScreenTools.isTinyScreen ? ScreenTools.defaultFontPixelHeight * 2.5 : ScreenTools.defaultFontPixelHeight * 1.5 + property real radius: ScreenTools.defaultFontPixelHeight * 1.5 property int dropDirection: dropDown property alias dropDownComponent: dropDownLoader.sourceComponent property real viewportMargins: 0 diff --git a/src/QmlControls/MissionCommandDialog.qml b/src/QmlControls/MissionCommandDialog.qml index 9a061beef548eeba84f6ac1be196c7dd01b544eb..49a595e124fd61d835fd9b557ec7b846b466c441 100644 --- a/src/QmlControls/MissionCommandDialog.qml +++ b/src/QmlControls/MissionCommandDialog.qml @@ -77,7 +77,7 @@ QGCViewDialog { delegate: Rectangle { width: parent.width - height: commandColumn.height + ScreenTools.defaultFontPixelSize + height: commandColumn.height + ScreenTools.defaultFontPixelHeight color: qgcPal.button property var mavCmdInfo: object diff --git a/src/QmlControls/MissionItemIndexLabel.qml b/src/QmlControls/MissionItemIndexLabel.qml index c56ff939b9509643fb659aa0d35dbbd535ce2f77..369b909322efcb1fed5f949cac72ca82efbdde88 100644 --- a/src/QmlControls/MissionItemIndexLabel.qml +++ b/src/QmlControls/MissionItemIndexLabel.qml @@ -19,7 +19,7 @@ Rectangle { border.color: "white" color: isCurrentItem ? "green" : qgcPal.mapButtonHighlight - property real _width: small ? ScreenTools.smallFontPixelSize * 1.5 : ScreenTools.mediumFontPixelSize * 1.5 + property real _width: small ? ScreenTools.smallFontPointSize * 1.5 : ScreenTools.mediumFontPointSize * 1.5 QGCPalette { id: qgcPal } @@ -35,6 +35,6 @@ Rectangle { horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignVCenter color: "white" - font.pixelSize: small ? ScreenTools.smallFontPixelSize : ScreenTools.mediumFontPixelSize + font.pointSize: small ? ScreenTools.smallFontPointSize : ScreenTools.mediumFontPointSize } } diff --git a/src/QmlControls/ParameterEditor.qml b/src/QmlControls/ParameterEditor.qml index 6193d65bae0278cc7547d4ad9b68cb0d54e08409..bef323c5d8df214aaa56918301c7fce9ed2d5691 100644 --- a/src/QmlControls/ParameterEditor.qml +++ b/src/QmlControls/ParameterEditor.qml @@ -43,7 +43,7 @@ QGCView { QGCPalette { id: __qgcPal; colorGroupEnabled: true } property Fact _editorDialogFact: Fact { } - property int _rowHeight: ScreenTools.isTinyScreen ? ScreenTools.defaultFontPixelHeight * 4 : ScreenTools.defaultFontPixelHeight * 2 + property int _rowHeight: 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 diff --git a/src/QmlControls/QGCButton.qml b/src/QmlControls/QGCButton.qml index 4c3fa2f68874c30a6d4111d7b9dcc15e4bf1edd3..3454e0cfba3e4b94cfcc5c0fc1df291b4d3a705c 100644 --- a/src/QmlControls/QGCButton.qml +++ b/src/QmlControls/QGCButton.qml @@ -50,8 +50,8 @@ Button { style: ButtonStyle { /*! The padding between the background and the label components. */ padding { - top: 4 - left: 4 + top: 4 + left: 4 right: control.menu !== null ? Math.round(TextSingleton.implicitHeight * 0.5) : 4 bottom: 4 } @@ -59,14 +59,8 @@ Button { /*! This defines the background of the button. */ background: Item { property bool down: control.pressed || (control.checkable && control.checked) - implicitWidth: Math.round(TextSingleton.implicitHeight * 4.5) - 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)) - } + implicitWidth: Math.round(TextSingleton.implicitHeight * 4.5) + implicitHeight: Math.max(25, Math.round(TextSingleton.implicitHeight * 1.2)) Rectangle { anchors.fill: parent @@ -90,7 +84,7 @@ Button { /*! This defines the label of the button. */ label: Item { - implicitWidth: row.implicitWidth + implicitWidth: row.implicitWidth implicitHeight: row.implicitHeight baselineOffset: row.y + text.y + text.baselineOffset @@ -108,7 +102,7 @@ Button { id: text antialiasing: true text: control.text - font.pixelSize: ScreenTools.defaultFontPixelSize + font.pointSize: ScreenTools.defaultFontPointSize font.family: ScreenTools.normalFontFamily anchors.verticalCenter: parent.verticalCenter color: _showHighlight ? diff --git a/src/QmlControls/QGCCheckBox.qml b/src/QmlControls/QGCCheckBox.qml index 2d20c57f21bb553b72f709a9b269a86486a17bbe..f57d521439e7aedee6728a65a832460c2b2b317f 100644 --- a/src/QmlControls/QGCCheckBox.qml +++ b/src/QmlControls/QGCCheckBox.qml @@ -29,7 +29,7 @@ CheckBox { id: text text: control.text antialiasing: true - font.pixelSize: ScreenTools.defaultFontPixelSize + font.pointSize: ScreenTools.defaultFontPointSize font.family: ScreenTools.normalFontFamily color: control.__qgcPal.text anchors.verticalCenter: parent.verticalCenter diff --git a/src/QmlControls/QGCComboBox.qml b/src/QmlControls/QGCComboBox.qml index ecd13579dc899e484ccdb2c3228c9015f20a7769..0101d07c2f040a993b2cc40c899554ab3b6ec340 100644 --- a/src/QmlControls/QGCComboBox.qml +++ b/src/QmlControls/QGCComboBox.qml @@ -12,20 +12,14 @@ ComboBox { property bool _showBorder: _qgcPal.globalTheme == QGCPalette.Light style: ComboBoxStyle { - font.pixelSize: ScreenTools.defaultFontPixelSize + font.pointSize: ScreenTools.defaultFontPointSize textColor: _showHighlight ? control._qgcPal.buttonHighlightText : control._qgcPal.buttonText background: Item { implicitWidth: Math.round(TextSingleton.implicitHeight * 4.5) - 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)) - } + implicitHeight: Math.max(25, Math.round(TextSingleton.implicitHeight * 1.2)) Rectangle { anchors.fill: parent diff --git a/src/QmlControls/QGCLabel.qml b/src/QmlControls/QGCLabel.qml index 63faf1c6b0a4163628f9d47774662a37ada00426..86ab756be34b78fac0cc8983ae9f735f5aa76419 100644 --- a/src/QmlControls/QGCLabel.qml +++ b/src/QmlControls/QGCLabel.qml @@ -10,7 +10,7 @@ Text { property bool enabled: true - font.pixelSize: ScreenTools.defaultFontPixelSize + font.pointSize: ScreenTools.defaultFontPointSize font.family: ScreenTools.normalFontFamily color: __qgcPal.text antialiasing: true diff --git a/src/QmlControls/QGCMovableItem.qml b/src/QmlControls/QGCMovableItem.qml index 0c363b22ee8e10c09fd7922b808161b897eec17f..afffce8a4f7973505344959b0ae020f79d351329 100644 --- a/src/QmlControls/QGCMovableItem.qml +++ b/src/QmlControls/QGCMovableItem.qml @@ -9,8 +9,8 @@ import QGroundControl.ScreenTools 1.0 Item { id: root property bool allowDragging: true - property real minimumWidth: ScreenTools.defaultFontPixelSize * (5) - property real minimumHeight: ScreenTools.defaultFontPixelSize * (5) + property real minimumWidth: ScreenTools.defaultFontPixelHeight * (5) + property real minimumHeight: ScreenTools.defaultFontPixelHeight * (5) property alias tForm: tform signal resetRequested() transform: Scale { diff --git a/src/QmlControls/QGCPipable.qml b/src/QmlControls/QGCPipable.qml index 29de052b9938273ea73a920312759172bb50ed2c..74284986c116c490b1000da6d572431abcb53925 100644 --- a/src/QmlControls/QGCPipable.qml +++ b/src/QmlControls/QGCPipable.qml @@ -55,8 +55,8 @@ Item { anchors.left: parent.left anchors.bottom: parent.bottom visible: !isHidden - height: ScreenTools.defaultFontPixelSize * 2.5 - width: ScreenTools.defaultFontPixelSize * 2.5 + height: ScreenTools.defaultFontPixelHeight * 2.5 + width: ScreenTools.defaultFontPixelHeight * 2.5 MouseArea { anchors.fill: parent onClicked: { @@ -70,9 +70,9 @@ Item { id: openPIP anchors.left : parent.left anchors.bottom: parent.bottom - height: ScreenTools.defaultFontPixelSize * 2 - width: ScreenTools.defaultFontPixelSize * 2 - radius: ScreenTools.defaultFontPixelSize / 3 + height: ScreenTools.defaultFontPixelHeight * 2 + width: ScreenTools.defaultFontPixelHeight * 2 + radius: ScreenTools.defaultFontPixelHeight / 3 visible: isHidden color: isDark ? Qt.rgba(0,0,0,0.75) : Qt.rgba(0,0,0,0.5) Image { diff --git a/src/QmlControls/QGCRadioButton.qml b/src/QmlControls/QGCRadioButton.qml index 67012e1c91e660b55c6b5402978ad44eb7a9679a..85b156295c72024fd40fffae1908593ca53ddf4a 100644 --- a/src/QmlControls/QGCRadioButton.qml +++ b/src/QmlControls/QGCRadioButton.qml @@ -28,7 +28,7 @@ RadioButton { Text { id: text text: control.text - font.pixelSize: ScreenTools.defaultFontPixelSize + font.pointSize: ScreenTools.defaultFontPointSize font.family: ScreenTools.normalFontFamily antialiasing: true color: control.__qgcPal.text diff --git a/src/QmlControls/QGCTextField.qml b/src/QmlControls/QGCTextField.qml index bdce66410281f06a0dd4861d276465c134fba0ee..9fb593e9948d79b0c45e58ac37c21ace3aaeb3b9 100644 --- a/src/QmlControls/QGCTextField.qml +++ b/src/QmlControls/QGCTextField.qml @@ -19,15 +19,8 @@ TextField { property var __qgcPal: QGCPalette { colorGroupEnabled: enabled } - textColor: __qgcPal.textFieldText - - height: { - if(ScreenTools.isTinyScreen) - return ScreenTools.defaultFontPixelHeight * 3.5 - if(ScreenTools.isMobile) - return ScreenTools.defaultFontPixelHeight * 2.5 - return implicitHeight - } + textColor: __qgcPal.textFieldText + height: Math.max(25, Math.round(TextSingleton.implicitHeight * 1.2)) Label { id: unitsLabelWidthGenerator @@ -39,7 +32,7 @@ TextField { } style: TextFieldStyle { - font.pixelSize: ScreenTools.defaultFontPixelSize + font.pointSize: ScreenTools.defaultFontPointSize background: Item { id: backgroundItem @@ -68,7 +61,7 @@ TextField { width: unitsLabelWidthGenerator.width text: control.unitsLabel - font.pixelSize: ScreenTools.defaultFontPixelSize + font.pointSize: ScreenTools.defaultFontPointSize font.family: ScreenTools.normalFontFamily antialiasing: true diff --git a/src/QmlControls/RoundButton.qml b/src/QmlControls/RoundButton.qml index eee77ea5d22fd459132bb9f8139e4dbda0465c1c..005067a50939a971fabfd832ccf5983dda033305 100644 --- a/src/QmlControls/RoundButton.qml +++ b/src/QmlControls/RoundButton.qml @@ -10,7 +10,7 @@ Item { signal clicked() property alias buttonImage: button.source - property real radius: ScreenTools.isTinyScreen ? ScreenTools.defaultFontPixelHeight * 2.5 : ScreenTools.defaultFontPixelHeight * 1.5 + property real radius: ScreenTools.defaultFontPixelHeight * 1.5 property bool rotateImage: false property bool lightBorders: true diff --git a/src/QmlControls/ScreenTools.qml b/src/QmlControls/ScreenTools.qml index 93b88a1af91a9004fd58fbe373da1aee1b3a81b9..99ae0f6ddd25c295c253f3a5966cd7ccd1fd41ae 100644 --- a/src/QmlControls/ScreenTools.qml +++ b/src/QmlControls/ScreenTools.qml @@ -7,36 +7,31 @@ import QtQuick.Window 2.2 import QGroundControl.ScreenToolsController 1.0 Item { + id: _screenTools + signal repaintRequested property real availableHeight: 0 - property real defaultFontPixelSize: 1 + property real defaultFontPointSize: 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 + property real smallFontPointSize: 1 + property real mediumFontPointSize: 1 + property real largeFontPointSize: 1 - readonly property real _defaultFontHeight: 16 - readonly property real fontHRatio: isTinyScreen ? (_textMeasure.contentHeight / _defaultFontHeight) * 0.75 : (_textMeasure.contentHeight / _defaultFontHeight) - readonly property real realFontHeight: _textMeasure.contentHeight - readonly property real realFontWidth : _textMeasure.contentWidth + readonly property real smallFontPointRatio: 0.75 + readonly property real mediumFontPointRatio: 1.25 + readonly property real largeFontPointRatio: 1.5 - // 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) + // Font scaling based on system font + readonly property real fontHRatio: _textMeasure.fontHeight / _defaultFont.fontHeight property bool isAndroid: ScreenToolsController.isAndroid property bool isiOS: ScreenToolsController.isiOS property bool isMobile: ScreenToolsController.isMobile property bool isDebug: ScreenToolsController.isDebug - property bool isTinyScreen: (Screen.width / Screen.pixelDensity) < 120 // 120mm + 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" @@ -50,32 +45,45 @@ Item { return ScreenToolsController.mouseY() } + Text { + id: _defaultFont + text: "X" + property real fontHeight: contentHeight + } + 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 + font.pointSize: { + if(ScreenToolsController.isMobile) { + // Small Devices + if((Screen.width / Screen.pixelDensity) < 120) { + return 11; + // iOS + } else if(ScreenToolsController.isiOS) { + return 13; + // Android + } else { + return 14; + } + } else { + //-- Linux and Mac OS we use a slightly smaller font + if(ScreenToolsController.isMacOS || ScreenToolsController.isLinux) + return _defaultFont.font.pointSize - 1 + else + return _defaultFont.font.pointSize } - 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 + } + property real fontWidth: contentWidth + property real fontHeight: contentHeight + Component.onCompleted: { + defaultFontPointSize = _textMeasure.font.pointSize + defaultFontPixelHeight = _textMeasure.fontHeight + defaultFontPixelWidth = _textMeasure.fontWidth + smallFontPointSize = defaultFontPointSize * _screenTools.smallFontPointRatio + mediumFontPointSize = defaultFontPointSize * _screenTools.mediumFontPointRatio + largeFontPointSize = defaultFontPointSize * _screenTools.largeFontPointRatio } } } diff --git a/src/QmlControls/ScreenToolsController.cc b/src/QmlControls/ScreenToolsController.cc index 856397852d42d68f82bdfaf13a9e39d028686f4d..035f053b637c3899beb494b406aaf94b5d798e3b 100644 --- a/src/QmlControls/ScreenToolsController.cc +++ b/src/QmlControls/ScreenToolsController.cc @@ -22,27 +22,12 @@ ======================================================================*/ /// @file -/// @author Gus Grubba +/// @author Gus Grubba #include "ScreenToolsController.h" #include -#ifdef Q_OS_WIN -const double ScreenToolsController::_defaultFontPixelSizeRatio = 1.0; -#elif __android__ -const double ScreenToolsController::_defaultFontPixelSizeRatio = 1.0; -#elif __ios__ -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 - -const double ScreenToolsController::_smallFontPixelSizeRatio = 0.75; -const double ScreenToolsController::_mediumFontPixelSizeRatio = 1.22; -const double ScreenToolsController::_largeFontPixelSizeRatio = 1.66; - ScreenToolsController::ScreenToolsController() { + } diff --git a/src/QmlControls/ScreenToolsController.h b/src/QmlControls/ScreenToolsController.h index 6d8807f69f905918db0210de72a68467abb4b001..06348bf560af30b5112c497e31673166a38d3e53 100644 --- a/src/QmlControls/ScreenToolsController.h +++ b/src/QmlControls/ScreenToolsController.h @@ -28,16 +28,11 @@ #define ScreenToolsController_H #include "QGCApplication.h" - #include #include /*! @brief Screen helper tools for QML widgets - To use its functions, you need to import the module with the following line: - @code - - @endcode */ /// This Qml control is used to return screen parameters @@ -52,58 +47,43 @@ public: Q_PROPERTY(bool isMobile READ isMobile CONSTANT) Q_PROPERTY(bool testHighDPI READ testHighDPI CONSTANT) Q_PROPERTY(bool isDebug READ isDebug CONSTANT) - - //! Used to trigger a \c Canvas element repaint. - /*! - There is a bug as of Qt 5.4 where a Canvas element defined within a QQuickWidget does not receive - repaint events. QGC's main window will emit these signals when a \c Canvas element needs to be - repainted. - If you use a \c Canvas element inside some QML widget, you can use this code to handle repaint: - @code - import QGroundControl.ScreenToolsController 1.0 - ... - Canvas { - id: myCanvas - height: 40 - width: 40 - Connections { - target: ScreenToolsController - onRepaintRequestedChanged: { - myCanvas.requestPaint(); - } - } - onPaint: { - var context = getContext("2d"); - ... - } - } - @endcode - */ + Q_PROPERTY(bool isMacOS READ isMacOS CONSTANT) + Q_PROPERTY(bool isLinux READ isLinux CONSTANT) // Returns current mouse position Q_INVOKABLE int mouseX(void) { return QCursor::pos().x(); } Q_INVOKABLE int mouseY(void) { return QCursor::pos().y(); } - // Used to adjust default font size on an OS basis - Q_PROPERTY(double defaultFontPixelSizeRatio MEMBER _defaultFontPixelSizeRatio CONSTANT) - - // Used to calculate font sizes based on default font size - Q_PROPERTY(double smallFontPixelSizeRatio MEMBER _smallFontPixelSizeRatio CONSTANT) - Q_PROPERTY(double mediumFontPixelSizeRatio MEMBER _mediumFontPixelSizeRatio CONSTANT) - Q_PROPERTY(double largeFontPixelSizeRatio MEMBER _largeFontPixelSizeRatio CONSTANT) - #if defined (__android__) bool isAndroid () { return true; } bool isiOS () { return false; } bool isMobile () { return true; } + bool isLinux () { return false; } + bool isMacOS () { return false; } #elif defined(__ios__) bool isAndroid () { return false; } bool isiOS () { return true; } bool isMobile () { return true; } + bool isLinux () { return false; } + bool isMacOS () { return false; } +#elif defined(__macos__) + bool isAndroid () { return false; } + bool isiOS () { return false; } + bool isMobile () { return qgcApp()->fakeMobile(); } + bool isLinux () { return false; } + bool isMacOS () { return true; } +#elif defined(Q_OS_LINUX) + bool isAndroid () { return false; } + bool isiOS () { return false; } + bool isMobile () { return qgcApp()->fakeMobile(); } + bool isLinux () { return true; } + bool isMacOS () { return false; } #else bool isAndroid () { return false; } bool isiOS () { return false; } bool isMobile () { return qgcApp()->fakeMobile(); } + bool isLinux () { return false; } + bool isMacOS () { return false; } #endif #ifdef QT_DEBUG @@ -114,11 +94,6 @@ public: bool testHighDPI () { return false; } #endif -private: - static const double _defaultFontPixelSizeRatio; - static const double _smallFontPixelSizeRatio; - static const double _mediumFontPixelSizeRatio; - static const double _largeFontPixelSizeRatio; }; #endif diff --git a/src/QmlControls/SubMenuButton.qml b/src/QmlControls/SubMenuButton.qml index 5adf22a1f984eb63d823a72476566a5de1cb2e48..4d4538b13205b3f06d330ce2c93b98c89894ec92 100644 --- a/src/QmlControls/SubMenuButton.qml +++ b/src/QmlControls/SubMenuButton.qml @@ -14,7 +14,7 @@ Button { text: "Button" ///< Pass in your own button text checkable: true - implicitHeight: ScreenTools.isTinyScreen ? ScreenTools.defaultFontPixelHeight * 5 : ScreenTools.defaultFontPixelHeight * 2.5 + implicitHeight: ScreenTools.defaultFontPixelHeight * 2.5 style: ButtonStyle { id: buttonStyle diff --git a/src/QmlControls/VehicleRotationCal.qml b/src/QmlControls/VehicleRotationCal.qml index a4298c8cfb805ae5a10e9616875c9b6b3db3ddfb..7a7fd3862165b31373d9c88da52db73be68d7150 100644 --- a/src/QmlControls/VehicleRotationCal.qml +++ b/src/QmlControls/VehicleRotationCal.qml @@ -69,7 +69,7 @@ Rectangle { height: parent.height horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignBottom - font.pixelSize: ScreenTools.mediumFontPixelSize + font.pointSize: ScreenTools.mediumFontPointSize text: calInProgress ? calInProgressText : (calValid ? qsTr("Completed") : qsTr("Incomplete")) } } diff --git a/src/QtLocationPlugin/QMLControl/OfflineMap.qml b/src/QtLocationPlugin/QMLControl/OfflineMap.qml index 1e7de50facd4572371e22e3479c742a840fbe8b4..75da0332e1f0df24671a30c132f3ecfb64cc1641 100644 --- a/src/QtLocationPlugin/QMLControl/OfflineMap.qml +++ b/src/QtLocationPlugin/QMLControl/OfflineMap.qml @@ -54,8 +54,8 @@ Rectangle { property string savedMapType: "" property real _newSetMiddleLabel: ScreenTools.isTinyScreen ? ScreenTools.defaultFontPixelWidth * 10 : ScreenTools.defaultFontPixelWidth * 14 - property real _newSetMiddleField: ScreenTools.isTinyScreen ? ScreenTools.defaultFontPixelWidth * 18 : ScreenTools.defaultFontPixelWidth * 20 - property real _netSetSliderWidth: ScreenTools.isTinyScreen ? ScreenTools.defaultFontPixelWidth * 12 : ScreenTools.defaultFontPixelWidth * 14 + property real _newSetMiddleField: ScreenTools.isTinyScreen ? ScreenTools.defaultFontPixelWidth * 16 : ScreenTools.defaultFontPixelWidth * 20 + property real _netSetSliderWidth: ScreenTools.isTinyScreen ? ScreenTools.defaultFontPixelWidth * 8 : ScreenTools.defaultFontPixelWidth * 14 property real oldlon0: 0 property real oldlon1: 0 @@ -244,14 +244,14 @@ Rectangle { QGCLabel { id: labelTitle text: qsTr("Offline Maps") - font.pixelSize: ScreenTools.mediumFontPixelSize + font.pointSize: ScreenTools.mediumFontPointSize anchors.verticalCenter: parent.verticalCenter } QGCCheckBox { id: showTilePreview text: qsTr("Show tile min/max zoom level preview") checked: false - visible: _mapView.visible + visible: _mapView.visible && !ScreenTools.isTinyScreen anchors.verticalCenter: parent.verticalCenter } } @@ -334,7 +334,7 @@ Rectangle { text: qsTr("Add new set") anchors.left: parent.left anchors.right: parent.right - height: ScreenTools.isTinyScreen ? ScreenTools.defaultFontPixelHeight * 4 : ScreenTools.defaultFontPixelHeight * 2 + height: ScreenTools.defaultFontPixelHeight * 2 onClicked: { _offlineMapRoot._currentSelection = null showMap() @@ -348,7 +348,7 @@ Rectangle { complete: object.complete anchors.left: parent.left anchors.right: parent.right - height: ScreenTools.isTinyScreen ? ScreenTools.defaultFontPixelHeight * 4 : ScreenTools.defaultFontPixelHeight * 2 + height: ScreenTools.defaultFontPixelHeight * 2 onClicked: { _offlineMapRoot._currentSelection = object showInfo() @@ -381,6 +381,7 @@ Rectangle { Item { width: parent.width anchors.top: parent.top + visible: showTilePreview.checked Rectangle { width: ScreenTools.defaultFontPixelHeight * 16 height: ScreenTools.defaultFontPixelHeight * 9 @@ -388,7 +389,6 @@ Rectangle { anchors.left: parent.left anchors.margins: ScreenTools.defaultFontPixelHeight color: "black" - visible: showTilePreview.checked Map { id: _mapMin anchors.fill: parent @@ -407,7 +407,6 @@ Rectangle { anchors.right: parent.right anchors.margins: ScreenTools.defaultFontPixelHeight color: "black" - visible: showTilePreview.checked Map { id: _mapMax anchors.fill: parent @@ -437,37 +436,37 @@ Rectangle { anchors.centerIn: parent spacing: ScreenTools.defaultFontPixelWidth * 0.5 Rectangle { - height: _zoomRow.height + ScreenTools.defaultFontPixelHeight * 1.5 - width: _zoomRow.width + ScreenTools.defaultFontPixelWidth - color: "#98aca4" - border.color: "black" - border.width: 2 + height: _zoomRow.height + ScreenTools.defaultFontPixelHeight * 1.5 + width: _zoomRow.width + ScreenTools.defaultFontPixelWidth + color: "#98aca4" + border.color: "black" + border.width: 2 radius: ScreenTools.defaultFontPixelWidth * 0.5 anchors.verticalCenter: parent.verticalCenter Row { - id: _zoomRow + id: _zoomRow anchors.centerIn: parent Column { - spacing: ScreenTools.defaultFontPixelHeight * 0.5 + spacing: ScreenTools.defaultFontPixelHeight * 0.5 anchors.verticalCenter: parent.verticalCenter Row { - spacing: ScreenTools.defaultFontPixelWidth * 0.5 + spacing: ScreenTools.defaultFontPixelWidth * 0.5 Column { anchors.verticalCenter: parent.verticalCenter Label { text: qsTr("Min") color: "black" - width: ScreenTools.defaultFontPixelWidth * 5 - font.pixelSize: ScreenTools.smallFontPixelSize + width: ScreenTools.defaultFontPixelWidth * 4 + font.pointSize: ScreenTools.smallFontPointSize horizontalAlignment: Text.AlignHCenter font.family: ScreenTools.normalFontFamily } Label { text: qsTr("Zoom") color: "black" - width: ScreenTools.defaultFontPixelWidth * 5 + width: ScreenTools.defaultFontPixelWidth * 4 font.family: ScreenTools.normalFontFamily - font.pixelSize: ScreenTools.smallFontPixelSize + font.pointSize: ScreenTools.smallFontPointSize horizontalAlignment: Text.AlignHCenter } } @@ -482,7 +481,7 @@ Rectangle { anchors.verticalCenter: parent.verticalCenter style: SliderStyle { groove: Rectangle { - implicitWidth: ScreenTools.defaultFontPixelWidth * 14 + implicitWidth: _netSetSliderWidth implicitHeight: 4 color: "gray" radius: 4 @@ -492,13 +491,14 @@ Rectangle { color: control.pressed ? "white" : "lightgray" border.color: "gray" border.width: 2 - implicitWidth: ScreenTools.isAndroid ? 60 : 30 - implicitHeight: ScreenTools.isAndroid ? 60 : 30 + implicitWidth: ScreenTools.defaultFontPixelWidth * 3 + implicitHeight: ScreenTools.defaultFontPixelWidth * 3 radius: 10 Label { text: _slider0.value anchors.centerIn: parent font.family: ScreenTools.normalFontFamily + font.pointSize: ScreenTools.smallFontPointSize } } } @@ -524,16 +524,16 @@ Rectangle { Label { text: qsTr("Max") color: "black" - width: ScreenTools.defaultFontPixelWidth * 5 - font.pixelSize: ScreenTools.smallFontPixelSize + width: ScreenTools.defaultFontPixelWidth * 4 + font.pointSize: ScreenTools.smallFontPointSize font.family: ScreenTools.normalFontFamily horizontalAlignment: Text.AlignHCenter } Label { text: qsTr("Zoom") color: "black" - width: ScreenTools.defaultFontPixelWidth * 5 - font.pixelSize: ScreenTools.smallFontPixelSize + width: ScreenTools.defaultFontPixelWidth * 4 + font.pointSize: ScreenTools.smallFontPointSize font.family: ScreenTools.normalFontFamily horizontalAlignment: Text.AlignHCenter } @@ -549,7 +549,7 @@ Rectangle { anchors.verticalCenter: parent.verticalCenter style: SliderStyle { groove: Rectangle { - implicitWidth: ScreenTools.defaultFontPixelWidth * 14 + implicitWidth: _netSetSliderWidth implicitHeight: 4 color: "gray" radius: 4 @@ -559,13 +559,14 @@ Rectangle { color: control.pressed ? "white" : "lightgray" border.color: "gray" border.width: 2 - implicitWidth: ScreenTools.isAndroid ? 60 : 30 - implicitHeight: ScreenTools.isAndroid ? 60 : 30 + implicitWidth: ScreenTools.defaultFontPixelWidth * 3 + implicitHeight: ScreenTools.defaultFontPixelWidth * 3 radius: 10 Label { text: _slider1.value - font.family: ScreenTools.normalFontFamily anchors.centerIn: parent + font.family: ScreenTools.normalFontFamily + font.pointSize: ScreenTools.smallFontPointSize } } } @@ -590,7 +591,7 @@ Rectangle { text: qsTr("Tile Count") color: "black" width: ScreenTools.defaultFontPixelWidth * 12 - font.pixelSize: ScreenTools.smallFontPixelSize + font.pointSize: ScreenTools.smallFontPointSize font.family: ScreenTools.normalFontFamily horizontalAlignment: Text.AlignHCenter } @@ -599,13 +600,14 @@ Rectangle { color: "black" width: ScreenTools.defaultFontPixelWidth * 12 font.family: ScreenTools.normalFontFamily + font.pointSize: ScreenTools.defaultFontPointSize horizontalAlignment: Text.AlignHCenter } Label { text: qsTr("Set Size (Est)") color: "black" width: ScreenTools.defaultFontPixelWidth * 12 - font.pixelSize: ScreenTools.smallFontPixelSize + font.pointSize: ScreenTools.smallFontPointSize font.family: ScreenTools.normalFontFamily horizontalAlignment: Text.AlignHCenter } @@ -614,6 +616,7 @@ Rectangle { color: "black" width: ScreenTools.defaultFontPixelWidth * 12 font.family: ScreenTools.normalFontFamily + font.pointSize: ScreenTools.defaultFontPointSize horizontalAlignment: Text.AlignHCenter } } @@ -690,7 +693,7 @@ Rectangle { QGCButton { text: qsTr("Download") enabled: setName.text.length > 0 - width: ScreenTools.defaultFontPixelWidth * 12 + width: ScreenTools.defaultFontPixelWidth * 10 onClicked: { if(QGroundControl.mapEngineManager.findName(setName.text)) { duplicateName.visible = true @@ -707,7 +710,7 @@ Rectangle { } QGCButton { text: qsTr("Cancel") - width: ScreenTools.defaultFontPixelWidth * 12 + width: ScreenTools.defaultFontPixelWidth * 10 onClicked: { showList() } @@ -760,7 +763,7 @@ Rectangle { spacing: ScreenTools.defaultFontPixelHeight * 0.5 QGCLabel { text: _offlineMapRoot._currentSelection ? _offlineMapRoot._currentSelection.name : "" - font.pixelSize: ScreenTools.isAndroid ? ScreenTools.mediumFontPixelSize : ScreenTools.largeFontPixelSize + font.pointSize: ScreenTools.isAndroid ? ScreenTools.mediumFontPointSize : ScreenTools.largeFontPointSize anchors.horizontalCenter: parent.horizontalCenter } QGCLabel { @@ -918,7 +921,7 @@ Rectangle { QGCLabel { id: nameLabel text: _offlineMapRoot._currentSelection ? _offlineMapRoot._currentSelection.name : "" - font.pixelSize: ScreenTools.isAndroid ? ScreenTools.mediumFontPixelSize : ScreenTools.largeFontPixelSize + font.pointSize: ScreenTools.isAndroid ? ScreenTools.mediumFontPointSize : ScreenTools.largeFontPointSize anchors.horizontalCenter: parent.horizontalCenter } QGCLabel { @@ -968,10 +971,6 @@ Rectangle { } } } - Item { - height: ScreenTools.defaultFontPixelHeight * 0.5 - width: 1 - } Row { anchors.horizontalCenter: parent.horizontalCenter spacing: ScreenTools.defaultFontPixelWidth @@ -1051,7 +1050,7 @@ Rectangle { QGCLabel { id: optionsLabel text: qsTr("Offline Map Options") - font.pixelSize: ScreenTools.largeFontPixelSize + font.pointSize: ScreenTools.largeFontPointSize anchors.centerIn: parent } } @@ -1094,7 +1093,7 @@ Rectangle { QGCLabel { anchors.centerIn: parent text: qsTr("Memory cache changes require a restart to take effect.") - font.pixelSize: ScreenTools.defaultFontPixelSize * 0.85 + font.pointSize: ScreenTools.defaultFontPointSize * 0.85 } } Rectangle { @@ -1119,7 +1118,7 @@ Rectangle { QGCLabel { anchors.centerIn: parent text: qsTr("With an access token, you can use MapBox Maps.") - font.pixelSize: ScreenTools.defaultFontPixelSize * 0.85 + font.pointSize: ScreenTools.defaultFontPointSize * 0.85 } } } diff --git a/src/VehicleSetup/FirmwareUpgrade.qml b/src/VehicleSetup/FirmwareUpgrade.qml index 74e285f95a06e252a6a36c950a80e9dab9456ff9..abf3e114cfeaf9b46f9f37205ac8171c38162583 100644 --- a/src/VehicleSetup/FirmwareUpgrade.qml +++ b/src/VehicleSetup/FirmwareUpgrade.qml @@ -341,7 +341,7 @@ QGCView { QGCLabel { id: titleLabel text: title - font.pixelSize: ScreenTools.mediumFontPixelSize + font.pointSize: ScreenTools.mediumFontPointSize } ProgressBar { @@ -359,7 +359,7 @@ QGCView { width: parent.width readOnly: true frameVisible: false - font.pixelSize: ScreenTools.defaultFontPixelSize + font.pointSize: ScreenTools.defaultFontPointSize textFormat: TextEdit.RichText text: welcomeText diff --git a/src/VehicleSetup/JoystickConfig.qml b/src/VehicleSetup/JoystickConfig.qml index ec0b154873d0c5a2e03b64588e53891677a03aa5..0227a67494cd2dacb357f58b752ba1e8aa8afe7d 100644 --- a/src/VehicleSetup/JoystickConfig.qml +++ b/src/VehicleSetup/JoystickConfig.qml @@ -149,7 +149,7 @@ QGCView { QGCLabel { id: header - font.pixelSize: ScreenTools.mediumFontPixelSize + font.pointSize: ScreenTools.mediumFontPointSize text: qsTr("JOYSTICK") } diff --git a/src/VehicleSetup/SetupView.qml b/src/VehicleSetup/SetupView.qml index 843ff3b9763d64e1a47da3916f8d1696a8892c79..52db2303dbfef6e5695231af5fc04d70de13e437 100644 --- a/src/VehicleSetup/SetupView.qml +++ b/src/VehicleSetup/SetupView.qml @@ -151,7 +151,7 @@ Rectangle { verticalAlignment: Text.AlignVCenter horizontalAlignment: Text.AlignHCenter wrapMode: Text.WordWrap - font.pixelSize: ScreenTools.mediumFontPixelSize + font.pointSize: ScreenTools.mediumFontPointSize text: "QGroundControl does not currently support setup of your vehicle type. " + "If your vehicle is already configured you can still Fly." @@ -172,7 +172,7 @@ Rectangle { verticalAlignment: Text.AlignVCenter horizontalAlignment: Text.AlignHCenter wrapMode: Text.WordWrap - font.pixelSize: ScreenTools.largeFontPixelSize + font.pointSize: ScreenTools.largeFontPointSize text: "Connect vehicle to your device and QGroundControl will automatically detect it." + (ScreenTools.isMobile ? "" : " Click Firmware on the left to upgrade your vehicle.") @@ -192,7 +192,7 @@ Rectangle { verticalAlignment: Text.AlignVCenter horizontalAlignment: Text.AlignHCenter wrapMode: Text.WordWrap - font.pixelSize: ScreenTools.mediumFontPixelSize + font.pointSize: ScreenTools.mediumFontPointSize text: "You are currently connected to a vehicle, but that vehicle did not return back the full parameter list. " + "Because of this the full set of vehicle setup options are not available." @@ -211,7 +211,7 @@ Rectangle { verticalAlignment: Text.AlignVCenter horizontalAlignment: Text.AlignHCenter wrapMode: Text.WordWrap - font.pixelSize: ScreenTools.mediumFontPixelSize + font.pointSize: ScreenTools.mediumFontPointSize text: _messagePanelText } } diff --git a/src/VehicleSetup/VehicleSummary.qml b/src/VehicleSetup/VehicleSummary.qml index ebe10e344c2f67e21765be970a547e1c09dc0e0b..8cc150ba8e30e05b7cd449ad86e96fc6789afc77 100644 --- a/src/VehicleSetup/VehicleSummary.qml +++ b/src/VehicleSetup/VehicleSummary.qml @@ -113,7 +113,7 @@ Rectangle { // Outer summary item rectangle Rectangle { width: _summaryBoxWidth - height: ScreenTools.isTinyScreen ? ScreenTools.defaultFontPixelHeight * 20 : ScreenTools.defaultFontPixelHeight * 13 + height: ScreenTools.defaultFontPixelHeight * 13 color: qgcPal.windowShade visible: modelData.summaryQmlSource.toString() !== "" border.width: 1 @@ -122,7 +122,7 @@ Rectangle { border.color = Qt.rgba(border.color.r, border.color.g, border.color.b, 0.1) } - readonly property real titleHeight: ScreenTools.isTinyScreen ? ScreenTools.defaultFontPixelHeight * 4 : ScreenTools.defaultFontPixelHeight * 2 + readonly property real titleHeight: ScreenTools.defaultFontPixelHeight * 2 // Title bar QGCButton { diff --git a/src/ui/MainWindowInner.qml b/src/ui/MainWindowInner.qml index 5c30bb1e998577958c09e6873260d6452a366ac5..b65b7fd1b4f63022d31c51b393244ee18825e9f5 100644 --- a/src/ui/MainWindowInner.qml +++ b/src/ui/MainWindowInner.qml @@ -45,7 +45,7 @@ Item { QGCPalette { id: qgcPal; colorGroupEnabled: true } - property real tbHeight: ScreenTools.isMobile ? (ScreenTools.isTinyScreen ? (mainWindow.width * 0.0666) : (mainWindow.width * 0.05)) : ScreenTools.defaultFontPixelSize * 4 + property real tbHeight: ScreenTools.isMobile ? (ScreenTools.isTinyScreen ? (mainWindow.width * 0.0666) : (mainWindow.width * 0.05)) : ScreenTools.defaultFontPixelHeight * 4 property int tbCellHeight: tbHeight * 0.75 property real tbSpacing: ScreenTools.isMobile ? width * 0.00824 : 9.54 property real tbButtonWidth: tbCellHeight * 1.35 @@ -373,6 +373,7 @@ Item { textFormat: TextEdit.RichText color: "white" font.family: ScreenTools.normalFontFamily + font.pointSize: ScreenTools.defaultFontPointSize } } //-- Dismiss System Message @@ -380,7 +381,7 @@ Item { anchors.margins: ScreenTools.defaultFontPixelHeight anchors.top: parent.top anchors.right: parent.right - width: ScreenTools.isTinyScreen ? ScreenTools.defaultFontPixelHeight * 2.5 : ScreenTools.defaultFontPixelHeight * 1.5 + width: ScreenTools.defaultFontPixelHeight * 1.5 height: width source: "/res/XDelete.svg" fillMode: Image.PreserveAspectFit @@ -451,6 +452,7 @@ Item { anchors.left: parent.left readOnly: true textFormat: TextEdit.RichText + font.pointSize: ScreenTools.defaultFontPointSize font.family: ScreenTools.demiboldFontFamily wrapMode: TextEdit.WordWrap color: qgcPal.warningText @@ -463,7 +465,7 @@ Item { anchors.margins: ScreenTools.defaultFontPixelHeight anchors.top: parent.top anchors.right: parent.right - width: ScreenTools.isTinyScreen ? ScreenTools.defaultFontPixelHeight * 2.5 : ScreenTools.defaultFontPixelHeight * 1.5 + width: ScreenTools.defaultFontPixelHeight * 1.5 height: width source: "/res/XDelete.svg" fillMode: Image.PreserveAspectFit diff --git a/src/ui/MainWindowLeftPanel.qml b/src/ui/MainWindowLeftPanel.qml index df40417270655b08956efcbd730459192f67320a..f48daebde15f6a4cc8421c071d1c35d239c7f862 100644 --- a/src/ui/MainWindowLeftPanel.qml +++ b/src/ui/MainWindowLeftPanel.qml @@ -155,7 +155,7 @@ Item { anchors.right: parent.right anchors.topMargin: _margins anchors.top: parent.top - spacing: ScreenTools.defaultFontPixelHeight + spacing: ScreenTools.defaultFontPixelHeight * 0.5 QGCLabel { text: qsTr("Preferences") @@ -163,6 +163,7 @@ Item { } QGCButton { + height: ScreenTools.defaultFontPixelHeight * 2 anchors.left: parent.left anchors.right: parent.right text: qsTr("General") @@ -176,6 +177,7 @@ Item { } QGCButton { + height: ScreenTools.defaultFontPixelHeight * 2 anchors.left: parent.left anchors.right: parent.right text: qsTr("Comm Links") @@ -189,6 +191,7 @@ Item { } QGCButton { + height: ScreenTools.defaultFontPixelHeight * 2 anchors.left: parent.left anchors.right: parent.right text: qsTr("Offline Maps") @@ -202,6 +205,7 @@ Item { } QGCButton { + height: ScreenTools.defaultFontPixelHeight * 2 anchors.left: parent.left anchors.right: parent.right text: qsTr("MavLink") @@ -215,6 +219,7 @@ Item { } QGCButton { + height: ScreenTools.defaultFontPixelHeight * 2 anchors.left: parent.left anchors.right: parent.right text: qsTr("Console") @@ -228,6 +233,7 @@ Item { } QGCButton { + height: ScreenTools.defaultFontPixelHeight * 2 anchors.left: parent.left anchors.right: parent.right text: qsTr("Mock Link") @@ -242,6 +248,7 @@ Item { } QGCButton { + height: ScreenTools.defaultFontPixelHeight * 2 anchors.left: parent.left anchors.right: parent.right text: qsTr("Debug") @@ -301,7 +308,7 @@ Item { height: __closeButtonSize anchors.right: parent.right anchors.top: parent.top - anchors.margins: ScreenTools.defaultFontPixelSize * 0.5 + anchors.margins: ScreenTools.defaultFontPixelHeight * 0.5 QGCColoredImage { source: "/res/XDelete.svg" mipmap: true diff --git a/src/ui/preferences/DebugWindow.qml b/src/ui/preferences/DebugWindow.qml index dc577bce59f43302389d3bf2087dc21805fad744..3d8a5bec23e6ac1f310e7e9de2891f2a37b69b6f 100644 --- a/src/ui/preferences/DebugWindow.qml +++ b/src/ui/preferences/DebugWindow.qml @@ -91,7 +91,7 @@ QGCView { font.family: ScreenTools.normalFontFamily } Text { - text: _textMeasure.font.pixelSize + text: _textMeasure.font.pointSize color: qgcPal.text font.family: ScreenTools.normalFontFamily } diff --git a/src/ui/preferences/GeneralSettings.qml b/src/ui/preferences/GeneralSettings.qml index eb70eab3b250d8707124535f597e801ee076d8e8..d240a340f9a7da93fd537e6465e536b2c8fee54b 100644 --- a/src/ui/preferences/GeneralSettings.qml +++ b/src/ui/preferences/GeneralSettings.qml @@ -59,7 +59,7 @@ Rectangle { QGCLabel { text: qsTr("General Settings") - font.pixelSize: ScreenTools.mediumFontPixelSize + font.pointSize: ScreenTools.mediumFontPointSize } Rectangle { height: 1 diff --git a/src/ui/preferences/LinkSettings.qml b/src/ui/preferences/LinkSettings.qml index 3fd960c3e02d030be04950e3a867cc0c1da885b5..d744b516ba3674ac1fbf74406e41b53db256d9ad 100644 --- a/src/ui/preferences/LinkSettings.qml +++ b/src/ui/preferences/LinkSettings.qml @@ -74,7 +74,7 @@ Rectangle { spacing: ScreenTools.defaultFontPixelHeight / 2 QGCLabel { text: qsTr("Comm Link Settings") - font.pixelSize: ScreenTools.mediumFontPixelSize + font.pointSize: ScreenTools.mediumFontPointSize } Rectangle { height: 1 @@ -214,7 +214,7 @@ Rectangle { spacing: ScreenTools.defaultFontPixelHeight / 2 QGCLabel { text: linkConfig ? qsTr("Edit Link Configuration Settings (WIP)") : qsTr("Create New Link Configuration (WIP)") - font.pixelSize: ScreenTools.mediumFontPixelSize + font.pointSize: ScreenTools.mediumFontPointSize } Rectangle { height: 1 diff --git a/src/ui/preferences/MavlinkSettings.qml b/src/ui/preferences/MavlinkSettings.qml index e82be6a04a9cafdf1bc847092e0b8cedc2140631..b67a9e5fa5cea88e713203c483700ed2698455e1 100644 --- a/src/ui/preferences/MavlinkSettings.qml +++ b/src/ui/preferences/MavlinkSettings.qml @@ -55,7 +55,7 @@ Rectangle { anchors.top: parent.top QGCLabel { text: qsTr("MavLink Settings") - font.pixelSize: ScreenTools.mediumFontPixelSize + font.pointSize: ScreenTools.mediumFontPointSize } Rectangle { height: 1 diff --git a/src/ui/toolbar/MainToolBar.qml b/src/ui/toolbar/MainToolBar.qml index ac3b71fbcacabb3e4b40f740bca86d6404eac92f..f486b68d8ca611722faff06dc3552d0eed710a39 100644 --- a/src/ui/toolbar/MainToolBar.qml +++ b/src/ui/toolbar/MainToolBar.qml @@ -503,7 +503,7 @@ Rectangle { QGCLabel { id: connectionLost text: qsTr("COMMUNICATION LOST") - font.pixelSize: tbFontLarge + font.pointSize: tbFontLarge font.family: ScreenTools.demiboldFontFamily color: colorRed anchors.rightMargin: ScreenTools.defaultFontPixelWidth diff --git a/src/ui/toolbar/MainToolBarIndicators.qml b/src/ui/toolbar/MainToolBarIndicators.qml index 629362b3ec4ef4965afe2c884d7f7a450c718696..924af5acfbf2847d39ce6a020ec0ffd0ec6f6316 100644 --- a/src/ui/toolbar/MainToolBarIndicators.qml +++ b/src/ui/toolbar/MainToolBarIndicators.qml @@ -187,7 +187,7 @@ Row { //anchors.left: parent.left anchors.right: gpsRow.right visible: activeVehicle && !isNaN(activeVehicle.gps.hdop.value) - font.pixelSize: tbFontSmall + font.pointSize: tbFontSmall color: qgcPal.buttonText text: activeVehicle ? activeVehicle.gps.hdop.value.toFixed(0) : "" } @@ -288,7 +288,7 @@ Row { QGCLabel { text: getBatteryPercentageText() - font.pixelSize: tbFontLarge + font.pointSize: tbFontLarge color: getBatteryColor() anchors.verticalCenter: parent.verticalCenter } @@ -309,7 +309,7 @@ Row { //-- Vehicle Selector QGCButton { id: vehicleSelectorButton - width: ScreenTools.defaultFontPixelSize * 8 + width: ScreenTools.defaultFontPixelHeight * 8 text: "Vehicle " + (activeVehicle ? activeVehicle.id : "None") visible: QGroundControl.multiVehicleManager.vehicles.count > 1 anchors.verticalCenter: parent.verticalCenter @@ -375,7 +375,7 @@ Row { QGCLabel { text: activeVehicle ? activeVehicle.flightMode : qsTr("N/A", "No data to display") - font.pixelSize: tbFontLarge + font.pointSize: tbFontLarge color: qgcPal.buttonText anchors.verticalCenter: parent.verticalCenter } @@ -470,7 +470,7 @@ Row { anchors.rightMargin: getProportionalDimmension(6) anchors.verticalCenter: parent.verticalCenter horizontalAlignment: Text.AlignRight - font.pixelSize: ScreenTools.smallFontPixelSize + font.pointSize: ScreenTools.smallFontPointSize font.family: ScreenTools.demiboldFontFamily color: colorWhite } @@ -503,7 +503,7 @@ Row { anchors.right: parent.right QGCLabel { text: 'R ' - font.pixelSize: ScreenTools.smallFontPixelSize + font.pointSize: ScreenTools.smallFontPointSize font.family: ScreenTools.demiboldFontFamily color: colorWhite } @@ -511,7 +511,7 @@ Row { text: _controller.telemetryRRSSI + 'dBm' width: getProportionalDimmension(30) horizontalAlignment: Text.AlignRight - font.pixelSize: ScreenTools.smallFontPixelSize + font.pointSize: ScreenTools.smallFontPointSize font.family: ScreenTools.demiboldFontFamily color: colorWhite } @@ -520,7 +520,7 @@ Row { anchors.right: parent.right QGCLabel { text: 'L ' - font.pixelSize: ScreenTools.smallFontPixelSize + font.pointSize: ScreenTools.smallFontPointSize font.family: ScreenTools.demiboldFontFamily color: colorWhite } @@ -528,7 +528,7 @@ Row { text: _controller.telemetryLRSSI + 'dBm' width: getProportionalDimmension(30) horizontalAlignment: Text.AlignRight - font.pixelSize: ScreenTools.smallFontPixelSize + font.pointSize: ScreenTools.smallFontPointSize font.family: ScreenTools.demiboldFontFamily color: colorWhite } diff --git a/src/ui/uas/UASQuickViewTextItem.cc b/src/ui/uas/UASQuickViewTextItem.cc index c11cb817bf3c864c2d9e1efd2cbc675d3cc14432..2183cd8bfc7c42bf3e1ff771b52a026aa160e1de 100644 --- a/src/ui/uas/UASQuickViewTextItem.cc +++ b/src/ui/uas/UASQuickViewTextItem.cc @@ -73,7 +73,7 @@ int UASQuickViewTextItem::minValuePixelSize() QFont valuefont = valueLabel->font(); QFont titlefont = titleLabel->font(); valuefont.setPixelSize(this->height()); - titlefont.setPixelSize(valuefont.pixelSize() * 0.75); + titlefont.setPixelSize(valuefont.pointSize() * 0.75); //spacerItem->setGeometry(QRect(0,0,20,this->height()/10.0)); QFontMetrics metrics(valuefont); @@ -91,27 +91,27 @@ int UASQuickViewTextItem::minValuePixelSize() fit = true; else { - if (valuefont.pixelSize() - 1 <= 6) + if (valuefont.pointSize() - 1 <= 6) { fit = true; valuefont.setPixelSize(6); } else { - valuefont.setPixelSize(valuefont.pixelSize() - 1); + valuefont.setPixelSize(valuefont.pointSize() - 1); } - //titlefont.setPixelSize(valuefont.pixelSize() / 2.0); - //qDebug() << "Point size:" << valuefont.pixelSize() << valueLabel->width() << valueLabel->height(); + //titlefont.setPixelSize(valuefont.pointSize() / 2.0); + //qDebug() << "Point size:" << valuefont.pointSize() << valueLabel->width() << valueLabel->height(); } } - return valuefont.pixelSize(); + return valuefont.pointSize(); } void UASQuickViewTextItem::setValuePixelSize(int size) { QFont valuefont = valueLabel->font(); QFont titlefont = titleLabel->font(); valuefont.setPixelSize(size); - titlefont.setPixelSize(valuefont.pixelSize() * 0.75); + titlefont.setPixelSize(valuefont.pointSize() * 0.75); valueLabel->setFont(valuefont); titleLabel->setFont(titlefont); update(); @@ -126,7 +126,7 @@ void UASQuickViewTextItem::resizeEvent(QResizeEvent *event) QFont valuefont = valueLabel->font(); QFont titlefont = titleLabel->font(); valuefont.setPixelSize(this->height()); - titlefont.setPixelSize(valuefont.pixelSize() / 2.0); + titlefont.setPixelSize(valuefont.pointSize() / 2.0); //spacerItem->setGeometry(QRect(0,0,20,this->height()/10.0)); QFontMetrics metrics(valuefont); @@ -144,20 +144,20 @@ void UASQuickViewTextItem::resizeEvent(QResizeEvent *event) fit = true; else { - if (valuefont.pixelSize()-5 <= 0) + if (valuefont.pointSize()-5 <= 0) { fit = true; valuefont.setPixelSize(5); } else { - valuefont.setPixelSize(valuefont.pixelSize() - 5); + valuefont.setPixelSize(valuefont.pointSize() - 5); } - //titlefont.setPixelSize(valuefont.pixelSize() / 2.0); - //qDebug() << "Point size:" << valuefont.pixelSize() << valueLabel->width() << valueLabel->height(); + //titlefont.setPixelSize(valuefont.pointSize() / 2.0); + //qDebug() << "Point size:" << valuefont.pointSize() << valueLabel->width() << valueLabel->height(); } } -titlefont.setPixelSize(valuefont.pixelSize() / 2.0); +titlefont.setPixelSize(valuefont.pointSize() / 2.0); valueLabel->setFont(valuefont); titleLabel->setFont(titlefont); update();