Commit 9f5ffd93 authored by Gus Grubba's avatar Gus Grubba

Merge pull request #3307 from dogmaphobic/uiTweaks

Ui tweaks
parents 151af212 a2c8716b
......@@ -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()
......
......@@ -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"/>
</g>
</g>
<path class="st4" d="M27.003,55.688c0.762-0.793,1.69-1.182,2.785-1.166c1.095,0.016,2.039,0.405,2.833,1.166
c0.793,0.762,1.19,1.69,1.19,2.785s-0.397,2.039-1.19,2.833c-0.762,0.793-1.69,1.19-2.785,1.19s-2.039-0.397-2.833-1.19
c-0.793-0.762-1.19-1.698-1.19-2.809S26.209,56.45,27.003,55.688z M13.006,71.352c1.047,0,1.968,0.397,2.761,1.19
c3.872,3.84,8.554,5.761,14.045,5.761s10.172-1.92,14.045-5.761c0.793-0.793,1.73-1.182,2.809-1.166s2.015,0.405,2.809,1.166
c0.793,0.793,1.19,1.722,1.19,2.785s-0.397,1.992-1.19,2.785c-3.555,3.555-7.713,5.959-12.473,7.213s-9.53,1.254-14.306,0
s-8.942-3.658-12.497-7.213c-0.793-0.793-1.19-1.722-1.19-2.785s0.397-1.992,1.19-2.785C10.99,71.749,11.927,71.352,13.006,71.352z
M38.238,62.925c1.079,0,2.015,0.397,2.809,1.19c0.793,0.793,1.19,1.73,1.19,2.809s-0.397,2.015-1.19,2.809
c-2.031,2.031-4.412,3.404-7.141,4.118s-5.459,0.714-8.189,0s-5.11-2.087-7.141-4.118c-0.793-0.793-1.19-1.73-1.19-2.809
s0.397-2.015,1.19-2.809c0.793-0.793,1.73-1.19,2.809-1.19s2.015,0.397,2.809,1.19c1.555,1.555,3.428,2.333,5.618,2.333
s4.063-0.778,5.618-2.333C36.223,63.322,37.159,62.925,38.238,62.925z"/>
<path class="st4" d="M27.585,61.972c0.605-0.63,1.343-0.939,2.213-0.927c0.87,0.013,1.62,0.322,2.251,0.927
c0.63,0.605,0.946,1.343,0.946,2.213c0,0.87-0.315,1.62-0.946,2.251c-0.605,0.63-1.343,0.946-2.213,0.946s-1.62-0.315-2.251-0.946
c-0.63-0.605-0.946-1.349-0.946-2.232C26.639,63.321,26.954,62.577,27.585,61.972z M16.464,74.417c0.832,0,1.563,0.315,2.194,0.946
c3.076,3.051,6.796,4.577,11.158,4.577s8.082-1.526,11.158-4.577c0.63-0.63,1.374-0.939,2.232-0.927
c0.857,0.013,1.601,0.322,2.232,0.927c0.63,0.63,0.946,1.368,0.946,2.213s-0.315,1.582-0.946,2.213
c-2.824,2.824-6.128,4.734-9.91,5.731s-7.571,0.996-11.366,0s-7.105-2.906-9.929-5.731c-0.63-0.63-0.946-1.368-0.946-2.213
s0.315-1.582,0.946-2.213C14.863,74.732,15.607,74.417,16.464,74.417z M36.511,67.722c0.857,0,1.601,0.315,2.232,0.946
c0.63,0.63,0.946,1.374,0.946,2.232c0,0.857-0.315,1.601-0.946,2.232c-1.614,1.614-3.505,2.705-5.674,3.272
c-2.169,0.567-4.337,0.567-6.506,0s-4.06-1.658-5.674-3.272c-0.63-0.63-0.946-1.374-0.946-2.232c0-0.857,0.315-1.601,0.946-2.232
c0.63-0.63,1.374-0.946,2.232-0.946c0.857,0,1.601,0.315,2.232,0.946c1.236,1.236,2.723,1.853,4.463,1.853s3.228-0.618,4.463-1.853
C34.91,68.037,35.654,67.722,36.511,67.722z"/>
</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"/>
</g>
</g>
<path class="st4" d="M32.668,85.099c-0.762,0.793-1.69,1.182-2.785,1.166s-2.039-0.405-2.833-1.166
c-0.793-0.762-1.19-1.69-1.19-2.785s0.397-2.039,1.19-2.833c0.762-0.793,1.69-1.19,2.785-1.19s2.039,0.397,2.833,1.19
c0.793,0.762,1.19,1.698,1.19,2.809S33.462,84.337,32.668,85.099z M46.665,69.435c-1.047,0-1.968-0.397-2.761-1.19
c-3.872-3.84-8.554-5.761-14.045-5.761s-10.172,1.92-14.045,5.761c-0.793,0.793-1.73,1.182-2.809,1.166s-2.015-0.405-2.809-1.166
c-0.793-0.793-1.19-1.722-1.19-2.785s0.397-1.992,1.19-2.785c3.555-3.555,7.713-5.959,12.473-7.213s9.53-1.254,14.306,0
s8.942,3.658,12.497,7.213c0.793,0.793,1.19,1.722,1.19,2.785s-0.397,1.992-1.19,2.785C48.68,69.038,47.744,69.435,46.665,69.435z
M21.432,77.862c-1.079,0-2.015-0.397-2.809-1.19c-0.793-0.793-1.19-1.73-1.19-2.809s0.397-2.015,1.19-2.809
c2.031-2.031,4.412-3.404,7.141-4.118s5.459-0.714,8.189,0s5.11,2.087,7.141,4.118c0.793,0.793,1.19,1.73,1.19,2.809
s-0.397,2.015-1.19,2.809c-0.793,0.793-1.73,1.19-2.809,1.19s-2.015-0.397-2.809-1.19c-1.555-1.555-3.428-2.333-5.618-2.333
s-4.063,0.778-5.618,2.333C23.448,77.465,22.512,77.862,21.432,77.862z"/>
<path class="st4" d="M32.086,85.338c-0.605,0.63-1.343,0.939-2.213,0.927c-0.87-0.013-1.62-0.322-2.251-0.927
s-0.946-1.343-0.946-2.213s0.315-1.62,0.946-2.251c0.605-0.63,1.343-0.946,2.213-0.946s1.62,0.315,2.251,0.946
c0.63,0.605,0.946,1.349,0.946,2.232S32.716,84.733,32.086,85.338z M43.206,72.894c-0.832,0-1.563-0.315-2.194-0.946
c-3.076-3.051-6.796-4.577-11.158-4.577s-8.082,1.526-11.158,4.577c-0.63,0.63-1.374,0.939-2.232,0.927
c-0.857-0.013-1.601-0.322-2.232-0.927c-0.63-0.63-0.946-1.368-0.946-2.213s0.315-1.582,0.946-2.213
c2.824-2.824,6.128-4.734,9.91-5.731c3.782-0.996,7.571-0.996,11.366,0c3.795,0.996,7.105,2.906,9.929,5.731
c0.63,0.63,0.946,1.368,0.946,2.213s-0.315,1.582-0.946,2.213C44.808,72.579,44.064,72.894,43.206,72.894z M23.159,79.589
c-0.857,0-1.601-0.315-2.232-0.946c-0.63-0.63-0.946-1.374-0.946-2.232c0-0.857,0.315-1.601,0.946-2.232
c1.614-1.614,3.505-2.705,5.674-3.272c2.169-0.567,4.337-0.567,6.506,0c2.169,0.567,4.06,1.658,5.674,3.272
c0.63,0.63,0.946,1.374,0.946,2.232c0,0.857-0.315,1.601-0.946,2.232c-0.63,0.63-1.374,0.946-2.232,0.946
c-0.857,0-1.601-0.315-2.232-0.946c-1.236-1.236-2.723-1.853-4.463-1.853s-3.228,0.618-4.463,1.853
C24.761,79.274,24.017,79.589,23.159,79.589z"/>
</svg>
......@@ -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
......
......@@ -25,7 +25,7 @@ FactPanel {
anchors.margins: 8
VehicleSummaryRow {
labelText: qsTr("Camera trigger mode:")
labelText: qsTr("Trigger mode:")
valueText: _camTriggerMode ? _camTriggerMode.enumStringValue : ""
}
......
......@@ -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")) {
......
......@@ -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)
}
......
......@@ -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
......
......@@ -25,6 +25,7 @@
/// @author Gus Grubba <mavlink@grubba.com>
#include "ScreenToolsController.h"
#include <QScreen>
#ifdef Q_OS_WIN
const double ScreenToolsController::_defaultFontPixelSizeRatio = 1.0;
......@@ -42,5 +43,4 @@ const double ScreenToolsController::_largeFontPixelSizeRatio = 1.66;
ScreenToolsController::ScreenToolsController()
{
}
......@@ -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
......
......@@ -225,6 +225,7 @@ Rectangle {
anchors.bottom: parent.bottom
contentHeight: buttonColumn.height
flickableDirection: Flickable.VerticalFlick
clip: true
Column {
id: buttonColumn
......
......@@ -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"
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment