diff --git a/src/AutoPilotPlugins/Common/ESP8266Component.qml b/src/AutoPilotPlugins/Common/ESP8266Component.qml index 29521cdae23af19232ed496b851d260f6c4eee09..ec6775c40cffd595326162accd51c060c69863b6 100644 --- a/src/AutoPilotPlugins/Common/ESP8266Component.qml +++ b/src/AutoPilotPlugins/Common/ESP8266Component.qml @@ -41,10 +41,10 @@ QGCView { QGCPalette { id: palette; colorGroupEnabled: panel.enabled } property real _margins: ScreenTools.defaultFontPixelHeight - property real _middleRowWidth: ScreenTools.defaultFontPixelWidth * 18 - property real _editFieldWidth: ScreenTools.defaultFontPixelWidth * 18 - property real _labelWidth: ScreenTools.defaultFontPixelWidth * 10 - property real _statusWidth: ScreenTools.defaultFontPixelWidth * 5 + property real _middleRowWidth: ScreenTools.defaultFontPixelWidth * 22 + property real _editFieldWidth: ScreenTools.defaultFontPixelWidth * 20 + property real _labelWidth: ScreenTools.isTinyScreen ? ScreenTools.defaultFontPixelWidth * 10 : ScreenTools.defaultFontPixelWidth * 12 + property real _statusWidth: ScreenTools.isTinyScreen ? ScreenTools.defaultFontPixelWidth * 7 : ScreenTools.defaultFontPixelWidth * 8 readonly property string dialogTitle: qsTr("controller WiFi Bridge") property int stStatus: XMLHttpRequest.UNSENT @@ -139,19 +139,17 @@ QGCView { height: settingsRow.height + _margins * 2 Row { id: settingsRow - spacing: _margins + spacing: _margins * 4 anchors.centerIn: parent - Item { width: _margins * 0.5; height: 1; } QGCColoredImage { color: palette.text - height: ScreenTools.defaultFontPixelWidth * 10 width: ScreenTools.defaultFontPixelWidth * 12 + height: width * 1.45 mipmap: true fillMode: Image.PreserveAspectFit source: wifiMode ? (wifiMode.value === 0 ? "/qmlimages/APMode.svg" : "/qmlimages/StationMode.svg") : "/qmlimages/APMode.svg" anchors.verticalCenter: parent.verticalCenter } - Item { width: _margins * 0.5; height: 1; } Column { spacing: _margins * 0.5 anchors.verticalCenter: parent.verticalCenter @@ -458,7 +456,7 @@ QGCView { anchors.horizontalCenter: parent.horizontalCenter QGCButton { text: qsTr("Restore Defaults") - width: ScreenTools.defaultFontPixelWidth * 16 + width: _editFieldWidth onClicked: { controller.restoreDefaults() } @@ -466,7 +464,7 @@ QGCView { QGCButton { text: qsTr("Restart WiFi Bridge") enabled: !controller.busy - width: ScreenTools.defaultFontPixelWidth * 16 + width: _editFieldWidth onClicked: { rebootDialog.visible = true } @@ -488,7 +486,7 @@ QGCView { } QGCButton { text: qsTr("Reset Counters") - width: ScreenTools.defaultFontPixelWidth * 16 + width: _editFieldWidth onClicked: { stResetCounters = true; updateStatus() diff --git a/src/AutoPilotPlugins/Common/Images/APMode.svg b/src/AutoPilotPlugins/Common/Images/APMode.svg index 4de7b3ecbdf841b338be608313d5adea6b03d498..959e6eb6746e7cf6be52dd4f9d778bcaf086867d 100644 --- a/src/AutoPilotPlugins/Common/Images/APMode.svg +++ b/src/AutoPilotPlugins/Common/Images/APMode.svg @@ -66,14 +66,15 @@ c0.453-3.364,4.404-5.613,8.845-5.613C34.276,13.527,38.228,15.777,38.681,19.141z"/> - + diff --git a/src/AutoPilotPlugins/Common/Images/StationMode.svg b/src/AutoPilotPlugins/Common/Images/StationMode.svg index 1322d7edc1e1c39b2fff6878d694bc9d2ac261a4..9c10616fc30e9b5d7be7f670423c0925a61a43a8 100644 --- a/src/AutoPilotPlugins/Common/Images/StationMode.svg +++ b/src/AutoPilotPlugins/Common/Images/StationMode.svg @@ -66,14 +66,16 @@ c0.453-3.364,4.404-5.613,8.845-5.613C34.276,13.527,38.228,15.777,38.681,19.141z"/> - + diff --git a/src/AutoPilotPlugins/PX4/CameraComponent.qml b/src/AutoPilotPlugins/PX4/CameraComponent.qml index 63c50750529ba1d07784aa54cc791ab61dfa7a58..45a25ddad5c98a4fb55887fda7e3d13a88363de0 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 * 22 - property real _editFieldWidth: ScreenTools.defaultFontPixelWidth * 18 + property real _middleRowWidth: ScreenTools.defaultFontPixelWidth * 20 + property real _editFieldWidth: ScreenTools.defaultFontPixelWidth * 20 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 79aa77724d626f4d2c5332ce7b6d9418aa0639ac..5064e9af4e6bb35338386a886999fda0cd54599b 100644 --- a/src/AutoPilotPlugins/PX4/CameraComponentSummary.qml +++ b/src/AutoPilotPlugins/PX4/CameraComponentSummary.qml @@ -25,7 +25,7 @@ FactPanel { anchors.margins: 8 VehicleSummaryRow { - labelText: qsTr("Camera trigger mode:") + labelText: qsTr("Trigger mode:") valueText: _camTriggerMode ? _camTriggerMode.enumStringValue : "" } diff --git a/src/AutoPilotPlugins/PX4/PX4AutoPilotPlugin.cc b/src/AutoPilotPlugins/PX4/PX4AutoPilotPlugin.cc index ee5fad3d5952001f11e4012a3cb038d06ea9ac16..1bc95fbc81d7b36250c9a47a2ced7b94b66f1344 100644 --- a/src/AutoPilotPlugins/PX4/PX4AutoPilotPlugin.cc +++ b/src/AutoPilotPlugins/PX4/PX4AutoPilotPlugin.cc @@ -126,9 +126,12 @@ const QVariantList& PX4AutoPilotPlugin::vehicleComponents(void) _tuningComponent->setupTriggerSignals(); _components.append(QVariant::fromValue((VehicleComponent*)_tuningComponent)); - _cameraComponent = new CameraComponent(_vehicle, this); - _cameraComponent->setupTriggerSignals(); - _components.append(QVariant::fromValue((VehicleComponent*)_cameraComponent)); + //-- Is there support for cameras? + if(factExists(FactSystem::ParameterProvider, _vehicle->id(), "TRIG_MODE")) { + _cameraComponent = new CameraComponent(_vehicle, this); + _cameraComponent->setupTriggerSignals(); + _components.append(QVariant::fromValue((VehicleComponent*)_cameraComponent)); + } //-- Is there an ESP8266 Connected? if(factExists(FactSystem::ParameterProvider, MAV_COMP_ID_UDP_BRIDGE, "SW_VER")) { diff --git a/src/QmlControls/ParameterEditorDialog.qml b/src/QmlControls/ParameterEditorDialog.qml index 48d0a0831a3210ff56ee39912ecb79fcb92f717f..4931f0e9509a2ea963062bd661ad463461e1b119 100644 --- a/src/QmlControls/ParameterEditorDialog.qml +++ b/src/QmlControls/ParameterEditorDialog.qml @@ -42,6 +42,8 @@ QGCViewDialog { property bool validate: false property string validateValue + property real _editFieldWidth: ScreenTools.defaultFontPixelWidth * 20 + ParameterEditorController { id: controller; factPanel: parent } QGCPalette { id: qgcPal; colorGroupEnabled: true } @@ -124,6 +126,7 @@ QGCViewDialog { QGCButton { anchors.baseline: valueField.baseline visible: fact.defaultValueAvailable + width: _editFieldWidth text: qsTr("Reset to default") onClicked: { @@ -244,6 +247,7 @@ QGCViewDialog { QGCButton { text: qsTr("Set RC to Param...") + width: _editFieldWidth visible: _advanced.checked && !validate && showRCToParam onClicked: controller.setRCToParam(fact.name) } diff --git a/src/QmlControls/ScreenTools.qml b/src/QmlControls/ScreenTools.qml index 74f5481e11f7facc8a12514c870baf0799007e75..4053ab46288709e4d023927f206b00de85ed49e8 100644 --- a/src/QmlControls/ScreenTools.qml +++ b/src/QmlControls/ScreenTools.qml @@ -13,10 +13,10 @@ Item { readonly property real defaultFontPixelSize: _textMeasure.fontHeight * ScreenToolsController.defaultFontPixelSizeRatio readonly property real defaultFontPixelHeight: defaultFontPixelSize - readonly property real defaultFontPixelWidth: _textMeasure.fontWidth - readonly property real smallFontPixelSize: defaultFontPixelSize * ScreenToolsController.smallFontPixelSizeRatio + 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 + readonly property real smallFontPixelWidth: defaultFontPixelWidth * ScreenToolsController.smallFontPixelSizeRatio // To proportionally scale fonts diff --git a/src/QmlControls/ScreenToolsController.cc b/src/QmlControls/ScreenToolsController.cc index c226cd6f81b7dd41caedd5d468a363ef1e74f80a..945482fd15ea3017aa580e5ef2f1d76a53604ed5 100644 --- a/src/QmlControls/ScreenToolsController.cc +++ b/src/QmlControls/ScreenToolsController.cc @@ -25,6 +25,7 @@ /// @author Gus Grubba #include "ScreenToolsController.h" +#include #ifdef Q_OS_WIN const double ScreenToolsController::_defaultFontPixelSizeRatio = 1.0; @@ -42,5 +43,4 @@ const double ScreenToolsController::_largeFontPixelSizeRatio = 1.66; ScreenToolsController::ScreenToolsController() { - } diff --git a/src/QmlControls/SubMenuButton.qml b/src/QmlControls/SubMenuButton.qml index 4d4538b13205b3f06d330ce2c93b98c89894ec92..aad36aba13077845b0b76405111fb7b064b2d935 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.defaultFontPixelHeight * 2.5 + implicitHeight: ScreenTools.isTinyScreen ? ScreenTools.defaultFontPixelHeight * 3 : ScreenTools.defaultFontPixelHeight * 2.5 style: ButtonStyle { id: buttonStyle diff --git a/src/VehicleSetup/SetupView.qml b/src/VehicleSetup/SetupView.qml index 35c85d91ecf5b91184e283e09cf34ce816e67ff0..843ff3b9763d64e1a47da3916f8d1696a8892c79 100644 --- a/src/VehicleSetup/SetupView.qml +++ b/src/VehicleSetup/SetupView.qml @@ -225,6 +225,7 @@ Rectangle { anchors.bottom: parent.bottom contentHeight: buttonColumn.height flickableDirection: Flickable.VerticalFlick + clip: true Column { id: buttonColumn diff --git a/src/VehicleSetup/VehicleSummary.qml b/src/VehicleSetup/VehicleSummary.qml index 977370f636b6d3a3e5ec57a71cbabf448f009360..34a0ee86e2f450d17972559c8f5fde3e1c07c7fc 100644 --- a/src/VehicleSetup/VehicleSummary.qml +++ b/src/VehicleSetup/VehicleSummary.qml @@ -37,7 +37,7 @@ Rectangle { anchors.fill: parent color: qgcPal.window - property real _minSummaryW: ScreenTools.defaultFontPixelWidth * 30 + property real _minSummaryW: ScreenTools.defaultFontPixelWidth * 40 property real _summaryBoxWidth: _minSummaryW property real _summaryBoxSpace: ScreenTools.defaultFontPixelWidth @@ -93,6 +93,7 @@ Rectangle { wrapMode: Text.WordWrap color: setupComplete ? qgcPal.text : qgcPal.warningText font.weight: Font.DemiBold + 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.") : qsTr("WARNING: Your vehicle requires setup prior to flight. Please resolve the items marked in red using the menu on the left.") @@ -112,7 +113,7 @@ Rectangle { width: _summaryBoxWidth height: ScreenTools.defaultFontPixelHeight * 13 color: qgcPal.window - visible: modelData.summaryQmlSource.toString() != "" + visible: modelData.summaryQmlSource.toString() !== "" readonly property real titleHeight: ScreenTools.defaultFontPixelHeight * 2 @@ -121,14 +122,14 @@ Rectangle { id: titleBar width: parent.width height: titleHeight - text: capitalizeWords(modelData.name) + text: capitalizeWords(modelData.name) // Setup indicator Rectangle { - anchors.rightMargin: ScreenTools.defaultFontPixelWidth / 3 + anchors.rightMargin: ScreenTools.defaultFontPixelWidth * 0.5 anchors.right: parent.right anchors.verticalCenter: parent.verticalCenter - width: ScreenTools.defaultFontPixelWidth + width: ScreenTools.defaultFontPixelWidth * 1.5 height: width radius: width / 2 color: modelData.setupComplete ? "#00d932" : "red" diff --git a/src/ui/MainWindowInner.qml b/src/ui/MainWindowInner.qml index ff27c97a23d3cafca2db8162bf991abe4adc3ed6..acb23179763337c91f3787e80b86808b35ee5c86 100644 --- a/src/ui/MainWindowInner.qml +++ b/src/ui/MainWindowInner.qml @@ -354,6 +354,8 @@ Item { color: Qt.rgba(0,0,0,0.8) visible: false radius: ScreenTools.defaultFontPixelHeight * 0.5 + border.color: qgcPal.text + border.width: 2 anchors.horizontalCenter: parent.horizontalCenter anchors.top: parent.top anchors.topMargin: tbHeight + ScreenTools.defaultFontPixelHeight @@ -420,6 +422,8 @@ Item { anchors.horizontalCenter: parent.horizontalCenter anchors.bottom: parent.bottom anchors.bottomMargin: ScreenTools.defaultFontPixelHeight + border.color: qgcPal.text + border.width: 2 MouseArea { // This MouseArea prevents the Map below it from getting Mouse events. Without this